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>
44 #include <blaze/math/Aliases.h>
47 #include <blaze/math/Exception.h>
54 #include <blaze/math/SIMD.h>
68 #include <blaze/system/Inline.h>
69 #include <blaze/util/Assert.h>
70 #include <blaze/util/EmptyType.h>
71 #include <blaze/util/EnableIf.h>
73 #include <blaze/util/InvalidType.h>
75 #include <blaze/util/mpl/And.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DVECTRANSEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename VT // Type of the dense vector
96  , bool TF > // Transpose flag
97 class DVecTransExpr : public DenseVector< DVecTransExpr<VT,TF>, TF >
98  , private VecTransExpr
99  , private If< IsComputation<VT>, Computation, EmptyType >::Type
100 {
101  private:
102  //**Type definitions****************************************************************************
104  //**********************************************************************************************
105 
106  //**Serial evaluation strategy******************************************************************
108 
114  enum : bool { useAssign = RequiresEvaluation<VT>::value };
115 
117  template< typename VT2 >
119  struct UseAssign {
120  enum : bool { value = useAssign };
121  };
123  //**********************************************************************************************
124 
125  //**Parallel evaluation strategy****************************************************************
127 
132  template< typename VT2 >
133  struct UseSMPAssign {
134  enum : bool { value = VT2::smpAssignable && useAssign };
135  };
137  //**********************************************************************************************
138 
139  public:
140  //**Type definitions****************************************************************************
146 
149 
151  typedef If_< IsExpression<VT>, const VT, const VT& > Operand;
152  //**********************************************************************************************
153 
154  //**ConstIterator class definition**************************************************************
158  {
159  public:
160  //**Type definitions*************************************************************************
161  typedef std::random_access_iterator_tag IteratorCategory;
162  typedef ElementType ValueType;
163  typedef ElementType* PointerType;
164  typedef ElementType& ReferenceType;
166 
167  // STL iterator requirements
168  typedef IteratorCategory iterator_category;
169  typedef ValueType value_type;
170  typedef PointerType pointer;
171  typedef ReferenceType reference;
172  typedef DifferenceType difference_type;
173 
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
183  explicit inline ConstIterator( IteratorType iterator )
184  : iterator_( iterator ) // Iterator to the current element
185  {}
186  //*******************************************************************************************
187 
188  //**Addition assignment operator*************************************************************
194  inline ConstIterator& operator+=( size_t inc ) {
195  iterator_ += inc;
196  return *this;
197  }
198  //*******************************************************************************************
199 
200  //**Subtraction assignment operator**********************************************************
206  inline ConstIterator& operator-=( size_t dec ) {
207  iterator_ -= dec;
208  return *this;
209  }
210  //*******************************************************************************************
211 
212  //**Prefix increment operator****************************************************************
218  ++iterator_;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Postfix increment operator***************************************************************
228  inline const ConstIterator operator++( int ) {
229  return ConstIterator( iterator_++ );
230  }
231  //*******************************************************************************************
232 
233  //**Prefix decrement operator****************************************************************
239  --iterator_;
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Postfix decrement operator***************************************************************
249  inline const ConstIterator operator--( int ) {
250  return ConstIterator( iterator_-- );
251  }
252  //*******************************************************************************************
253 
254  //**Element access operator******************************************************************
259  inline ReturnType operator*() const {
260  return *iterator_;
261  }
262  //*******************************************************************************************
263 
264  //**Load function****************************************************************************
269  inline auto load() const noexcept {
270  return iterator_.load();
271  }
272  //*******************************************************************************************
273 
274  //**Equality operator************************************************************************
280  inline bool operator==( const ConstIterator& rhs ) const {
281  return iterator_ == rhs.iterator_;
282  }
283  //*******************************************************************************************
284 
285  //**Inequality operator**********************************************************************
291  inline bool operator!=( const ConstIterator& rhs ) const {
292  return iterator_ != rhs.iterator_;
293  }
294  //*******************************************************************************************
295 
296  //**Less-than operator***********************************************************************
302  inline bool operator<( const ConstIterator& rhs ) const {
303  return iterator_ < rhs.iterator_;
304  }
305  //*******************************************************************************************
306 
307  //**Greater-than operator********************************************************************
313  inline bool operator>( const ConstIterator& rhs ) const {
314  return iterator_ > rhs.iterator_;
315  }
316  //*******************************************************************************************
317 
318  //**Less-or-equal-than operator**************************************************************
324  inline bool operator<=( const ConstIterator& rhs ) const {
325  return iterator_ <= rhs.iterator_;
326  }
327  //*******************************************************************************************
328 
329  //**Greater-or-equal-than operator***********************************************************
335  inline bool operator>=( const ConstIterator& rhs ) const {
336  return iterator_ >= rhs.iterator_;
337  }
338  //*******************************************************************************************
339 
340  //**Subtraction operator*********************************************************************
346  inline DifferenceType operator-( const ConstIterator& rhs ) const {
347  return iterator_ - rhs.iterator_;
348  }
349  //*******************************************************************************************
350 
351  //**Addition operator************************************************************************
358  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
359  return ConstIterator( it.iterator_ + inc );
360  }
361  //*******************************************************************************************
362 
363  //**Addition operator************************************************************************
370  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
371  return ConstIterator( it.iterator_ + inc );
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
382  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
383  return ConstIterator( it.iterator_ - dec );
384  }
385  //*******************************************************************************************
386 
387  private:
388  //**Member variables*************************************************************************
389  IteratorType iterator_;
390  //*******************************************************************************************
391  };
392  //**********************************************************************************************
393 
394  //**Compilation flags***************************************************************************
396  enum : bool { simdEnabled = VT::simdEnabled };
397 
399  enum : bool { smpAssignable = VT::smpAssignable };
400  //**********************************************************************************************
401 
402  //**SIMD properties*****************************************************************************
404  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
405  //**********************************************************************************************
406 
407  //**Constructor*********************************************************************************
412  explicit inline DVecTransExpr( const VT& dv ) noexcept
413  : dv_( dv ) // Dense vector of the transposition expression
414  {}
415  //**********************************************************************************************
416 
417  //**Subscript operator**************************************************************************
423  inline ReturnType operator[]( size_t index ) const {
424  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
425  return dv_[index];
426  }
427  //**********************************************************************************************
428 
429  //**At function*********************************************************************************
436  inline ReturnType at( size_t index ) const {
437  if( index >= dv_.size() ) {
438  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
439  }
440  return (*this)[index];
441  }
442  //**********************************************************************************************
443 
444  //**Load function*******************************************************************************
450  BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
451  BLAZE_INTERNAL_ASSERT( index < dv_.size() , "Invalid vector access index" );
452  BLAZE_INTERNAL_ASSERT( index % SIMDSIZE == 0UL , "Invalid vector access index" );
453  return dv_.load( index );
454  }
455  //**********************************************************************************************
456 
457  //**Low-level data access***********************************************************************
462  inline const ElementType* data() const noexcept {
463  return dv_.data();
464  }
465  //**********************************************************************************************
466 
467  //**Begin function******************************************************************************
472  inline ConstIterator begin() const {
473  return ConstIterator( dv_.begin() );
474  }
475  //**********************************************************************************************
476 
477  //**End function********************************************************************************
482  inline ConstIterator end() const {
483  return ConstIterator( dv_.end() );
484  }
485  //**********************************************************************************************
486 
487  //**Size function*******************************************************************************
492  inline size_t size() const noexcept {
493  return dv_.size();
494  }
495  //**********************************************************************************************
496 
497  //**Operand access******************************************************************************
502  inline Operand operand() const noexcept {
503  return dv_;
504  }
505  //**********************************************************************************************
506 
507  //**********************************************************************************************
513  template< typename T >
514  inline bool canAlias( const T* alias ) const noexcept {
515  return dv_.canAlias( alias );
516  }
517  //**********************************************************************************************
518 
519  //**********************************************************************************************
525  template< typename T >
526  inline bool isAliased( const T* alias ) const noexcept {
527  return dv_.isAliased( alias );
528  }
529  //**********************************************************************************************
530 
531  //**********************************************************************************************
536  inline bool isAligned() const noexcept {
537  return dv_.isAligned();
538  }
539  //**********************************************************************************************
540 
541  //**********************************************************************************************
546  inline bool canSMPAssign() const noexcept {
547  return dv_.canSMPAssign();
548  }
549  //**********************************************************************************************
550 
551  private:
552  //**Member variables****************************************************************************
553  Operand dv_;
554  //**********************************************************************************************
555 
556  //**Assignment to dense vectors*****************************************************************
570  template< typename VT2 > // Type of the target dense vector
571  friend inline EnableIf_< UseAssign<VT2> >
572  assign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
573  {
575 
576  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
577 
578  DVecTransposer<VT2,!TF> tmp( ~lhs );
579  assign( tmp, rhs.dv_ );
580  }
582  //**********************************************************************************************
583 
584  //**Assignment to sparse vectors****************************************************************
598  template< typename VT2 > // Type of the target sparse vector
599  friend inline EnableIf_< UseAssign<VT2> >
600  assign( SparseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
601  {
603 
604  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
605 
606  SVecTransposer<VT2,!TF> tmp( ~lhs );
607  assign( tmp, rhs.dv_ );
608  }
610  //**********************************************************************************************
611 
612  //**Addition assignment to dense vectors********************************************************
626  template< typename VT2 > // Type of the target dense vector
627  friend inline EnableIf_< UseAssign<VT2> >
628  addAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
629  {
631 
632  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
633 
634  DVecTransposer<VT2,!TF> tmp( ~lhs );
635  addAssign( tmp, rhs.dv_ );
636  }
638  //**********************************************************************************************
639 
640  //**Addition assignment to sparse vectors*******************************************************
641  // No special implementation for the addition assignment to sparse vectors.
642  //**********************************************************************************************
643 
644  //**Subtraction assignment to dense vectors*****************************************************
658  template< typename VT2 > // Type of the target dense vector
659  friend inline EnableIf_< UseAssign<VT2> >
660  subAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
661  {
663 
664  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
665 
666  DVecTransposer<VT2,!TF> tmp( ~lhs );
667  subAssign( tmp, rhs.dv_ );
668  }
670  //**********************************************************************************************
671 
672  //**Subtraction assignment to sparse vectors****************************************************
673  // No special implementation for the subtraction assignment to sparse vectors.
674  //**********************************************************************************************
675 
676  //**Multiplication assignment to dense vectors**************************************************
690  template< typename VT2 > // Type of the target dense vector
691  friend inline EnableIf_< UseAssign<VT2> >
692  multAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
693  {
695 
696  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
697 
698  DVecTransposer<VT2,!TF> tmp( ~lhs );
699  multAssign( tmp, rhs.dv_ );
700  }
702  //**********************************************************************************************
703 
704  //**Multiplication assignment to sparse vectors*************************************************
705  // No special implementation for the multiplication assignment to sparse vectors.
706  //**********************************************************************************************
707 
708  //**Division assignment to dense vectors********************************************************
722  template< typename VT2 > // Type of the target dense vector
723  friend inline EnableIf_< UseAssign<VT2> >
724  divAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
725  {
727 
728  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
729 
730  DVecTransposer<VT2,!TF> tmp( ~lhs );
731  divAssign( tmp, rhs.dv_ );
732  }
734  //**********************************************************************************************
735 
736  //**Division assignment to sparse vectors*******************************************************
737  // No special implementation for the division assignment to sparse vectors.
738  //**********************************************************************************************
739 
740  //**SMP assignment to dense vectors*************************************************************
754  template< typename VT2 > // Type of the target dense vector
755  friend inline EnableIf_< UseSMPAssign<VT2> >
756  smpAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
757  {
759 
760  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
761 
762  DVecTransposer<VT2,!TF> tmp( ~lhs );
763  smpAssign( tmp, rhs.dv_ );
764  }
766  //**********************************************************************************************
767 
768  //**SMP assignment to sparse vectors************************************************************
782  template< typename VT2 > // Type of the target sparse vector
783  friend inline EnableIf_< UseSMPAssign<VT2> >
784  smpAssign( SparseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
785  {
787 
788  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
789 
790  SVecTransposer<VT2,!TF> tmp( ~lhs );
791  smpAssign( tmp, rhs.dv_ );
792  }
794  //**********************************************************************************************
795 
796  //**SMP addition assignment to dense vectors****************************************************
810  template< typename VT2 > // Type of the target dense vector
811  friend inline EnableIf_< UseSMPAssign<VT2> >
812  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
813  {
815 
816  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
817 
818  DVecTransposer<VT2,!TF> tmp( ~lhs );
819  smpAddAssign( tmp, rhs.dv_ );
820  }
822  //**********************************************************************************************
823 
824  //**SMP addition assignment to sparse vectors***************************************************
825  // No special implementation for the SMP addition assignment to sparse vectors.
826  //**********************************************************************************************
827 
828  //**SMP subtraction assignment to dense vectors*************************************************
842  template< typename VT2 > // Type of the target dense vector
843  friend inline EnableIf_< UseSMPAssign<VT2> >
844  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
845  {
847 
848  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
849 
850  DVecTransposer<VT2,!TF> tmp( ~lhs );
851  smpSubAssign( tmp, rhs.dv_ );
852  }
854  //**********************************************************************************************
855 
856  //**SMP subtraction assignment to sparse vectors************************************************
857  // No special implementation for the SMP subtraction assignment to sparse vectors.
858  //**********************************************************************************************
859 
860  //**SMP multiplication assignment to dense vectors**********************************************
874  template< typename VT2 > // Type of the target dense vector
875  friend inline EnableIf_< UseSMPAssign<VT2> >
876  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
877  {
879 
880  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
881 
882  DVecTransposer<VT2,!TF> tmp( ~lhs );
883  smpMultAssign( tmp, rhs.dv_ );
884  }
886  //**********************************************************************************************
887 
888  //**SMP multiplication assignment to sparse vectors*********************************************
889  // No special implementation for the SMP multiplication assignment to sparse vectors.
890  //**********************************************************************************************
891 
892  //**SMP division assignment to dense vectors****************************************************
906  template< typename VT2 > // Type of the target dense vector
907  friend inline EnableIf_< UseSMPAssign<VT2> >
908  smpDivAssign( DenseVector<VT2,TF>& lhs, const DVecTransExpr& rhs )
909  {
911 
912  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
913 
914  DVecTransposer<VT2,!TF> tmp( ~lhs );
915  smpDivAssign( tmp, rhs.dv_ );
916  }
918  //**********************************************************************************************
919 
920  //**SMP division assignment to sparse vectors***************************************************
921  // No special implementation for the SMP division assignment to sparse vectors.
922  //**********************************************************************************************
923 
924  //**Compile time checks*************************************************************************
929  //**********************************************************************************************
930 };
931 //*************************************************************************************************
932 
933 
934 
935 
936 //=================================================================================================
937 //
938 // GLOBAL OPERATORS
939 //
940 //=================================================================================================
941 
942 //*************************************************************************************************
961 template< typename VT // Type of the dense vector
962  , bool TF > // Transpose flag
964 {
966 
967  return DVecTransExpr<VT,!TF>( ~dv );
968 }
969 //*************************************************************************************************
970 
971 
972 
973 
974 //=================================================================================================
975 //
976 // GLOBAL RESTRUCTURING FUNCTIONS
977 //
978 //=================================================================================================
979 
980 //*************************************************************************************************
1000 template< typename VT // Type of the dense vector
1001  , bool TF > // Transpose flag
1002 inline typename DVecTransExpr<VT,TF>::Operand trans( const DVecTransExpr<VT,TF>& dv )
1003 {
1005 
1006  return dv.operand();
1007 }
1009 //*************************************************************************************************
1010 
1011 
1012 
1013 
1014 //=================================================================================================
1015 //
1016 // SIZE SPECIALIZATIONS
1017 //
1018 //=================================================================================================
1019 
1020 //*************************************************************************************************
1022 template< typename VT, bool TF >
1023 struct Size< DVecTransExpr<VT,TF> > : public Size<VT>
1024 {};
1026 //*************************************************************************************************
1027 
1028 
1029 
1030 
1031 //=================================================================================================
1032 //
1033 // ISALIGNED SPECIALIZATIONS
1034 //
1035 //=================================================================================================
1036 
1037 //*************************************************************************************************
1039 template< typename VT, bool TF >
1040 struct IsAligned< DVecTransExpr<VT,TF> >
1041  : public BoolConstant< IsAligned<VT>::value >
1042 {};
1044 //*************************************************************************************************
1045 
1046 
1047 
1048 
1049 //=================================================================================================
1050 //
1051 // ISPADDED SPECIALIZATIONS
1052 //
1053 //=================================================================================================
1054 
1055 //*************************************************************************************************
1057 template< typename VT, bool TF >
1058 struct IsPadded< DVecTransExpr<VT,TF> >
1059  : public BoolConstant< IsPadded<VT>::value >
1060 {};
1062 //*************************************************************************************************
1063 
1064 
1065 
1066 
1067 //=================================================================================================
1068 //
1069 // EXPRESSION TRAIT SPECIALIZATIONS
1070 //
1071 //=================================================================================================
1072 
1073 //*************************************************************************************************
1075 template< typename VT >
1076 struct DVecTransExprTrait< DVecTransExpr<VT,false> >
1077 {
1078  public:
1079  //**********************************************************************************************
1080  using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT> >
1081  , Operand_< DVecTransExpr<VT,false> >
1082  , INVALID_TYPE >;
1083  //**********************************************************************************************
1084 };
1086 //*************************************************************************************************
1087 
1088 
1089 //*************************************************************************************************
1091 template< typename VT >
1092 struct TDVecTransExprTrait< DVecTransExpr<VT,true> >
1093 {
1094  public:
1095  //**********************************************************************************************
1096  using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT> >
1097  , Operand_< DVecTransExpr<VT,true> >
1098  , INVALID_TYPE >;
1099  //**********************************************************************************************
1100 };
1102 //*************************************************************************************************
1103 
1104 
1105 //*************************************************************************************************
1107 template< typename VT, bool TF, bool AF >
1108 struct SubvectorExprTrait< DVecTransExpr<VT,TF>, AF >
1109 {
1110  public:
1111  //**********************************************************************************************
1112  using Type = TransExprTrait_< SubvectorExprTrait_<const VT,AF> >;
1113  //**********************************************************************************************
1114 };
1116 //*************************************************************************************************
1117 
1118 } // namespace blaze
1119 
1120 #endif
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecTransExpr.h:145
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
ElementType & ReferenceType
Reference return type.
Definition: DVecTransExpr.h:164
Base class for all vector transposition expression templates.The VecTransExpr class serves as a tag f...
Definition: VecTransExpr.h:65
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:132
Header file for basic type definitions.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecTransExpr.h:228
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecTransExpr.h:492
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecTransExpr.h:450
EnableIf_< IsDenseMatrix< MT1 > > 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
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecTransExpr.h:269
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
DVecTransExpr(const VT &dv) noexcept
Constructor for the DVecTransExpr class.
Definition: DVecTransExpr.h:412
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecTransExpr.h:143
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTransExpr.h:161
Header file for the IsRowVector type trait.
EnableIf_< IsDenseVector< VT1 > > 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:193
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecTransExpr.h:482
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecTransExpr.h:238
Header file for the And class template.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecTransExpr.h:194
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:370
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecTransExpr.h:514
Header file for the Computation base class.
Iterator over the elements of the dense vector.
Definition: DVecTransExpr.h:157
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecTransExpr.h:502
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DVecTransExpr.h:183
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:77
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Operand dv_
Dense vector of the transposition expression.
Definition: DVecTransExpr.h:553
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ReferenceType reference
Reference return type.
Definition: DVecTransExpr.h:171
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
Header file for the If class template.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:291
ElementType ValueType
Type of the underlying elements.
Definition: DVecTransExpr.h:162
Header file for the dense vector transposer.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecTransExpr.h:206
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
EnableIf_< IsDenseMatrix< MT1 > > 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
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper obje...
Definition: Forward.h:126
Header file for all SIMD functionality.
const ElementType * data() const noexcept
Low-level data access to the vector elements.
Definition: DVecTransExpr.h:462
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
IfTrue_< useAssign, const ResultType, const DVecTransExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecTransExpr.h:148
Header file for the IsAligned type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:313
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTransExpr.h:165
Constraint on the data type.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:335
Constraint on the data type.
Header file for the exception macros of the math module.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecTransExpr.h:259
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:280
Header file for all forward declarations for expression class templates.
CompositeType_< VT > CT
Composite type of the dense vector expression.
Definition: DVecTransExpr.h:103
ElementType_< VT > ElementType
Resulting element type.
Definition: DVecTransExpr.h:144
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:346
If_< IsExpression< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition: DVecTransExpr.h:151
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:324
Header file for the VecTransExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecTransExpr.h:358
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
PointerType pointer
Pointer return type.
Definition: DVecTransExpr.h:170
Header file for the TransExprTrait class template.
Header file for the DVecTransExprTrait class template.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecTransExpr.h:172
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
ElementType * PointerType
Pointer return type.
Definition: DVecTransExpr.h:163
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecTransExpr.h:249
Header file for the IsDenseVector type trait.
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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:61
Header file for the sparse vector transposer.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTransExpr.h:217
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
ConstIterator_< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecTransExpr.h:175
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:110
#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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecTransExpr.h:526
Header file for the IntegralConstant class template.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTransExpr.h:302
IteratorCategory iterator_category
The iterator category.
Definition: DVecTransExpr.h:168
Header file for the SubvectorExprTrait class template.
Expression object for dense vector transpositions.The DVecTransExpr class represents the compile time...
Definition: DVecTransExpr.h:97
IteratorType iterator_
Iterator to the current element.
Definition: DVecTransExpr.h:389
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecTransExpr.h:436
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecTransExpr.h:423
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:472
Header file for the empty type.
ValueType value_type
Type of the underlying elements.
Definition: DVecTransExpr.h:169
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: DVecTransExpr.h:142
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecTransExpr.h:382
System settings for the inline keywords.
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:63
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecTransExpr.h:536
#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:141
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecTransExpr.h:546
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.