All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
63 #include <blaze/util/Assert.h>
65 #include <blaze/util/EnableIf.h>
66 #include <blaze/util/InvalidType.h>
68 #include <blaze/util/SelectType.h>
69 #include <blaze/util/Types.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS DVECABSEXPR
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 template< typename VT // Type of the dense vector
88  , bool TF > // Transpose flag
89 class DVecAbsExpr : public DenseVector< DVecAbsExpr<VT,TF>, TF >
90  , private VecAbsExpr
91  , private Computation
92 {
93  private:
94  //**Type definitions****************************************************************************
95  typedef typename VT::ReturnType RN;
96  typedef typename VT::ElementType ET;
97  //**********************************************************************************************
98 
99  //**Return type evaluation**********************************************************************
101 
106  enum { returnExpr = !IsTemporary<RN>::value };
107 
110  //**********************************************************************************************
111 
112  //**Serial evaluation strategy******************************************************************
114 
120  enum { useAssign = RequiresEvaluation<VT>::value };
121 
123  template< typename VT2 >
125  struct UseAssign {
126  enum { value = useAssign };
127  };
129  //**********************************************************************************************
130 
131  //**Parallel evaluation strategy****************************************************************
133 
139  template< typename VT2 >
140  struct UseSMPAssign {
141  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
142  };
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
149  typedef typename VT::ResultType ResultType;
150  typedef typename VT::TransposeType TransposeType;
151  typedef typename VT::ElementType ElementType;
153 
156 
159 
161  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
162  //**********************************************************************************************
163 
164  //**ConstIterator class definition**************************************************************
168  {
169  public:
170  //**Type definitions*************************************************************************
171  typedef std::random_access_iterator_tag IteratorCategory;
176 
177  // STL iterator requirements
183 
185  typedef typename VT::ConstIterator IteratorType;
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
193  explicit inline ConstIterator( IteratorType it )
194  : it_( it ) // Iterator to the current vector element
195  {}
196  //*******************************************************************************************
197 
198  //**Addition assignment operator*************************************************************
204  inline ConstIterator& operator+=( size_t inc ) {
205  it_ += inc;
206  return *this;
207  }
208  //*******************************************************************************************
209 
210  //**Subtraction assignment operator**********************************************************
216  inline ConstIterator& operator-=( size_t dec ) {
217  it_ -= dec;
218  return *this;
219  }
220  //*******************************************************************************************
221 
222  //**Prefix increment operator****************************************************************
228  ++it_;
229  return *this;
230  }
231  //*******************************************************************************************
232 
233  //**Postfix increment operator***************************************************************
238  inline const ConstIterator operator++( int ) {
239  return ConstIterator( it_++ );
240  }
241  //*******************************************************************************************
242 
243  //**Prefix decrement operator****************************************************************
249  --it_;
250  return *this;
251  }
252  //*******************************************************************************************
253 
254  //**Postfix decrement operator***************************************************************
259  inline const ConstIterator operator--( int ) {
260  return ConstIterator( it_-- );
261  }
262  //*******************************************************************************************
263 
264  //**Element access operator******************************************************************
269  inline ReturnType operator*() const {
270  using std::abs;
271  return abs( *it_ );
272  }
273  //*******************************************************************************************
274 
275  //**Load function****************************************************************************
280  inline IntrinsicType load() const {
281  return abs( it_.load() );
282  }
283  //*******************************************************************************************
284 
285  //**Equality operator************************************************************************
291  inline bool operator==( const ConstIterator& rhs ) const {
292  return it_ == rhs.it_;
293  }
294  //*******************************************************************************************
295 
296  //**Inequality operator**********************************************************************
302  inline bool operator!=( const ConstIterator& rhs ) const {
303  return it_ != rhs.it_;
304  }
305  //*******************************************************************************************
306 
307  //**Less-than operator***********************************************************************
313  inline bool operator<( const ConstIterator& rhs ) const {
314  return it_ < rhs.it_;
315  }
316  //*******************************************************************************************
317 
318  //**Greater-than operator********************************************************************
324  inline bool operator>( const ConstIterator& rhs ) const {
325  return it_ > rhs.it_;
326  }
327  //*******************************************************************************************
328 
329  //**Less-or-equal-than operator**************************************************************
335  inline bool operator<=( const ConstIterator& rhs ) const {
336  return it_ <= rhs.it_;
337  }
338  //*******************************************************************************************
339 
340  //**Greater-or-equal-than operator***********************************************************
346  inline bool operator>=( const ConstIterator& rhs ) const {
347  return it_ >= rhs.it_;
348  }
349  //*******************************************************************************************
350 
351  //**Subtraction operator*********************************************************************
357  inline DifferenceType operator-( const ConstIterator& rhs ) const {
358  return it_ - rhs.it_;
359  }
360  //*******************************************************************************************
361 
362  //**Addition operator************************************************************************
369  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
370  return ConstIterator( it.it_ + inc );
371  }
372  //*******************************************************************************************
373 
374  //**Addition operator************************************************************************
381  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
382  return ConstIterator( it.it_ + inc );
383  }
384  //*******************************************************************************************
385 
386  //**Subtraction operator*********************************************************************
393  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
394  return ConstIterator( it.it_ - dec );
395  }
396  //*******************************************************************************************
397 
398  private:
399  //**Member variables*************************************************************************
401  //*******************************************************************************************
402  };
403  //**********************************************************************************************
404 
405  //**Compilation flags***************************************************************************
407  enum { vectorizable = VT::vectorizable &&
409 
411  enum { smpAssignable = VT::smpAssignable };
412  //**********************************************************************************************
413 
414  //**Constructor*********************************************************************************
419  explicit inline DVecAbsExpr( const VT& dv )
420  : dv_( dv ) // Dense vector of the absolute value expression
421  {}
422  //**********************************************************************************************
423 
424  //**Subscript operator**************************************************************************
430  inline ReturnType operator[]( size_t index ) const {
431  using std::abs;
432  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
433  return abs( dv_[index] );
434  }
435  //**********************************************************************************************
436 
437  //**Load function*******************************************************************************
443  inline IntrinsicType load( size_t index ) const {
444  typedef IntrinsicTrait<ElementType> IT;
445  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
446  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
447  return abs( dv_.load( index ) );
448  }
449  //**********************************************************************************************
450 
451  //**Begin function******************************************************************************
456  inline ConstIterator begin() const {
457  return ConstIterator( dv_.begin() );
458  }
459  //**********************************************************************************************
460 
461  //**End function********************************************************************************
466  inline ConstIterator end() const {
467  return ConstIterator( dv_.end() );
468  }
469  //**********************************************************************************************
470 
471  //**Size function*******************************************************************************
476  inline size_t size() const {
477  return dv_.size();
478  }
479  //**********************************************************************************************
480 
481  //**Operand access******************************************************************************
486  inline Operand operand() const {
487  return dv_;
488  }
489  //**********************************************************************************************
490 
491  //**********************************************************************************************
497  template< typename T >
498  inline bool canAlias( const T* alias ) const {
499  return IsComputation<VT>::value && dv_.canAlias( alias );
500  }
501  //**********************************************************************************************
502 
503  //**********************************************************************************************
509  template< typename T >
510  inline bool isAliased( const T* alias ) const {
511  return dv_.isAliased( alias );
512  }
513  //**********************************************************************************************
514 
515  //**********************************************************************************************
520  inline bool isAligned() const {
521  return dv_.isAligned();
522  }
523  //**********************************************************************************************
524 
525  //**********************************************************************************************
530  inline bool canSMPAssign() const {
531  return dv_.canSMPAssign();
532  }
533  //**********************************************************************************************
534 
535  private:
536  //**Member variables****************************************************************************
538  //**********************************************************************************************
539 
540  //**Assignment to dense vectors*****************************************************************
554  template< typename VT2 > // Type of the target dense vector
555  friend inline typename EnableIf< UseAssign<VT2> >::Type
556  assign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
557  {
559 
560  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
561 
562  assign( ~lhs, rhs.dv_ );
563  assign( ~lhs, abs( ~lhs ) );
564  }
566  //**********************************************************************************************
567 
568  //**Assignment to sparse vectors****************************************************************
582  template< typename VT2 > // Type of the target sparse vector
583  friend inline typename EnableIf< UseAssign<VT2> >::Type
584  assign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
585  {
587 
591 
592  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
593 
594  const ResultType tmp( serial( rhs ) );
595  assign( ~lhs, tmp );
596  }
598  //**********************************************************************************************
599 
600  //**Addition assignment to dense vectors********************************************************
614  template< typename VT2 > // Type of the target dense vector
615  friend inline typename EnableIf< UseAssign<VT2> >::Type
616  addAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
617  {
619 
623 
624  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
625 
626  const ResultType tmp( serial( rhs ) );
627  addAssign( ~lhs, tmp );
628  }
630  //**********************************************************************************************
631 
632  //**Addition assignment to sparse vectors*******************************************************
633  // No special implementation for the addition assignment to sparse vectors.
634  //**********************************************************************************************
635 
636  //**Subtraction assignment to dense vectors*****************************************************
650  template< typename VT2 > // Type of the target dense vector
651  friend inline typename EnableIf< UseAssign<VT2> >::Type
652  subAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
653  {
655 
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
661 
662  const ResultType tmp( serial( rhs ) );
663  subAssign( ~lhs, tmp );
664  }
666  //**********************************************************************************************
667 
668  //**Subtraction assignment to sparse vectors****************************************************
669  // No special implementation for the subtraction assignment to sparse vectors.
670  //**********************************************************************************************
671 
672  //**Multiplication assignment to dense vectors**************************************************
686  template< typename VT2 > // Type of the target dense vector
687  friend inline typename EnableIf< UseAssign<VT2> >::Type
688  multAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
689  {
691 
695 
696  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
697 
698  const ResultType tmp( serial( rhs ) );
699  multAssign( ~lhs, tmp );
700  }
702  //**********************************************************************************************
703 
704  //**Multiplication assignment to sparse vectors*************************************************
705  // No special implementation for the multiplication assignment to sparse vectors.
706  //**********************************************************************************************
707 
708  //**SMP assignment to dense vectors*************************************************************
722  template< typename VT2 > // Type of the target dense vector
723  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
724  smpAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
725  {
727 
728  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
729 
730  smpAssign( ~lhs, rhs.dv_ );
731  smpAssign( ~lhs, abs( ~lhs ) );
732  }
734  //**********************************************************************************************
735 
736  //**SMP assignment to sparse vectors************************************************************
750  template< typename VT2 > // Type of the target sparse vector
751  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
752  smpAssign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
753  {
755 
759 
760  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
761 
762  const ResultType tmp( rhs );
763  smpAssign( ~lhs, tmp );
764  }
766  //**********************************************************************************************
767 
768  //**SMP addition assignment to dense vectors****************************************************
782  template< typename VT2 > // Type of the target dense vector
783  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
784  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
785  {
787 
791 
792  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
793 
794  const ResultType tmp( rhs );
795  smpAddAssign( ~lhs, tmp );
796  }
798  //**********************************************************************************************
799 
800  //**SMP addition assignment to sparse vectors***************************************************
801  // No special implementation for the SMP addition assignment to sparse vectors.
802  //**********************************************************************************************
803 
804  //**SMP subtraction assignment to dense vectors*************************************************
818  template< typename VT2 > // Type of the target dense vector
819  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
820  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
821  {
823 
827 
828  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
829 
830  const ResultType tmp( rhs );
831  smpSubAssign( ~lhs, tmp );
832  }
834  //**********************************************************************************************
835 
836  //**SMP subtraction assignment to sparse vectors************************************************
837  // No special implementation for the SMP subtraction assignment to sparse vectors.
838  //**********************************************************************************************
839 
840  //**SMP multiplication assignment to dense vectors**********************************************
854  template< typename VT2 > // Type of the target dense vector
855  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
856  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
857  {
859 
863 
864  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
865 
866  const ResultType tmp( rhs );
867  smpMultAssign( ~lhs, tmp );
868  }
870  //**********************************************************************************************
871 
872  //**SMP multiplication assignment to sparse vectors*********************************************
873  // No special implementation for the SMP multiplication assignment to sparse vectors.
874  //**********************************************************************************************
875 
876  //**Compile time checks*************************************************************************
881  //**********************************************************************************************
882 };
883 //*************************************************************************************************
884 
885 
886 
887 
888 //=================================================================================================
889 //
890 // GLOBAL FUNCTIONS
891 //
892 //=================================================================================================
893 
894 //*************************************************************************************************
911 template< typename VT // Type of the dense vector
912  , bool TF > // Transpose flag
913 inline const DVecAbsExpr<VT,TF> abs( const DenseVector<VT,TF>& dv )
914 {
916 
917  return DVecAbsExpr<VT,TF>( ~dv );
918 }
919 //*************************************************************************************************
920 
921 
922 
923 
924 //=================================================================================================
925 //
926 // GLOBAL RESTRUCTURING FUNCTIONS
927 //
928 //=================================================================================================
929 
930 //*************************************************************************************************
941 template< typename VT // Type of the dense vector
942  , bool TF > // Transpose flag
943 inline const DVecAbsExpr<VT,TF>& abs( const DVecAbsExpr<VT,TF>& dv )
944 {
946 
947  return dv;
948 }
950 //*************************************************************************************************
951 
952 
953 
954 
955 //=================================================================================================
956 //
957 // EXPRESSION TRAIT SPECIALIZATIONS
958 //
959 //=================================================================================================
960 
961 //*************************************************************************************************
963 template< typename VT >
964 struct DVecAbsExprTrait< DVecAbsExpr<VT,false> >
965 {
966  public:
967  //**********************************************************************************************
968  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
969  , DVecAbsExpr<VT,false>
970  , INVALID_TYPE >::Type Type;
971  //**********************************************************************************************
972 };
974 //*************************************************************************************************
975 
976 
977 //*************************************************************************************************
979 template< typename VT >
980 struct TDVecAbsExprTrait< DVecAbsExpr<VT,true> >
981 {
982  public:
983  //**********************************************************************************************
984  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
985  , DVecAbsExpr<VT,true>
986  , INVALID_TYPE >::Type Type;
987  //**********************************************************************************************
988 };
990 //*************************************************************************************************
991 
992 
993 //*************************************************************************************************
995 template< typename VT, bool TF, bool AF >
996 struct SubvectorExprTrait< DVecAbsExpr<VT,TF>, AF >
997 {
998  public:
999  //**********************************************************************************************
1000  typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1001  //**********************************************************************************************
1002 };
1004 //*************************************************************************************************
1005 
1006 } // namespace blaze
1007 
1008 #endif
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecAbsExpr.h:456
Pointer difference type of the Blaze library.
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:419
VT::ResultType ResultType
Result type for expression template evaluations.
Definition: DVecAbsExpr.h:149
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
void smpMultAssign(DenseVector< 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:179
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:381
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:903
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:369
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecAbsExpr.h:430
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecAbsExpr.h:171
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecAbsExpr.h:498
Header file for the Computation base class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecAbsExpr.h:259
Expression object for the dense vector abs() function.The DVecAbsExpr class represents the compile ti...
Definition: DVecAbsExpr.h:89
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:466
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:291
void smpAddAssign(DenseMatrix< 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:122
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:253
DifferenceType difference_type
Difference between two iterators.
Definition: DVecAbsExpr.h:182
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecAbsExpr.h:476
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.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:393
IteratorType it_
Iterator to the current vector element.
Definition: DVecAbsExpr.h:400
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:313
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:271
Header file for the DVecAbsExprTrait class template.
SelectType< useAssign, const ResultType, const DVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecAbsExpr.h:158
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:280
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2405
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:161
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:178
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
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:361
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:537
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:346
ReferenceType reference
Reference return type.
Definition: DVecAbsExpr.h:181
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
ElementType * PointerType
Pointer return type.
Definition: DVecAbsExpr.h:173
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecAbsExpr.h:152
Header file for run time assertion macros.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecAbsExpr.h:216
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecAbsExpr.h:204
Utility type for generic codes.
DVecAbsExpr< VT, TF > This
Type of this DVecAbsExpr instance.
Definition: DVecAbsExpr.h:148
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:301
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecAbsExpr.h:530
VT::ElementType ElementType
Resulting element type.
Definition: DVecAbsExpr.h:151
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecAbsExpr.h:510
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:324
ValueType value_type
Type of the underlying elements.
Definition: DVecAbsExpr.h:179
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:302
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:331
ElementType ValueType
Type of the underlying elements.
Definition: DVecAbsExpr.h:172
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecAbsExpr.h:227
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:443
VT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecAbsExpr.h:150
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecAbsExpr.h:193
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecAbsExpr.h:269
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecAbsExpr.h:520
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecAbsExpr.h:175
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:180
Iterator over the elements of the dense vector.
Definition: DVecAbsExpr.h:167
Header file for the IsComputation type trait class.
Operand operand() const
Returns the dense vector operand.
Definition: DVecAbsExpr.h:486
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecAbsExpr.h:109
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecAbsExpr.h:357
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecAbsExpr.h:238
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:2403
Header file for basic type definitions.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecAbsExpr.h:155
Header file for the SubvectorExprTrait class template.
ElementType & ReferenceType
Reference return type.
Definition: DVecAbsExpr.h:174
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecAbsExpr.h:248
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:86
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecAbsExpr.h:185
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:913
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:335
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecAbsExpr.h:95
#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:96
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.