DVecAbsExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECABSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECABSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
50 #include <blaze/math/Intrinsics.h>
64 #include <blaze/system/Inline.h>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/InvalidType.h>
70 #include <blaze/util/SelectType.h>
71 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS DVECABSEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT // Type of the dense vector
90  , bool TF > // Transpose flag
91 class DVecAbsExpr : public DenseVector< DVecAbsExpr<VT,TF>, TF >
92  , private VecAbsExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename VT::ReturnType RN;
98  typedef typename VT::ElementType ET;
99  //**********************************************************************************************
100 
101  //**Return type evaluation**********************************************************************
103 
108  enum { returnExpr = !IsTemporary<RN>::value };
109 
112  //**********************************************************************************************
113 
114  //**Serial evaluation strategy******************************************************************
116 
122  enum { useAssign = RequiresEvaluation<VT>::value };
123 
125  template< typename VT2 >
127  struct UseAssign {
128  enum { value = useAssign };
129  };
131  //**********************************************************************************************
132 
133  //**Parallel evaluation strategy****************************************************************
135 
141  template< typename VT2 >
142  struct UseSMPAssign {
143  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
144  };
146  //**********************************************************************************************
147 
148  public:
149  //**Type definitions****************************************************************************
151  typedef typename VT::ResultType ResultType;
152  typedef typename VT::TransposeType TransposeType;
153  typedef typename VT::ElementType ElementType;
155 
158 
161 
163  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
164  //**********************************************************************************************
165 
166  //**ConstIterator class definition**************************************************************
170  {
171  public:
172  //**Type definitions*************************************************************************
173  typedef std::random_access_iterator_tag IteratorCategory;
174  typedef ElementType ValueType;
175  typedef ElementType* PointerType;
176  typedef ElementType& ReferenceType;
178 
179  // STL iterator requirements
180  typedef IteratorCategory iterator_category;
181  typedef ValueType value_type;
182  typedef PointerType pointer;
183  typedef ReferenceType reference;
184  typedef DifferenceType difference_type;
185 
187  typedef typename VT::ConstIterator IteratorType;
188  //*******************************************************************************************
189 
190  //**Constructor******************************************************************************
195  explicit inline ConstIterator( IteratorType it )
196  : it_( it ) // Iterator to the current vector element
197  {}
198  //*******************************************************************************************
199 
200  //**Addition assignment operator*************************************************************
206  inline ConstIterator& operator+=( size_t inc ) {
207  it_ += inc;
208  return *this;
209  }
210  //*******************************************************************************************
211 
212  //**Subtraction assignment operator**********************************************************
218  inline ConstIterator& operator-=( size_t dec ) {
219  it_ -= dec;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Prefix increment operator****************************************************************
230  ++it_;
231  return *this;
232  }
233  //*******************************************************************************************
234 
235  //**Postfix increment operator***************************************************************
240  inline const ConstIterator operator++( int ) {
241  return ConstIterator( it_++ );
242  }
243  //*******************************************************************************************
244 
245  //**Prefix decrement operator****************************************************************
251  --it_;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Postfix decrement operator***************************************************************
261  inline const ConstIterator operator--( int ) {
262  return ConstIterator( it_-- );
263  }
264  //*******************************************************************************************
265 
266  //**Element access operator******************************************************************
271  inline ReturnType operator*() const {
272  using std::abs;
273  return abs( *it_ );
274  }
275  //*******************************************************************************************
276 
277  //**Load function****************************************************************************
282  inline IntrinsicType load() const {
283  return abs( it_.load() );
284  }
285  //*******************************************************************************************
286 
287  //**Equality operator************************************************************************
293  inline bool operator==( const ConstIterator& rhs ) const {
294  return it_ == rhs.it_;
295  }
296  //*******************************************************************************************
297 
298  //**Inequality operator**********************************************************************
304  inline bool operator!=( const ConstIterator& rhs ) const {
305  return it_ != rhs.it_;
306  }
307  //*******************************************************************************************
308 
309  //**Less-than operator***********************************************************************
315  inline bool operator<( const ConstIterator& rhs ) const {
316  return it_ < rhs.it_;
317  }
318  //*******************************************************************************************
319 
320  //**Greater-than operator********************************************************************
326  inline bool operator>( const ConstIterator& rhs ) const {
327  return it_ > rhs.it_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-or-equal-than operator**************************************************************
337  inline bool operator<=( const ConstIterator& rhs ) const {
338  return it_ <= rhs.it_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-or-equal-than operator***********************************************************
348  inline bool operator>=( const ConstIterator& rhs ) const {
349  return it_ >= rhs.it_;
350  }
351  //*******************************************************************************************
352 
353  //**Subtraction operator*********************************************************************
359  inline DifferenceType operator-( const ConstIterator& rhs ) const {
360  return it_ - rhs.it_;
361  }
362  //*******************************************************************************************
363 
364  //**Addition operator************************************************************************
371  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
372  return ConstIterator( it.it_ + inc );
373  }
374  //*******************************************************************************************
375 
376  //**Addition operator************************************************************************
383  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
384  return ConstIterator( it.it_ + inc );
385  }
386  //*******************************************************************************************
387 
388  //**Subtraction operator*********************************************************************
395  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
396  return ConstIterator( it.it_ - dec );
397  }
398  //*******************************************************************************************
399 
400  private:
401  //**Member variables*************************************************************************
402  IteratorType it_;
403  //*******************************************************************************************
404  };
405  //**********************************************************************************************
406 
407  //**Compilation flags***************************************************************************
409  enum { vectorizable = VT::vectorizable &&
411 
413  enum { smpAssignable = VT::smpAssignable };
414  //**********************************************************************************************
415 
416  //**Constructor*********************************************************************************
421  explicit inline DVecAbsExpr( const VT& dv )
422  : dv_( dv ) // Dense vector of the absolute value expression
423  {}
424  //**********************************************************************************************
425 
426  //**Subscript operator**************************************************************************
432  inline ReturnType operator[]( size_t index ) const {
433  using std::abs;
434  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
435  return abs( dv_[index] );
436  }
437  //**********************************************************************************************
438 
439  //**Load function*******************************************************************************
445  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
446  typedef IntrinsicTrait<ElementType> IT;
447  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
448  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
449  return abs( dv_.load( index ) );
450  }
451  //**********************************************************************************************
452 
453  //**Begin function******************************************************************************
458  inline ConstIterator begin() const {
459  return ConstIterator( dv_.begin() );
460  }
461  //**********************************************************************************************
462 
463  //**End function********************************************************************************
468  inline ConstIterator end() const {
469  return ConstIterator( dv_.end() );
470  }
471  //**********************************************************************************************
472 
473  //**Size function*******************************************************************************
478  inline size_t size() const {
479  return dv_.size();
480  }
481  //**********************************************************************************************
482 
483  //**Operand access******************************************************************************
488  inline Operand operand() const {
489  return dv_;
490  }
491  //**********************************************************************************************
492 
493  //**********************************************************************************************
499  template< typename T >
500  inline bool canAlias( const T* alias ) const {
501  return IsComputation<VT>::value && dv_.canAlias( alias );
502  }
503  //**********************************************************************************************
504 
505  //**********************************************************************************************
511  template< typename T >
512  inline bool isAliased( const T* alias ) const {
513  return dv_.isAliased( alias );
514  }
515  //**********************************************************************************************
516 
517  //**********************************************************************************************
522  inline bool isAligned() const {
523  return dv_.isAligned();
524  }
525  //**********************************************************************************************
526 
527  //**********************************************************************************************
532  inline bool canSMPAssign() const {
533  return dv_.canSMPAssign();
534  }
535  //**********************************************************************************************
536 
537  private:
538  //**Member variables****************************************************************************
539  Operand dv_;
540  //**********************************************************************************************
541 
542  //**Assignment to dense vectors*****************************************************************
556  template< typename VT2 > // Type of the target dense vector
557  friend inline typename EnableIf< UseAssign<VT2> >::Type
558  assign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
559  {
561 
562  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
563 
564  assign( ~lhs, rhs.dv_ );
565  assign( ~lhs, abs( ~lhs ) );
566  }
568  //**********************************************************************************************
569 
570  //**Assignment to sparse vectors****************************************************************
584  template< typename VT2 > // Type of the target sparse vector
585  friend inline typename EnableIf< UseAssign<VT2> >::Type
586  assign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
587  {
589 
593 
594  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
595 
596  const ResultType tmp( serial( rhs ) );
597  assign( ~lhs, tmp );
598  }
600  //**********************************************************************************************
601 
602  //**Addition assignment to dense vectors********************************************************
616  template< typename VT2 > // Type of the target dense vector
617  friend inline typename EnableIf< UseAssign<VT2> >::Type
618  addAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
619  {
621 
625 
626  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
627 
628  const ResultType tmp( serial( rhs ) );
629  addAssign( ~lhs, tmp );
630  }
632  //**********************************************************************************************
633 
634  //**Addition assignment to sparse vectors*******************************************************
635  // No special implementation for the addition assignment to sparse vectors.
636  //**********************************************************************************************
637 
638  //**Subtraction assignment to dense vectors*****************************************************
652  template< typename VT2 > // Type of the target dense vector
653  friend inline typename EnableIf< UseAssign<VT2> >::Type
654  subAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
655  {
657 
661 
662  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
663 
664  const ResultType tmp( serial( rhs ) );
665  subAssign( ~lhs, tmp );
666  }
668  //**********************************************************************************************
669 
670  //**Subtraction assignment to sparse vectors****************************************************
671  // No special implementation for the subtraction assignment to sparse vectors.
672  //**********************************************************************************************
673 
674  //**Multiplication assignment to dense vectors**************************************************
688  template< typename VT2 > // Type of the target dense vector
689  friend inline typename EnableIf< UseAssign<VT2> >::Type
690  multAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
691  {
693 
697 
698  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
699 
700  const ResultType tmp( serial( rhs ) );
701  multAssign( ~lhs, tmp );
702  }
704  //**********************************************************************************************
705 
706  //**Multiplication assignment to sparse vectors*************************************************
707  // No special implementation for the multiplication assignment to sparse vectors.
708  //**********************************************************************************************
709 
710  //**SMP assignment to dense vectors*************************************************************
724  template< typename VT2 > // Type of the target dense vector
725  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
726  smpAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
727  {
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
731 
732  smpAssign( ~lhs, rhs.dv_ );
733  smpAssign( ~lhs, abs( ~lhs ) );
734  }
736  //**********************************************************************************************
737 
738  //**SMP assignment to sparse vectors************************************************************
752  template< typename VT2 > // Type of the target sparse vector
753  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
754  smpAssign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
755  {
757 
761 
762  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
763 
764  const ResultType tmp( rhs );
765  smpAssign( ~lhs, tmp );
766  }
768  //**********************************************************************************************
769 
770  //**SMP addition assignment to dense vectors****************************************************
784  template< typename VT2 > // Type of the target dense vector
785  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
786  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
787  {
789 
793 
794  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
795 
796  const ResultType tmp( rhs );
797  smpAddAssign( ~lhs, tmp );
798  }
800  //**********************************************************************************************
801 
802  //**SMP addition assignment to sparse vectors***************************************************
803  // No special implementation for the SMP addition assignment to sparse vectors.
804  //**********************************************************************************************
805 
806  //**SMP subtraction assignment to dense vectors*************************************************
820  template< typename VT2 > // Type of the target dense vector
821  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
822  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
823  {
825 
829 
830  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
831 
832  const ResultType tmp( rhs );
833  smpSubAssign( ~lhs, tmp );
834  }
836  //**********************************************************************************************
837 
838  //**SMP subtraction assignment to sparse vectors************************************************
839  // No special implementation for the SMP subtraction assignment to sparse vectors.
840  //**********************************************************************************************
841 
842  //**SMP multiplication assignment to dense vectors**********************************************
856  template< typename VT2 > // Type of the target dense vector
857  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
858  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
859  {
861 
865 
866  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
867 
868  const ResultType tmp( rhs );
869  smpMultAssign( ~lhs, tmp );
870  }
872  //**********************************************************************************************
873 
874  //**SMP multiplication assignment to sparse vectors*********************************************
875  // No special implementation for the SMP multiplication assignment to sparse vectors.
876  //**********************************************************************************************
877 
878  //**Compile time checks*************************************************************************
883  //**********************************************************************************************
884 };
885 //*************************************************************************************************
886 
887 
888 
889 
890 //=================================================================================================
891 //
892 // GLOBAL FUNCTIONS
893 //
894 //=================================================================================================
895 
896 //*************************************************************************************************
913 template< typename VT // Type of the dense vector
914  , bool TF > // Transpose flag
915 inline const DVecAbsExpr<VT,TF> abs( const DenseVector<VT,TF>& dv )
916 {
918 
919  return DVecAbsExpr<VT,TF>( ~dv );
920 }
921 //*************************************************************************************************
922 
923 
924 
925 
926 //=================================================================================================
927 //
928 // GLOBAL RESTRUCTURING FUNCTIONS
929 //
930 //=================================================================================================
931 
932 //*************************************************************************************************
943 template< typename VT // Type of the dense vector
944  , bool TF > // Transpose flag
945 inline const DVecAbsExpr<VT,TF>& abs( const DVecAbsExpr<VT,TF>& dv )
946 {
948 
949  return dv;
950 }
952 //*************************************************************************************************
953 
954 
955 
956 
957 //=================================================================================================
958 //
959 // SIZE SPECIALIZATIONS
960 //
961 //=================================================================================================
962 
963 //*************************************************************************************************
965 template< typename VT, bool TF >
966 struct Size< DVecAbsExpr<VT,TF> >
967  : public Size<VT>
968 {};
970 //*************************************************************************************************
971 
972 
973 
974 
975 //=================================================================================================
976 //
977 // EXPRESSION TRAIT SPECIALIZATIONS
978 //
979 //=================================================================================================
980 
981 //*************************************************************************************************
983 template< typename VT >
984 struct DVecAbsExprTrait< DVecAbsExpr<VT,false> >
985 {
986  public:
987  //**********************************************************************************************
988  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
989  , DVecAbsExpr<VT,false>
990  , INVALID_TYPE >::Type Type;
991  //**********************************************************************************************
992 };
994 //*************************************************************************************************
995 
996 
997 //*************************************************************************************************
999 template< typename VT >
1000 struct TDVecAbsExprTrait< DVecAbsExpr<VT,true> >
1001 {
1002  public:
1003  //**********************************************************************************************
1004  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1005  , DVecAbsExpr<VT,true>
1006  , INVALID_TYPE >::Type Type;
1007  //**********************************************************************************************
1008 };
1010 //*************************************************************************************************
1011 
1012 
1013 //*************************************************************************************************
1015 template< typename VT, bool TF, bool AF >
1016 struct SubvectorExprTrait< DVecAbsExpr<VT,TF>, AF >
1017 {
1018  public:
1019  //**********************************************************************************************
1020  typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1021  //**********************************************************************************************
1022 };
1024 //*************************************************************************************************
1025 
1026 } // namespace blaze
1027 
1028 #endif
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecAbsExpr.h:458
Pointer difference type of the Blaze library.
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:445
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
DVecAbsExpr(const VT &dv)
Constructor for the DVecAbsExpr class.
Definition: DVecAbsExpr.h:421
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
VT::ResultType ResultType
Result type for expression template evaluations.
Definition: DVecAbsExpr.h:151
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.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
Header file for the IsRowVector type trait.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecAbsExpr.h:383
Header file for the DenseVector base class.
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:914
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:371
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecAbsExpr.h:432
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecAbsExpr.h:173
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecAbsExpr.h:500
Header file for the Computation base class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecAbsExpr.h:261
Expression object for the dense vector abs() function.The DVecAbsExpr class represents the compile ti...
Definition: DVecAbsExpr.h:91
Header file for the RequiresEvaluation type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecAbsExpr.h:468
Header file for the TDVecAbsExprTrait class template.
Constraint on the data type.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:293
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:263
DifferenceType difference_type
Difference between two iterators.
Definition: DVecAbsExpr.h:184
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecAbsExpr.h:478
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
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:395
IteratorType it_
Iterator to the current vector element.
Definition: DVecAbsExpr.h:402
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:315
Header file for the DVecAbsExprTrait class template.
SelectType< useAssign, const ResultType, const DVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecAbsExpr.h:160
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
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
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:282
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraint on the data type.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecAbsExpr.h:163
Base class for all vector absolute value expression templates.The VecAbsExpr class serves as a tag fo...
Definition: VecAbsExpr.h:65
IteratorCategory iterator_category
The iterator category.
Definition: DVecAbsExpr.h:180
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the serial shim.
Operand dv_
Dense vector of the absolute value expression.
Definition: DVecAbsExpr.h:539
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:348
ReferenceType reference
Reference return type.
Definition: DVecAbsExpr.h:183
ElementType * PointerType
Pointer return type.
Definition: DVecAbsExpr.h:175
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecAbsExpr.h:154
Header file for run time assertion macros.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecAbsExpr.h:218
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
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecAbsExpr.h:206
Utility type for generic codes.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
DVecAbsExpr< VT, TF > This
Type of this DVecAbsExpr instance.
Definition: DVecAbsExpr.h:150
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecAbsExpr.h:532
VT::ElementType ElementType
Resulting element type.
Definition: DVecAbsExpr.h:153
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecAbsExpr.h:512
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:326
ValueType value_type
Type of the underlying elements.
Definition: DVecAbsExpr.h:181
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:304
ElementType ValueType
Type of the underlying elements.
Definition: DVecAbsExpr.h:174
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecAbsExpr.h:229
VT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecAbsExpr.h:152
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecAbsExpr.h:195
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecAbsExpr.h:271
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecAbsExpr.h:522
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecAbsExpr.h:177
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
PointerType pointer
Pointer return type.
Definition: DVecAbsExpr.h:182
Iterator over the elements of the dense vector.
Definition: DVecAbsExpr.h:169
Header file for the IsComputation type trait class.
Operand operand() const
Returns the dense vector operand.
Definition: DVecAbsExpr.h:488
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecAbsExpr.h:111
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecAbsExpr.h:359
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecAbsExpr.h:240
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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:2502
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecAbsExpr.h:157
Header file for the SubvectorExprTrait class template.
ElementType & ReferenceType
Reference return type.
Definition: DVecAbsExpr.h:176
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecAbsExpr.h:250
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:87
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecAbsExpr.h:187
const DVecAbsExpr< VT, TF > abs(const DenseVector< VT, TF > &dv)
Returns a vector containing the absolute values of each single element of dv.
Definition: DVecAbsExpr.h:915
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:337
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecAbsExpr.h:97
System settings for the inline keywords.
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:238
#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
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecAbsExpr.h:98
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849