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>
64 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/InvalidType.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS DVECABSEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT // Type of the dense vector
89  , bool TF > // Transpose flag
90 class DVecAbsExpr : public DenseVector< DVecAbsExpr<VT,TF>, TF >
91  , private VecAbsExpr
92  , private Computation
93 {
94  private:
95  //**Type definitions****************************************************************************
96  typedef typename VT::ReturnType RN;
97  typedef typename VT::ElementType ET;
98  //**********************************************************************************************
99 
100  //**Return type evaluation**********************************************************************
102 
107  enum { returnExpr = !IsTemporary<RN>::value };
108 
111  //**********************************************************************************************
112 
113  //**Serial evaluation strategy******************************************************************
115 
121  enum { useAssign = RequiresEvaluation<VT>::value };
122 
124  template< typename VT2 >
126  struct UseAssign {
127  enum { value = useAssign };
128  };
130  //**********************************************************************************************
131 
132  //**Parallel evaluation strategy****************************************************************
134 
140  template< typename VT2 >
141  struct UseSMPAssign {
142  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
143  };
145  //**********************************************************************************************
146 
147  public:
148  //**Type definitions****************************************************************************
150  typedef typename VT::ResultType ResultType;
151  typedef typename VT::TransposeType TransposeType;
152  typedef typename VT::ElementType ElementType;
154 
157 
160 
162  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
163  //**********************************************************************************************
164 
165  //**ConstIterator class definition**************************************************************
169  {
170  public:
171  //**Type definitions*************************************************************************
172  typedef std::random_access_iterator_tag IteratorCategory;
177 
178  // STL iterator requirements
184 
186  typedef typename VT::ConstIterator IteratorType;
187  //*******************************************************************************************
188 
189  //**Constructor******************************************************************************
194  explicit inline ConstIterator( IteratorType it )
195  : it_( it ) // Iterator to the current vector element
196  {}
197  //*******************************************************************************************
198 
199  //**Addition assignment operator*************************************************************
205  inline ConstIterator& operator+=( size_t inc ) {
206  it_ += inc;
207  return *this;
208  }
209  //*******************************************************************************************
210 
211  //**Subtraction assignment operator**********************************************************
217  inline ConstIterator& operator-=( size_t dec ) {
218  it_ -= dec;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Prefix increment operator****************************************************************
229  ++it_;
230  return *this;
231  }
232  //*******************************************************************************************
233 
234  //**Postfix increment operator***************************************************************
239  inline const ConstIterator operator++( int ) {
240  return ConstIterator( it_++ );
241  }
242  //*******************************************************************************************
243 
244  //**Prefix decrement operator****************************************************************
250  --it_;
251  return *this;
252  }
253  //*******************************************************************************************
254 
255  //**Postfix decrement operator***************************************************************
260  inline const ConstIterator operator--( int ) {
261  return ConstIterator( it_-- );
262  }
263  //*******************************************************************************************
264 
265  //**Element access operator******************************************************************
270  inline ReturnType operator*() const {
271  using std::abs;
272  return abs( *it_ );
273  }
274  //*******************************************************************************************
275 
276  //**Load function****************************************************************************
281  inline IntrinsicType load() const {
282  return abs( it_.load() );
283  }
284  //*******************************************************************************************
285 
286  //**Equality operator************************************************************************
292  inline bool operator==( const ConstIterator& rhs ) const {
293  return it_ == rhs.it_;
294  }
295  //*******************************************************************************************
296 
297  //**Inequality operator**********************************************************************
303  inline bool operator!=( const ConstIterator& rhs ) const {
304  return it_ != rhs.it_;
305  }
306  //*******************************************************************************************
307 
308  //**Less-than operator***********************************************************************
314  inline bool operator<( const ConstIterator& rhs ) const {
315  return it_ < rhs.it_;
316  }
317  //*******************************************************************************************
318 
319  //**Greater-than operator********************************************************************
325  inline bool operator>( const ConstIterator& rhs ) const {
326  return it_ > rhs.it_;
327  }
328  //*******************************************************************************************
329 
330  //**Less-or-equal-than operator**************************************************************
336  inline bool operator<=( const ConstIterator& rhs ) const {
337  return it_ <= rhs.it_;
338  }
339  //*******************************************************************************************
340 
341  //**Greater-or-equal-than operator***********************************************************
347  inline bool operator>=( const ConstIterator& rhs ) const {
348  return it_ >= rhs.it_;
349  }
350  //*******************************************************************************************
351 
352  //**Subtraction operator*********************************************************************
358  inline DifferenceType operator-( const ConstIterator& rhs ) const {
359  return it_ - rhs.it_;
360  }
361  //*******************************************************************************************
362 
363  //**Addition operator************************************************************************
370  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
371  return ConstIterator( it.it_ + inc );
372  }
373  //*******************************************************************************************
374 
375  //**Addition operator************************************************************************
382  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
383  return ConstIterator( it.it_ + inc );
384  }
385  //*******************************************************************************************
386 
387  //**Subtraction operator*********************************************************************
394  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
395  return ConstIterator( it.it_ - dec );
396  }
397  //*******************************************************************************************
398 
399  private:
400  //**Member variables*************************************************************************
402  //*******************************************************************************************
403  };
404  //**********************************************************************************************
405 
406  //**Compilation flags***************************************************************************
408  enum { vectorizable = VT::vectorizable &&
410 
412  enum { smpAssignable = VT::smpAssignable };
413  //**********************************************************************************************
414 
415  //**Constructor*********************************************************************************
420  explicit inline DVecAbsExpr( const VT& dv )
421  : dv_( dv ) // Dense vector of the absolute value expression
422  {}
423  //**********************************************************************************************
424 
425  //**Subscript operator**************************************************************************
431  inline ReturnType operator[]( size_t index ) const {
432  using std::abs;
433  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
434  return abs( dv_[index] );
435  }
436  //**********************************************************************************************
437 
438  //**Load function*******************************************************************************
444  inline IntrinsicType load( size_t index ) const {
445  typedef IntrinsicTrait<ElementType> IT;
446  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
447  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
448  return abs( dv_.load( index ) );
449  }
450  //**********************************************************************************************
451 
452  //**Begin function******************************************************************************
457  inline ConstIterator begin() const {
458  return ConstIterator( dv_.begin() );
459  }
460  //**********************************************************************************************
461 
462  //**End function********************************************************************************
467  inline ConstIterator end() const {
468  return ConstIterator( dv_.end() );
469  }
470  //**********************************************************************************************
471 
472  //**Size function*******************************************************************************
477  inline size_t size() const {
478  return dv_.size();
479  }
480  //**********************************************************************************************
481 
482  //**Operand access******************************************************************************
487  inline Operand operand() const {
488  return dv_;
489  }
490  //**********************************************************************************************
491 
492  //**********************************************************************************************
498  template< typename T >
499  inline bool canAlias( const T* alias ) const {
500  return IsComputation<VT>::value && dv_.canAlias( alias );
501  }
502  //**********************************************************************************************
503 
504  //**********************************************************************************************
510  template< typename T >
511  inline bool isAliased( const T* alias ) const {
512  return dv_.isAliased( alias );
513  }
514  //**********************************************************************************************
515 
516  //**********************************************************************************************
521  inline bool isAligned() const {
522  return dv_.isAligned();
523  }
524  //**********************************************************************************************
525 
526  //**********************************************************************************************
531  inline bool canSMPAssign() const {
532  return dv_.canSMPAssign();
533  }
534  //**********************************************************************************************
535 
536  private:
537  //**Member variables****************************************************************************
539  //**********************************************************************************************
540 
541  //**Assignment to dense vectors*****************************************************************
555  template< typename VT2 > // Type of the target dense vector
556  friend inline typename EnableIf< UseAssign<VT2> >::Type
557  assign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
558  {
560 
561  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
562 
563  assign( ~lhs, rhs.dv_ );
564  assign( ~lhs, abs( ~lhs ) );
565  }
567  //**********************************************************************************************
568 
569  //**Assignment to sparse vectors****************************************************************
583  template< typename VT2 > // Type of the target sparse vector
584  friend inline typename EnableIf< UseAssign<VT2> >::Type
585  assign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
586  {
588 
592 
593  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
594 
595  const ResultType tmp( serial( rhs ) );
596  assign( ~lhs, tmp );
597  }
599  //**********************************************************************************************
600 
601  //**Addition assignment to dense vectors********************************************************
615  template< typename VT2 > // Type of the target dense vector
616  friend inline typename EnableIf< UseAssign<VT2> >::Type
617  addAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
618  {
620 
624 
625  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
626 
627  const ResultType tmp( serial( rhs ) );
628  addAssign( ~lhs, tmp );
629  }
631  //**********************************************************************************************
632 
633  //**Addition assignment to sparse vectors*******************************************************
634  // No special implementation for the addition assignment to sparse vectors.
635  //**********************************************************************************************
636 
637  //**Subtraction assignment to dense vectors*****************************************************
651  template< typename VT2 > // Type of the target dense vector
652  friend inline typename EnableIf< UseAssign<VT2> >::Type
653  subAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
654  {
656 
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
662 
663  const ResultType tmp( serial( rhs ) );
664  subAssign( ~lhs, tmp );
665  }
667  //**********************************************************************************************
668 
669  //**Subtraction assignment to sparse vectors****************************************************
670  // No special implementation for the subtraction assignment to sparse vectors.
671  //**********************************************************************************************
672 
673  //**Multiplication assignment to dense vectors**************************************************
687  template< typename VT2 > // Type of the target dense vector
688  friend inline typename EnableIf< UseAssign<VT2> >::Type
689  multAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
690  {
692 
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
698 
699  const ResultType tmp( serial( rhs ) );
700  multAssign( ~lhs, tmp );
701  }
703  //**********************************************************************************************
704 
705  //**Multiplication assignment to sparse vectors*************************************************
706  // No special implementation for the multiplication assignment to sparse vectors.
707  //**********************************************************************************************
708 
709  //**SMP assignment to dense vectors*************************************************************
723  template< typename VT2 > // Type of the target dense vector
724  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
725  smpAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
726  {
728 
729  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
730 
731  smpAssign( ~lhs, rhs.dv_ );
732  smpAssign( ~lhs, abs( ~lhs ) );
733  }
735  //**********************************************************************************************
736 
737  //**SMP assignment to sparse vectors************************************************************
751  template< typename VT2 > // Type of the target sparse vector
752  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
753  smpAssign( SparseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
754  {
756 
760 
761  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
762 
763  const ResultType tmp( rhs );
764  smpAssign( ~lhs, tmp );
765  }
767  //**********************************************************************************************
768 
769  //**SMP addition assignment to dense vectors****************************************************
783  template< typename VT2 > // Type of the target dense vector
784  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
785  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
786  {
788 
792 
793  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
794 
795  const ResultType tmp( rhs );
796  smpAddAssign( ~lhs, tmp );
797  }
799  //**********************************************************************************************
800 
801  //**SMP addition assignment to sparse vectors***************************************************
802  // No special implementation for the SMP addition assignment to sparse vectors.
803  //**********************************************************************************************
804 
805  //**SMP subtraction assignment to dense vectors*************************************************
819  template< typename VT2 > // Type of the target dense vector
820  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
821  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
822  {
824 
828 
829  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
830 
831  const ResultType tmp( rhs );
832  smpSubAssign( ~lhs, tmp );
833  }
835  //**********************************************************************************************
836 
837  //**SMP subtraction assignment to sparse vectors************************************************
838  // No special implementation for the SMP subtraction assignment to sparse vectors.
839  //**********************************************************************************************
840 
841  //**SMP multiplication assignment to dense vectors**********************************************
855  template< typename VT2 > // Type of the target dense vector
856  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
857  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecAbsExpr& rhs )
858  {
860 
864 
865  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
866 
867  const ResultType tmp( rhs );
868  smpMultAssign( ~lhs, tmp );
869  }
871  //**********************************************************************************************
872 
873  //**SMP multiplication assignment to sparse vectors*********************************************
874  // No special implementation for the SMP multiplication assignment to sparse vectors.
875  //**********************************************************************************************
876 
877  //**Compile time checks*************************************************************************
882  //**********************************************************************************************
883 };
884 //*************************************************************************************************
885 
886 
887 
888 
889 //=================================================================================================
890 //
891 // GLOBAL FUNCTIONS
892 //
893 //=================================================================================================
894 
895 //*************************************************************************************************
912 template< typename VT // Type of the dense vector
913  , bool TF > // Transpose flag
914 inline const DVecAbsExpr<VT,TF> abs( const DenseVector<VT,TF>& dv )
915 {
917 
918  return DVecAbsExpr<VT,TF>( ~dv );
919 }
920 //*************************************************************************************************
921 
922 
923 
924 
925 //=================================================================================================
926 //
927 // GLOBAL RESTRUCTURING FUNCTIONS
928 //
929 //=================================================================================================
930 
931 //*************************************************************************************************
942 template< typename VT // Type of the dense vector
943  , bool TF > // Transpose flag
944 inline const DVecAbsExpr<VT,TF>& abs( const DVecAbsExpr<VT,TF>& dv )
945 {
947 
948  return dv;
949 }
951 //*************************************************************************************************
952 
953 
954 
955 
956 //=================================================================================================
957 //
958 // SIZE SPECIALIZATIONS
959 //
960 //=================================================================================================
961 
962 //*************************************************************************************************
964 template< typename VT, bool TF >
965 struct Size< DVecAbsExpr<VT,TF> >
966  : public Size<VT>
967 {};
969 //*************************************************************************************************
970 
971 
972 
973 
974 //=================================================================================================
975 //
976 // EXPRESSION TRAIT SPECIALIZATIONS
977 //
978 //=================================================================================================
979 
980 //*************************************************************************************************
982 template< typename VT >
983 struct DVecAbsExprTrait< DVecAbsExpr<VT,false> >
984 {
985  public:
986  //**********************************************************************************************
987  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
988  , DVecAbsExpr<VT,false>
989  , INVALID_TYPE >::Type Type;
990  //**********************************************************************************************
991 };
993 //*************************************************************************************************
994 
995 
996 //*************************************************************************************************
998 template< typename VT >
999 struct TDVecAbsExprTrait< DVecAbsExpr<VT,true> >
1000 {
1001  public:
1002  //**********************************************************************************************
1003  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1004  , DVecAbsExpr<VT,true>
1005  , INVALID_TYPE >::Type Type;
1006  //**********************************************************************************************
1007 };
1009 //*************************************************************************************************
1010 
1011 
1012 //*************************************************************************************************
1014 template< typename VT, bool TF, bool AF >
1015 struct SubvectorExprTrait< DVecAbsExpr<VT,TF>, AF >
1016 {
1017  public:
1018  //**********************************************************************************************
1019  typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1020  //**********************************************************************************************
1021 };
1023 //*************************************************************************************************
1024 
1025 } // namespace blaze
1026 
1027 #endif
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecAbsExpr.h:457
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:420
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:150
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
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:382
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:909
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:370
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecAbsExpr.h:431
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecAbsExpr.h:172
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecAbsExpr.h:499
Header file for the Computation base class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecAbsExpr.h:260
Expression object for the dense vector abs() function.The DVecAbsExpr class represents the compile ti...
Definition: DVecAbsExpr.h:90
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:467
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:292
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:259
DifferenceType difference_type
Difference between two iterators.
Definition: DVecAbsExpr.h:183
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecAbsExpr.h:477
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:394
IteratorType it_
Iterator to the current vector element.
Definition: DVecAbsExpr.h:401
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
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:314
Header file for the DVecAbsExprTrait class template.
SelectType< useAssign, const ResultType, const DVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecAbsExpr.h:159
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:281
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
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:162
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:179
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
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:538
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:347
ReferenceType reference
Reference return type.
Definition: DVecAbsExpr.h:182
ElementType * PointerType
Pointer return type.
Definition: DVecAbsExpr.h:174
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:2477
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:153
Header file for run time assertion macros.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecAbsExpr.h:217
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:205
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:149
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecAbsExpr.h:531
VT::ElementType ElementType
Resulting element type.
Definition: DVecAbsExpr.h:152
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecAbsExpr.h:511
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:325
ValueType value_type
Type of the underlying elements.
Definition: DVecAbsExpr.h:180
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:303
ElementType ValueType
Type of the underlying elements.
Definition: DVecAbsExpr.h:173
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecAbsExpr.h:228
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:444
VT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecAbsExpr.h:151
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecAbsExpr.h:194
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecAbsExpr.h:270
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecAbsExpr.h:521
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecAbsExpr.h:176
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:181
Iterator over the elements of the dense vector.
Definition: DVecAbsExpr.h:168
Header file for the IsComputation type trait class.
Operand operand() const
Returns the dense vector operand.
Definition: DVecAbsExpr.h:487
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecAbsExpr.h:110
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:358
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecAbsExpr.h:239
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:2473
Header file for basic type definitions.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecAbsExpr.h:156
Header file for the SubvectorExprTrait class template.
ElementType & ReferenceType
Reference return type.
Definition: DVecAbsExpr.h:175
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecAbsExpr.h:249
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:186
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:914
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:336
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecAbsExpr.h:96
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:97
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