35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTRANSEXPR_H_
99 ,
private If< IsComputation<VT>, Computation, EmptyType >::Type
117 template<
typename VT2 >
120 enum :
bool { value = useAssign };
132 template<
typename VT2 >
133 struct UseSMPAssign {
134 enum :
bool { value = VT2::smpAssignable && useAssign };
269 inline auto load() const noexcept {
396 enum :
bool { simdEnabled = VT::simdEnabled };
399 enum :
bool { smpAssignable = VT::smpAssignable };
436 inline ReturnType
at(
size_t index )
const {
437 if( index >=
dv_.size() ) {
440 return (*
this)[index];
453 return dv_.load( index );
462 inline const ElementType*
data() const noexcept {
492 inline size_t size() const noexcept {
513 template<
typename T >
514 inline bool canAlias(
const T* alias )
const noexcept {
515 return dv_.canAlias( alias );
525 template<
typename T >
526 inline bool isAliased(
const T* alias )
const noexcept {
527 return dv_.isAliased( alias );
537 return dv_.isAligned();
547 return dv_.canSMPAssign();
570 template<
typename VT2 >
579 assign( tmp, rhs.
dv_ );
598 template<
typename VT2 >
607 assign( tmp, rhs.
dv_ );
626 template<
typename VT2 >
627 friend inline EnableIf_< UseAssign<VT2> >
628 addAssign( DenseVector<VT2,TF>& lhs,
const DVecTransExpr& rhs )
634 DVecTransposer<VT2,!TF> tmp( ~lhs );
635 addAssign( tmp, rhs.dv_ );
658 template<
typename VT2 >
659 friend inline EnableIf_< UseAssign<VT2> >
660 subAssign( DenseVector<VT2,TF>& lhs,
const DVecTransExpr& rhs )
666 DVecTransposer<VT2,!TF> tmp( ~lhs );
667 subAssign( tmp, rhs.dv_ );
690 template<
typename VT2 >
691 friend inline EnableIf_< UseAssign<VT2> >
692 multAssign( DenseVector<VT2,TF>& lhs,
const DVecTransExpr& rhs )
698 DVecTransposer<VT2,!TF> tmp( ~lhs );
699 multAssign( tmp, rhs.dv_ );
722 template<
typename VT2 >
723 friend inline EnableIf_< UseAssign<VT2> >
724 divAssign( DenseVector<VT2,TF>& lhs,
const DVecTransExpr& rhs )
730 DVecTransposer<VT2,!TF> tmp( ~lhs );
731 divAssign( tmp, rhs.dv_ );
754 template<
typename VT2 >
755 friend inline EnableIf_< UseSMPAssign<VT2> >
762 DVecTransposer<VT2,!TF> tmp( ~lhs );
782 template<
typename VT2 >
783 friend inline EnableIf_< UseSMPAssign<VT2> >
790 SVecTransposer<VT2,!TF> tmp( ~lhs );
810 template<
typename VT2 >
811 friend inline EnableIf_< UseSMPAssign<VT2> >
818 DVecTransposer<VT2,!TF> tmp( ~lhs );
842 template<
typename VT2 >
843 friend inline EnableIf_< UseSMPAssign<VT2> >
850 DVecTransposer<VT2,!TF> tmp( ~lhs );
874 template<
typename VT2 >
875 friend inline EnableIf_< UseSMPAssign<VT2> >
882 DVecTransposer<VT2,!TF> tmp( ~lhs );
906 template<
typename VT2 >
907 friend inline EnableIf_< UseSMPAssign<VT2> >
914 DVecTransposer<VT2,!TF> tmp( ~lhs );
961 template<
typename VT
1000 template<
typename VT
1002 inline typename DVecTransExpr<VT,TF>::Operand
trans(
const DVecTransExpr<VT,TF>& dv )
1006 return dv.operand();
1022 template<
typename VT,
bool TF >
1023 struct Size< DVecTransExpr<VT,TF> > :
public Size<VT>
1039 template<
typename VT,
bool TF >
1040 struct IsAligned< DVecTransExpr<VT,TF> >
1057 template<
typename VT,
bool TF >
1058 struct IsPadded< DVecTransExpr<VT,TF> >
1075 template<
typename VT >
1076 struct DVecTransExprTrait< DVecTransExpr<VT,false> >
1080 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT> >
1081 , Operand_< DVecTransExpr<VT,false> >
1091 template<
typename VT >
1092 struct TDVecTransExprTrait< DVecTransExpr<VT,true> >
1096 using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT> >
1097 , Operand_< DVecTransExpr<VT,true> >
1107 template<
typename VT,
bool TF,
bool AF >
1108 struct SubvectorExprTrait< DVecTransExpr<VT,TF>, AF >
1112 using Type = TransExprTrait_< SubvectorExprTrait_<const VT,AF> >;
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.