DVecTransExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTRANSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
52 #include <blaze/math/Intrinsics.h>
66 #include <blaze/system/Inline.h>
67 #include <blaze/util/Assert.h>
68 #include <blaze/util/EmptyType.h>
69 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/Exception.h>
71 #include <blaze/util/InvalidType.h>
73 #include <blaze/util/SelectType.h>
74 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS DVECTRANSEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT // Type of the dense vector
94  , bool TF > // Transpose flag
95 class DVecTransExpr : public DenseVector< DVecTransExpr<VT,TF>, TF >
96  , private VecTransExpr
97  , private SelectType< IsComputation<VT>::value, Computation, EmptyType >::Type
98 {
99  private:
100  //**Type definitions****************************************************************************
101  typedef typename VT::CompositeType CT;
102  //**********************************************************************************************
103 
104  //**Serial evaluation strategy******************************************************************
106 
112  enum { useAssign = RequiresEvaluation<VT>::value };
113 
115  template< typename VT2 >
117  struct UseAssign {
118  enum { value = useAssign };
119  };
121  //**********************************************************************************************
122 
123  //**Parallel evaluation strategy****************************************************************
125 
130  template< typename VT2 >
131  struct UseSMPAssign {
132  enum { value = VT2::smpAssignable && useAssign };
133  };
135  //**********************************************************************************************
136 
137  public:
138  //**Type definitions****************************************************************************
140  typedef typename VT::TransposeType ResultType;
141  typedef typename VT::ResultType TransposeType;
142  typedef typename VT::ElementType ElementType;
143  typedef typename VT::ReturnType ReturnType;
144 
147 
150 
152  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
153  //**********************************************************************************************
154 
155  //**ConstIterator class definition**************************************************************
159  {
160  public:
161  //**Type definitions*************************************************************************
162  typedef std::random_access_iterator_tag IteratorCategory;
163  typedef ElementType ValueType;
164  typedef ElementType* PointerType;
165  typedef ElementType& ReferenceType;
167 
168  // STL iterator requirements
169  typedef IteratorCategory iterator_category;
170  typedef ValueType value_type;
171  typedef PointerType pointer;
172  typedef ReferenceType reference;
173  typedef DifferenceType difference_type;
174 
176  typedef typename VT::ConstIterator IteratorType;
177  //*******************************************************************************************
178 
179  //**Constructor******************************************************************************
184  explicit inline ConstIterator( IteratorType iterator )
185  : iterator_( iterator ) // Iterator to the current element
186  {}
187  //*******************************************************************************************
188 
189  //**Addition assignment operator*************************************************************
195  inline ConstIterator& operator+=( size_t inc ) {
196  iterator_ += inc;
197  return *this;
198  }
199  //*******************************************************************************************
200 
201  //**Subtraction assignment operator**********************************************************
207  inline ConstIterator& operator-=( size_t dec ) {
208  iterator_ -= dec;
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Prefix increment operator****************************************************************
219  ++iterator_;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Postfix increment operator***************************************************************
229  inline const ConstIterator operator++( int ) {
230  return ConstIterator( iterator_++ );
231  }
232  //*******************************************************************************************
233 
234  //**Prefix decrement operator****************************************************************
240  --iterator_;
241  return *this;
242  }
243  //*******************************************************************************************
244 
245  //**Postfix decrement operator***************************************************************
250  inline const ConstIterator operator--( int ) {
251  return ConstIterator( iterator_-- );
252  }
253  //*******************************************************************************************
254 
255  //**Element access operator******************************************************************
260  inline ReturnType operator*() const {
261  return *iterator_;
262  }
263  //*******************************************************************************************
264 
265  //**Load function****************************************************************************
270  inline IntrinsicType load() const {
271  return iterator_.load();
272  }
273  //*******************************************************************************************
274 
275  //**Equality operator************************************************************************
281  inline bool operator==( const ConstIterator& rhs ) const {
282  return iterator_ == rhs.iterator_;
283  }
284  //*******************************************************************************************
285 
286  //**Inequality operator**********************************************************************
292  inline bool operator!=( const ConstIterator& rhs ) const {
293  return iterator_ != rhs.iterator_;
294  }
295  //*******************************************************************************************
296 
297  //**Less-than operator***********************************************************************
303  inline bool operator<( const ConstIterator& rhs ) const {
304  return iterator_ < rhs.iterator_;
305  }
306  //*******************************************************************************************
307 
308  //**Greater-than operator********************************************************************
314  inline bool operator>( const ConstIterator& rhs ) const {
315  return iterator_ > rhs.iterator_;
316  }
317  //*******************************************************************************************
318 
319  //**Less-or-equal-than operator**************************************************************
325  inline bool operator<=( const ConstIterator& rhs ) const {
326  return iterator_ <= rhs.iterator_;
327  }
328  //*******************************************************************************************
329 
330  //**Greater-or-equal-than operator***********************************************************
336  inline bool operator>=( const ConstIterator& rhs ) const {
337  return iterator_ >= rhs.iterator_;
338  }
339  //*******************************************************************************************
340 
341  //**Subtraction operator*********************************************************************
347  inline DifferenceType operator-( const ConstIterator& rhs ) const {
348  return iterator_ - rhs.iterator_;
349  }
350  //*******************************************************************************************
351 
352  //**Addition operator************************************************************************
359  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
360  return ConstIterator( it.iterator_ + inc );
361  }
362  //*******************************************************************************************
363 
364  //**Addition operator************************************************************************
371  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
372  return ConstIterator( it.iterator_ + inc );
373  }
374  //*******************************************************************************************
375 
376  //**Subtraction operator*********************************************************************
383  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
384  return ConstIterator( it.iterator_ - dec );
385  }
386  //*******************************************************************************************
387 
388  private:
389  //**Member variables*************************************************************************
390  IteratorType iterator_;
391  //*******************************************************************************************
392  };
393  //**********************************************************************************************
394 
395  //**Compilation flags***************************************************************************
397  enum { vectorizable = VT::vectorizable };
398 
400  enum { smpAssignable = VT::smpAssignable };
401  //**********************************************************************************************
402 
403  //**Constructor*********************************************************************************
408  explicit inline DVecTransExpr( const VT& dv )
409  : dv_( dv ) // Dense vector of the transposition expression
410  {}
411  //**********************************************************************************************
412 
413  //**Subscript operator**************************************************************************
419  inline ReturnType operator[]( size_t index ) const {
420  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
421  return dv_[index];
422  }
423  //**********************************************************************************************
424 
425  //**At function*********************************************************************************
432  inline ReturnType at( size_t index ) const {
433  if( index >= dv_.size() ) {
434  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
435  }
436  return (*this)[index];
437  }
438  //**********************************************************************************************
439 
440  //**Load function*******************************************************************************
446  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
447  typedef IntrinsicTrait<ElementType> IT;
448  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
449  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL , "Invalid vector access index" );
450  return dv_.load( index );
451  }
452  //**********************************************************************************************
453 
454  //**Low-level data access***********************************************************************
459  inline const ElementType* data() const {
460  return dv_.data();
461  }
462  //**********************************************************************************************
463 
464  //**Begin function******************************************************************************
469  inline ConstIterator begin() const {
470  return ConstIterator( dv_.begin() );
471  }
472  //**********************************************************************************************
473 
474  //**End function********************************************************************************
479  inline ConstIterator end() const {
480  return ConstIterator( dv_.end() );
481  }
482  //**********************************************************************************************
483 
484  //**Size function*******************************************************************************
489  inline size_t size() const {
490  return dv_.size();
491  }
492  //**********************************************************************************************
493 
494  //**Operand access******************************************************************************
499  inline Operand operand() const {
500  return dv_;
501  }
502  //**********************************************************************************************
503 
504  //**********************************************************************************************
510  template< typename T >
511  inline bool canAlias( const T* alias ) const {
512  return dv_.canAlias( alias );
513  }
514  //**********************************************************************************************
515 
516  //**********************************************************************************************
522  template< typename T >
523  inline bool isAliased( const T* alias ) const {
524  return dv_.isAliased( alias );
525  }
526  //**********************************************************************************************
527 
528  //**********************************************************************************************
533  inline bool isAligned() const {
534  return dv_.isAligned();
535  }
536  //**********************************************************************************************
537 
538  //**********************************************************************************************
543  inline bool canSMPAssign() const {
544  return dv_.canSMPAssign();
545  }
546  //**********************************************************************************************
547 
548  private:
549  //**Member variables****************************************************************************
550  Operand dv_;
551  //**********************************************************************************************
552 
553  //**Assignment to dense vectors*****************************************************************
567  template< typename VT2 > // Type of the target dense vector
568  friend inline typename EnableIf< UseAssign<VT2> >::Type
569  assign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
570  {
572 
573  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
574 
575  DVecTransposer<VT2,!TF> tmp( ~lhs );
576  assign( tmp, rhs.dv_ );
577  }
579  //**********************************************************************************************
580 
581  //**Assignment to sparse vectors****************************************************************
595  template< typename VT2 > // Type of the target sparse vector
596  friend inline typename EnableIf< UseAssign<VT2> >::Type
597  assign( SparseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
598  {
600 
601  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
602 
603  SVecTransposer<VT2,!TF> tmp( ~lhs );
604  assign( tmp, rhs.dv_ );
605  }
607  //**********************************************************************************************
608 
609  //**Addition assignment to dense vectors********************************************************
623  template< typename VT2 > // Type of the target dense vector
624  friend inline typename EnableIf< UseAssign<VT2> >::Type
625  addAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
626  {
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
630 
631  DVecTransposer<VT2,!TF> tmp( ~lhs );
632  addAssign( tmp, rhs.dv_ );
633  }
635  //**********************************************************************************************
636 
637  //**Addition assignment to sparse vectors*******************************************************
638  // No special implementation for the addition assignment to sparse vectors.
639  //**********************************************************************************************
640 
641  //**Subtraction assignment to dense vectors*****************************************************
655  template< typename VT2 > // Type of the target dense vector
656  friend inline typename EnableIf< UseAssign<VT2> >::Type
657  subAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
658  {
660 
661  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
662 
663  DVecTransposer<VT2,!TF> tmp( ~lhs );
664  subAssign( tmp, rhs.dv_ );
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 DVecTransExpr& rhs )
690  {
692 
693  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
694 
695  DVecTransposer<VT2,!TF> tmp( ~lhs );
696  multAssign( tmp, rhs.dv_ );
697  }
699  //**********************************************************************************************
700 
701  //**Multiplication assignment to sparse vectors*************************************************
702  // No special implementation for the multiplication assignment to sparse vectors.
703  //**********************************************************************************************
704 
705  //**SMP assignment to dense vectors*************************************************************
719  template< typename VT2 > // Type of the target dense vector
720  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
721  smpAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
722  {
724 
725  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
726 
727  DVecTransposer<VT2,!TF> tmp( ~lhs );
728  smpAssign( tmp, rhs.dv_ );
729  }
731  //**********************************************************************************************
732 
733  //**SMP assignment to sparse vectors************************************************************
747  template< typename VT2 > // Type of the target sparse vector
748  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
749  smpAssign( SparseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
750  {
752 
753  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
754 
755  SVecTransposer<VT2,!TF> tmp( ~lhs );
756  smpAssign( tmp, rhs.dv_ );
757  }
759  //**********************************************************************************************
760 
761  //**SMP addition assignment to dense vectors****************************************************
775  template< typename VT2 > // Type of the target dense vector
776  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
777  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
778  {
780 
781  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
782 
783  DVecTransposer<VT2,!TF> tmp( ~lhs );
784  smpAddAssign( tmp, rhs.dv_ );
785  }
787  //**********************************************************************************************
788 
789  //**SMP addition assignment to sparse vectors***************************************************
790  // No special implementation for the SMP addition assignment to sparse vectors.
791  //**********************************************************************************************
792 
793  //**SMP subtraction assignment to dense vectors*************************************************
807  template< typename VT2 > // Type of the target dense vector
808  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
809  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
810  {
812 
813  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
814 
815  DVecTransposer<VT2,!TF> tmp( ~lhs );
816  smpSubAssign( tmp, rhs.dv_ );
817  }
819  //**********************************************************************************************
820 
821  //**SMP subtraction assignment to sparse vectors************************************************
822  // No special implementation for the SMP subtraction assignment to sparse vectors.
823  //**********************************************************************************************
824 
825  //**SMP multiplication assignment to dense vectors**********************************************
839  template< typename VT2 > // Type of the target dense vector
840  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
841  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
842  {
844 
845  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
846 
847  DVecTransposer<VT2,!TF> tmp( ~lhs );
848  smpMultAssign( tmp, rhs.dv_ );
849  }
851  //**********************************************************************************************
852 
853  //**SMP multiplication assignment to sparse vectors*********************************************
854  // No special implementation for the SMP multiplication assignment to sparse vectors.
855  //**********************************************************************************************
856 
857  //**Compile time checks*************************************************************************
862  //**********************************************************************************************
863 };
864 //*************************************************************************************************
865 
866 
867 
868 
869 //=================================================================================================
870 //
871 // GLOBAL OPERATORS
872 //
873 //=================================================================================================
874 
875 //*************************************************************************************************
894 template< typename VT // Type of the dense vector
895  , bool TF > // Transpose flag
897 {
899 
900  return DVecTransExpr<VT,!TF>( ~dv );
901 }
902 //*************************************************************************************************
903 
904 
905 
906 
907 //=================================================================================================
908 //
909 // GLOBAL RESTRUCTURING FUNCTIONS
910 //
911 //=================================================================================================
912 
913 //*************************************************************************************************
933 template< typename VT // Type of the dense vector
934  , bool TF > // Transpose flag
935 inline typename DVecTransExpr<VT,TF>::Operand trans( const DVecTransExpr<VT,TF>& dv )
936 {
938 
939  return dv.operand();
940 }
942 //*************************************************************************************************
943 
944 
945 
946 
947 //=================================================================================================
948 //
949 // SIZE SPECIALIZATIONS
950 //
951 //=================================================================================================
952 
953 //*************************************************************************************************
955 template< typename VT, bool TF >
956 struct Size< DVecTransExpr<VT,TF> > : public Size<VT>
957 {};
959 //*************************************************************************************************
960 
961 
962 
963 
964 //=================================================================================================
965 //
966 // ISALIGNED SPECIALIZATIONS
967 //
968 //=================================================================================================
969 
970 //*************************************************************************************************
972 template< typename VT, bool TF >
973 struct IsAligned< DVecTransExpr<VT,TF> > : public IsTrue< IsAligned<VT>::value >
974 {};
976 //*************************************************************************************************
977 
978 
979 
980 
981 //=================================================================================================
982 //
983 // ISPADDED SPECIALIZATIONS
984 //
985 //=================================================================================================
986 
987 //*************************************************************************************************
989 template< typename VT, bool TF >
990 struct IsPadded< DVecTransExpr<VT,TF> > : public IsTrue< IsPadded<VT>::value >
991 {};
993 //*************************************************************************************************
994 
995 
996 
997 
998 //=================================================================================================
999 //
1000 // EXPRESSION TRAIT SPECIALIZATIONS
1001 //
1002 //=================================================================================================
1003 
1004 //*************************************************************************************************
1006 template< typename VT >
1007 struct DVecTransExprTrait< DVecTransExpr<VT,false> >
1008 {
1009  public:
1010  //**********************************************************************************************
1011  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1012  , typename DVecTransExpr<VT,false>::Operand
1013  , INVALID_TYPE >::Type Type;
1014  //**********************************************************************************************
1015 };
1017 //*************************************************************************************************
1018 
1019 
1020 //*************************************************************************************************
1022 template< typename VT >
1023 struct TDVecTransExprTrait< DVecTransExpr<VT,true> >
1024 {
1025  public:
1026  //**********************************************************************************************
1027  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
1028  , typename DVecTransExpr<VT,true>::Operand
1029  , INVALID_TYPE >::Type Type;
1030  //**********************************************************************************************
1031 };
1033 //*************************************************************************************************
1034 
1035 
1036 //*************************************************************************************************
1038 template< typename VT, bool TF, bool AF >
1039 struct SubvectorExprTrait< DVecTransExpr<VT,TF>, AF >
1040 {
1041  public:
1042  //**********************************************************************************************
1043  typedef typename TransExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1044  //**********************************************************************************************
1045 };
1047 //*************************************************************************************************
1048 
1049 } // namespace blaze
1050 
1051 #endif
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecTransExpr.h:523
Pointer difference type of the Blaze library.
VT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DVecTransExpr.h:140
ElementType & ReferenceType
Reference return type.
Definition: DVecTransExpr.h:165
const ElementType * data() const
Low-level data access to the vector elements.
Definition: DVecTransExpr.h:459
Base class for all vector transposition expression templates.The VecTransExpr class serves as a tag f...
Definition: VecTransExpr.h:65
Header file for basic type definitions.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecTransExpr.h:229
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecTransExpr.h:176
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTransExpr.h:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecTransExpr.h:479
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecTransExpr.h:239
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecTransExpr.h:195
Header file for the DenseVector base class.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecTransExpr.h:371
Header file for the Computation base class.
Iterator over the elements of the dense vector.
Definition: DVecTransExpr.h:158
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecTransExpr.h:146
Header file for the RequiresEvaluation type trait.
SelectType< useAssign, const ResultType, const DVecTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecTransExpr.h:149
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DVecTransExpr.h:184
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:76
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecTransExpr.h:446
Operand dv_
Dense vector of the transposition expression.
Definition: DVecTransExpr.h:550
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DVecTransExpr.h:143
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecTransExpr.h:152
ReferenceType reference
Reference return type.
Definition: DVecTransExpr.h:172
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
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
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecTransExpr.h:270
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:292
ElementType ValueType
Type of the underlying elements.
Definition: DVecTransExpr.h:163
Header file for the dense vector transposer.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecTransExpr.h:543
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecTransExpr.h:207
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
VT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTransExpr.h:141
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper obje...
Definition: Forward.h:136
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecTransExpr.h:511
Header file for the IsAligned type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:314
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTransExpr.h:166
Constraint on the data type.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:336
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraint on the data type.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecTransExpr.h:260
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:281
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 IsPadded type trait.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecTransExpr.h:347
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:325
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:2587
Header file for the VecTransExpr base class.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
VT::ElementType ElementType
Resulting element type.
Definition: DVecTransExpr.h:142
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecTransExpr.h:359
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
PointerType pointer
Pointer return type.
Definition: DVecTransExpr.h:171
Header file for the TransExprTrait class template.
Header file for the DVecTransExprTrait class template.
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecTransExpr.h:101
DVecTransExpr(const VT &dv)
Constructor for the DVecTransExpr class.
Definition: DVecTransExpr.h:408
DifferenceType difference_type
Difference between two iterators.
Definition: DVecTransExpr.h:173
ElementType * PointerType
Pointer return type.
Definition: DVecTransExpr.h:164
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecTransExpr.h:250
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
Header file for the sparse vector transposer.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTransExpr.h:218
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecTransExpr.h:533
Header file for the IsComputation type trait class.
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
Header file for the TDVecTransExprTrait class template.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:303
IteratorCategory iterator_category
The iterator category.
Definition: DVecTransExpr.h:169
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecTransExpr.h:489
Header file for the SubvectorExprTrait class template.
Expression object for dense vector transpositions.The DVecTransExpr class represents the compile time...
Definition: DVecTransExpr.h:95
IteratorType iterator_
Iterator to the current element.
Definition: DVecTransExpr.h:390
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecTransExpr.h:432
Header file for exception macros.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecTransExpr.h:419
Header file for the IsColumnVector type trait.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecTransExpr.h:469
Header file for the empty type.
ValueType value_type
Type of the underlying elements.
Definition: DVecTransExpr.h:170
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecTransExpr.h:383
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:81
Operand operand() const
Returns the dense vector operand.
Definition: DVecTransExpr.h:499
#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
DVecTransExpr< VT, TF > This
Type of this DVecTransExpr instance.
Definition: DVecTransExpr.h:139
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.