SVecAbsExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECABSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECABSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
44 #include <iterator>
66 #include <blaze/util/Assert.h>
68 #include <blaze/util/EnableIf.h>
69 #include <blaze/util/Exception.h>
70 #include <blaze/util/InvalidType.h>
72 #include <blaze/util/SelectType.h>
73 #include <blaze/util/Types.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS SVECABSEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT // Type of the sparse vector
93  , bool TF > // Transpose flag
94 class SVecAbsExpr : public SparseVector< SVecAbsExpr<VT,TF>, TF >
95  , private VecAbsExpr
96  , private Computation
97 {
98  private:
99  //**Type definitions****************************************************************************
100  typedef typename VT::ResultType RT;
101  typedef typename VT::ReturnType RN;
102  typedef typename VT::CompositeType CT;
103  typedef typename VT::TransposeType TT;
104  typedef typename VT::ElementType ET;
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum { returnExpr = !IsTemporary<RN>::value };
115 
118  //**********************************************************************************************
119 
120  //**Serial evaluation strategy******************************************************************
122 
128  enum { useAssign = RequiresEvaluation<VT>::value };
129 
131  template< typename VT2 >
133  struct UseAssign {
134  enum { value = useAssign };
135  };
137  //**********************************************************************************************
138 
139  //**Parallel evaluation strategy****************************************************************
141 
147  template< typename VT2 >
148  struct UseSMPAssign {
149  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
150  };
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
157  typedef RT ResultType;
158  typedef TT TransposeType;
159  typedef ET ElementType;
160 
163 
166 
168  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
169  //**********************************************************************************************
170 
171  //**Compilation flags***************************************************************************
173  enum { smpAssignable = VT::smpAssignable };
174  //**********************************************************************************************
175 
176  //**ConstIterator class definition**************************************************************
180  {
181  public:
182  //**Type definitions*************************************************************************
185 
188 
189  typedef std::forward_iterator_tag IteratorCategory;
190  typedef Element ValueType;
191  typedef ValueType* PointerType;
192  typedef ValueType& ReferenceType;
194 
195  // STL iterator requirements
196  typedef IteratorCategory iterator_category;
197  typedef ValueType value_type;
198  typedef PointerType pointer;
199  typedef ReferenceType reference;
200  typedef DifferenceType difference_type;
201  //*******************************************************************************************
202 
203  //**Constructor******************************************************************************
206  inline ConstIterator( IteratorType it )
207  : it_( it ) // Iterator over the elements of the sparse vector expression
208  {}
209  //*******************************************************************************************
210 
211  //**Prefix increment operator****************************************************************
217  ++it_;
218  return *this;
219  }
220  //*******************************************************************************************
221 
222  //**Element access operator******************************************************************
227  inline const Element operator*() const {
228  using std::abs;
229  return Element( abs( it_->value() ), it_->index() );
230  }
231  //*******************************************************************************************
232 
233  //**Element access operator******************************************************************
238  inline const ConstIterator* operator->() const {
239  return this;
240  }
241  //*******************************************************************************************
242 
243  //**Value function***************************************************************************
248  inline ReturnType value() const {
249  using std::abs;
250  return abs( it_->value() );
251  }
252  //*******************************************************************************************
253 
254  //**Index function***************************************************************************
259  inline size_t index() const {
260  return it_->index();
261  }
262  //*******************************************************************************************
263 
264  //**Equality operator************************************************************************
270  inline bool operator==( const ConstIterator& rhs ) const {
271  return it_ == rhs.it_;
272  }
273  //*******************************************************************************************
274 
275  //**Inequality operator**********************************************************************
281  inline bool operator!=( const ConstIterator& rhs ) const {
282  return it_ != rhs.it_;
283  }
284  //*******************************************************************************************
285 
286  //**Subtraction operator*********************************************************************
292  inline DifferenceType operator-( const ConstIterator& rhs ) const {
293  return it_ - rhs.it_;
294  }
295  //*******************************************************************************************
296 
297  private:
298  //**Member variables*************************************************************************
299  IteratorType it_;
300  //*******************************************************************************************
301  };
302  //**********************************************************************************************
303 
304  //**Constructor*********************************************************************************
309  explicit inline SVecAbsExpr( const VT& sv )
310  : sv_( sv ) // Sparse vector of the absolute value expression
311  {}
312  //**********************************************************************************************
313 
314  //**Subscript operator**************************************************************************
320  inline ReturnType operator[]( size_t index ) const {
321  using std::abs;
322  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
323  return abs( sv_[index] );
324  }
325  //**********************************************************************************************
326 
327  //**At function*********************************************************************************
334  inline ReturnType at( size_t index ) const {
335  if( index >= sv_.size() ) {
336  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
337  }
338  return (*this)[index];
339  }
340  //**********************************************************************************************
341 
342  //**Begin function******************************************************************************
347  inline ConstIterator begin() const {
348  return ConstIterator( sv_.begin() );
349  }
350  //**********************************************************************************************
351 
352  //**End function********************************************************************************
357  inline ConstIterator end() const {
358  return ConstIterator( sv_.end() );
359  }
360  //**********************************************************************************************
361 
362  //**Size function*******************************************************************************
367  inline size_t size() const {
368  return sv_.size();
369  }
370  //**********************************************************************************************
371 
372  //**NonZeros function***************************************************************************
377  inline size_t nonZeros() const {
378  return sv_.nonZeros();
379  }
380  //**********************************************************************************************
381 
382  //**Find function*******************************************************************************
388  inline ConstIterator find( size_t index ) const {
390  return ConstIterator( sv_.find( index ) );
391  }
392  //**********************************************************************************************
393 
394  //**LowerBound function*************************************************************************
400  inline ConstIterator lowerBound( size_t index ) const {
402  return ConstIterator( sv_.lowerBound( index ) );
403  }
404  //**********************************************************************************************
405 
406  //**UpperBound function*************************************************************************
412  inline ConstIterator upperBound( size_t index ) const {
414  return ConstIterator( sv_.upperBound( index ) );
415  }
416  //**********************************************************************************************
417 
418  //**Operand access******************************************************************************
423  inline Operand operand() const {
424  return sv_;
425  }
426  //**********************************************************************************************
427 
428  //**********************************************************************************************
434  template< typename T >
435  inline bool canAlias( const T* alias ) const {
436  return sv_.canAlias( alias );
437  }
438  //**********************************************************************************************
439 
440  //**********************************************************************************************
446  template< typename T >
447  inline bool isAliased( const T* alias ) const {
448  return sv_.isAliased( alias );
449  }
450  //**********************************************************************************************
451 
452  //**********************************************************************************************
457  inline bool canSMPAssign() const {
458  return sv_.canSMPAssign();
459  }
460  //**********************************************************************************************
461 
462  private:
463  //**Member variables****************************************************************************
464  Operand sv_;
465  //**********************************************************************************************
466 
467  //**Assignment to dense vectors*****************************************************************
481  template< typename VT2 > // Type of the target dense vector
482  friend inline typename EnableIf< UseAssign<VT2> >::Type
483  assign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
484  {
486 
487  using std::abs;
488 
489  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
490 
491  assign( ~lhs, rhs.sv_ );
492  assign( ~lhs, abs( ~lhs ) );
493  }
495  //**********************************************************************************************
496 
497  //**Assignment to sparse vectors****************************************************************
511  template< typename VT2 > // Type of the target sparse vector
512  friend inline typename EnableIf< UseAssign<VT2> >::Type
513  assign( SparseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
514  {
516 
517  using std::abs;
518 
519  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
520 
521  typedef typename VT2::Iterator Iterator;
522 
523  assign( ~lhs, rhs.sv_ );
524 
525  const Iterator end( (~lhs).end() );
526  for( Iterator element=(~lhs).begin(); element!=end; ++element ) {
527  element->value() = abs( element->value() );
528  }
529  }
531  //**********************************************************************************************
532 
533  //**Addition assignment to dense vectors********************************************************
547  template< typename VT2 > // Type of the target dense vector
548  friend inline typename EnableIf< UseAssign<VT2> >::Type
549  addAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
550  {
552 
556 
557  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
558 
559  const ResultType tmp( serial( rhs ) );
560  addAssign( ~lhs, tmp );
561  }
563  //**********************************************************************************************
564 
565  //**Addition assignment to sparse vectors*******************************************************
566  // No special implementation for the addition assignment to sparse vectors.
567  //**********************************************************************************************
568 
569  //**Subtraction assignment to dense vectors*****************************************************
583  template< typename VT2 > // Type of the target dense vector
584  friend inline typename EnableIf< UseAssign<VT2> >::Type
585  subAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
586  {
588 
592 
593  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
594 
595  const ResultType tmp( serial( rhs ) );
596  subAssign( ~lhs, tmp );
597  }
599  //**********************************************************************************************
600 
601  //**Subtraction assignment to sparse vectors****************************************************
602  // No special implementation for the subtraction assignment to sparse vectors.
603  //**********************************************************************************************
604 
605  //**Multiplication assignment to dense vectors**************************************************
619  template< typename VT2 > // Type of the target dense vector
620  friend inline typename EnableIf< UseAssign<VT2> >::Type
621  multAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
622  {
624 
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
630 
631  const ResultType tmp( serial( rhs ) );
632  multAssign( ~lhs, tmp );
633  }
635  //**********************************************************************************************
636 
637  //**Multiplication assignment to sparse vectors*************************************************
638  // No special implementation for the multiplication assignment to sparse vectors.
639  //**********************************************************************************************
640 
641  //**SMP assignment to dense vectors*************************************************************
655  template< typename VT2 > // Type of the target dense vector
656  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
657  smpAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
658  {
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
662 
663  smpAssign( ~lhs, rhs.sv_ );
664  smpAssign( ~lhs, abs( ~lhs ) );
665  }
667  //**********************************************************************************************
668 
669  //**SMP assignment to sparse vectors************************************************************
670  // No special implementation for the SMP assignment to sparse vectors.
671  //**********************************************************************************************
672 
673  //**SMP addition assignment to dense vectors****************************************************
687  template< typename VT2 > // Type of the target dense vector
688  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
689  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
690  {
692 
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
698 
699  const ResultType tmp( rhs );
700  smpAddAssign( ~lhs, tmp );
701  }
703  //**********************************************************************************************
704 
705  //**SMP addition assignment to sparse vectors***************************************************
706  // No special implementation for the SMP addition assignment to sparse vectors.
707  //**********************************************************************************************
708 
709  //**SMP subtraction assignment to dense vectors*************************************************
723  template< typename VT2 > // Type of the target dense vector
724  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
725  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
726  {
728 
732 
733  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
734 
735  const ResultType tmp( rhs );
736  smpSubAssign( ~lhs, tmp );
737  }
739  //**********************************************************************************************
740 
741  //**SMP subtraction assignment to sparse vectors************************************************
742  // No special implementation for the SMP subtraction assignment to sparse vectors.
743  //**********************************************************************************************
744 
745  //**SMP multiplication assignment to dense vectors**********************************************
759  template< typename VT2 > // Type of the target dense vector
760  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
761  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
762  {
764 
768 
769  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
770 
771  const ResultType tmp( rhs );
772  smpMultAssign( ~lhs, tmp );
773  }
775  //**********************************************************************************************
776 
777  //**SMP multiplication assignment to sparse vectors*********************************************
778  // No special implementation for the SMP multiplication assignment to sparse vectors.
779  //**********************************************************************************************
780 
781  //**Compile time checks*************************************************************************
786  //**********************************************************************************************
787 };
788 //*************************************************************************************************
789 
790 
791 
792 
793 //=================================================================================================
794 //
795 // GLOBAL FUNCTIONS
796 //
797 //=================================================================================================
798 
799 //*************************************************************************************************
816 template< typename VT // Type of the sparse vector
817  , bool TF > // Transpose flag
818 inline const SVecAbsExpr<VT,TF> abs( const SparseVector<VT,TF>& sv )
819 {
821 
822  return SVecAbsExpr<VT,TF>( ~sv );
823 }
824 //*************************************************************************************************
825 
826 
827 
828 
829 //=================================================================================================
830 //
831 // GLOBAL RESTRUCTURING FUNCTIONS
832 //
833 //=================================================================================================
834 
835 //*************************************************************************************************
846 template< typename VT // Type of the sparse vector
847  , bool TF > // Transpose flag
848 inline const SVecAbsExpr<VT,TF>& abs( const SVecAbsExpr<VT,TF>& sv )
849 {
851 
852  return sv;
853 }
855 //*************************************************************************************************
856 
857 
858 
859 
860 //=================================================================================================
861 //
862 // SIZE SPECIALIZATIONS
863 //
864 //=================================================================================================
865 
866 //*************************************************************************************************
868 template< typename VT, bool TF >
869 struct Size< SVecAbsExpr<VT,TF> > : public Size<VT>
870 {};
872 //*************************************************************************************************
873 
874 
875 
876 
877 //=================================================================================================
878 //
879 // EXPRESSION TRAIT SPECIALIZATIONS
880 //
881 //=================================================================================================
882 
883 //*************************************************************************************************
885 template< typename VT >
886 struct SVecAbsExprTrait< SVecAbsExpr<VT,false> >
887 {
888  public:
889  //**********************************************************************************************
890  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
891  , SVecAbsExpr<VT,false>
892  , INVALID_TYPE >::Type Type;
893  //**********************************************************************************************
894 };
896 //*************************************************************************************************
897 
898 
899 //*************************************************************************************************
901 template< typename VT >
902 struct TSVecAbsExprTrait< SVecAbsExpr<VT,true> >
903 {
904  public:
905  //**********************************************************************************************
906  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
907  , SVecAbsExpr<VT,true>
908  , INVALID_TYPE >::Type Type;
909  //**********************************************************************************************
910 };
912 //*************************************************************************************************
913 
914 
915 //*************************************************************************************************
917 template< typename VT, bool TF, bool AF >
918 struct SubvectorExprTrait< SVecAbsExpr<VT,TF>, AF >
919 {
920  public:
921  //**********************************************************************************************
922  typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
923  //**********************************************************************************************
924 };
926 //*************************************************************************************************
927 
928 } // namespace blaze
929 
930 #endif
Pointer difference type of the Blaze library.
ValueType * PointerType
Pointer return type.
Definition: SVecAbsExpr.h:191
Header file for the TSVecAbsExprTrait class template.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecAbsExpr.h:347
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for basic type definitions.
Header file for the SparseVector base class.
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecAbsExpr.h:299
size_t index() const
Access to the current index of the sparse element.
Definition: SVecAbsExpr.h:259
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecAbsExpr.h:412
ValueType & ReferenceType
Reference return type.
Definition: SVecAbsExpr.h:192
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecAbsExpr.h:227
VT::TransposeType TT
Transpose type of the sparse vector expression.
Definition: SVecAbsExpr.h:103
SelectType< useAssign, const ResultType, const SVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecAbsExpr.h:165
const SVecAbsExpr< VT, TF > abs(const SparseVector< VT, TF > &sv)
Returns a vector containing the absolute values of each single element of sv.
Definition: SVecAbsExpr.h:818
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecAbsExpr.h:100
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:938
Element ValueType
Type of the underlying pointers.
Definition: SVecAbsExpr.h:190
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
SVecAbsExpr< VT, TF > This
Type of this SVecAbsExpr instance.
Definition: SVecAbsExpr.h:156
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecAbsExpr.h:216
Header file for the SVecAbsExprTrait class template.
Header file for the RequiresEvaluation type trait.
SVecAbsExpr(const VT &sv)
Constructor for the SVecAbsExpr class.
Definition: SVecAbsExpr.h:309
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecAbsExpr.h:117
IteratorCategory iterator_category
The iterator category.
Definition: SVecAbsExpr.h:196
Expression object for the sparse vector abs() function.The SVecAbsExpr class represents the compile t...
Definition: Forward.h:119
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecAbsExpr.h:101
Constraint on the data type.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecAbsExpr.h:435
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecAbsExpr.h:187
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecAbsExpr.h:357
Header file for the ValueIndexPair class.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecAbsExpr.h:377
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecAbsExpr.h:400
ET ElementType
Resulting element type.
Definition: SVecAbsExpr.h:159
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
DifferenceType difference_type
Difference between two iterators.
Definition: SVecAbsExpr.h:200
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecAbsExpr.h:388
VT::ElementType ET
Element type of the sparse vector expression.
Definition: SVecAbsExpr.h:104
ValueType value_type
Type of the underlying pointers.
Definition: SVecAbsExpr.h:197
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecAbsExpr.h:457
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:79
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecAbsExpr.h:270
Header file for the VecAbsExpr base class.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecAbsExpr.h:184
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecAbsExpr.h:334
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecAbsExpr.h:320
TT TransposeType
Transpose type for expression template evaluations.
Definition: SVecAbsExpr.h:158
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the serial shim.
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecAbsExpr.h:189
Operand operand() const
Returns the sparse vector operand.
Definition: SVecAbsExpr.h:423
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Iterator over the elements of the sparse vector absolute value expression.
Definition: SVecAbsExpr.h:179
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecAbsExpr.h:162
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
Operand sv_
Sparse vector of the absolute value expression.
Definition: SVecAbsExpr.h:464
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecAbsExpr.h:206
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecAbsExpr.h:193
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecAbsExpr.h:102
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecAbsExpr.h:238
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Header file for the RemoveReference type trait.
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecAbsExpr.h:248
PointerType pointer
Pointer return type.
Definition: SVecAbsExpr.h:198
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecAbsExpr.h:292
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecAbsExpr.h:281
Header file for the IsComputation type trait class.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecAbsExpr.h:447
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecAbsExpr.h:367
RT ResultType
Result type for expression template evaluations.
Definition: SVecAbsExpr.h:157
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
ReferenceType reference
Reference return type.
Definition: SVecAbsExpr.h:199
Header file for the SubvectorExprTrait class template.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecAbsExpr.h:168
Header file for exception macros.
Header file for the AbsExprTrait class template.
Header file for the IsColumnVector type trait.
Evaluation of the return type of an absolute value expression.Via this type trait it is possible to e...
Definition: AbsExprTrait.h:88
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:81
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.