35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
106 template<
typename MT
110 ,
private If< IsComputation<MT>, Computation, EmptyType >::Type
129 template<
typename MT2 >
132 enum :
bool { value = useAssign };
144 template<
typename MT2 >
145 struct UseSMPAssign {
146 enum :
bool { value = MT2::smpAssignable && useAssign };
282 inline auto load() const noexcept {
409 enum :
bool { simdEnabled = MT::simdEnabled };
412 enum :
bool { smpAssignable = MT::smpAssignable };
452 inline ReturnType
at(
size_t i,
size_t j )
const {
453 if( i >=
dm_.columns() ) {
456 if( j >=
dm_.rows() ) {
475 return dm_.load(j,i);
484 inline const ElementType*
data() const noexcept {
516 inline size_t rows() const noexcept {
517 return dm_.columns();
537 return dm_.spacing();
547 return dm_.nonZeros();
558 return dm_.nonZeros( i );
578 template<
typename T >
579 inline bool canAlias(
const T* alias )
const noexcept {
580 return dm_.isAliased( alias );
590 template<
typename T >
591 inline bool isAliased(
const T* alias )
const noexcept {
592 return dm_.isAliased( alias );
602 return dm_.isAligned();
612 return dm_.canSMPAssign();
635 template<
typename MT2
646 assign( tmp, rhs.
dm_ );
665 template<
typename MT2
684 const TmpType tmp(
serial( rhs ) );
704 template<
typename MT2
706 friend inline EnableIf_< UseAssign<MT2> >
707 addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
714 DMatTransposer<MT2,!SO2> tmp( ~lhs );
715 addAssign( tmp, rhs.dm_ );
738 template<
typename MT2
740 friend inline EnableIf_< UseAssign<MT2> >
741 subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
748 DMatTransposer<MT2,!SO2> tmp( ~lhs );
749 subAssign( tmp, rhs.dm_ );
780 template<
typename MT2
782 friend inline EnableIf_< UseSMPAssign<MT2> >
790 DMatTransposer<MT2,!SO2> tmp( ~lhs );
810 template<
typename MT2
812 friend inline EnableIf_< UseSMPAssign<MT2> >
817 typedef IfTrue_< SO == SO2, ResultType, OppositeType > TmpType;
829 const TmpType tmp( rhs );
849 template<
typename MT2
851 friend inline EnableIf_< UseSMPAssign<MT2> >
859 DMatTransposer<MT2,!SO2> tmp( ~lhs );
883 template<
typename MT2
885 friend inline EnableIf_< UseSMPAssign<MT2> >
893 DMatTransposer<MT2,!SO2> tmp( ~lhs );
948 template<
typename MT
987 template<
typename MT
989 inline typename DMatTransExpr<MT,SO>::Operand
trans(
const DMatTransExpr<MT,SO>& dm )
1009 template<
typename MT,
bool SO >
1010 struct Rows< DMatTransExpr<MT,SO> > :
public Columns<MT>
1026 template<
typename MT,
bool SO >
1027 struct Columns< DMatTransExpr<MT,SO> > :
public Rows<MT>
1043 template<
typename MT,
bool SO >
1044 struct IsAligned< DMatTransExpr<MT,SO> >
1061 template<
typename MT,
bool SO >
1062 struct IsPadded< DMatTransExpr<MT,SO> >
1079 template<
typename MT,
bool SO >
1080 struct IsSymmetric< DMatTransExpr<MT,SO> >
1097 template<
typename MT,
bool SO >
1098 struct IsHermitian< DMatTransExpr<MT,SO> >
1115 template<
typename MT,
bool SO >
1116 struct IsLower< DMatTransExpr<MT,SO> >
1133 template<
typename MT,
bool SO >
1134 struct IsUniLower< DMatTransExpr<MT,SO> >
1151 template<
typename MT,
bool SO >
1152 struct IsStrictlyLower< DMatTransExpr<MT,SO> >
1169 template<
typename MT,
bool SO >
1170 struct IsUpper< DMatTransExpr<MT,SO> >
1187 template<
typename MT,
bool SO >
1188 struct IsUniUpper< DMatTransExpr<MT,SO> >
1205 template<
typename MT,
bool SO >
1206 struct IsStrictlyUpper< DMatTransExpr<MT,SO> >
1223 template<
typename MT >
1224 struct DMatTransExprTrait< DMatTransExpr<MT,false> >
1228 using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT> >
1229 , Operand_< DMatTransExpr<MT,false> >
1239 template<
typename MT >
1240 struct TDMatTransExprTrait< DMatTransExpr<MT,true> >
1244 using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT> >
1245 , Operand_< DMatTransExpr<MT,true> >
1255 template<
typename MT,
bool SO,
bool AF >
1256 struct SubmatrixExprTrait< DMatTransExpr<MT,SO>, AF >
1260 using Type = TransExprTrait_< SubmatrixExprTrait_<const MT,AF> >;
1269 template<
typename MT,
bool SO >
1270 struct RowExprTrait< DMatTransExpr<MT,SO> >
1274 using Type = TransExprTrait_< ColumnExprTrait_<const MT> >;
1283 template<
typename MT,
bool SO >
1284 struct ColumnExprTrait< DMatTransExpr<MT,SO> >
1288 using Type = TransExprTrait_< RowExprTrait_<const MT> >;
Pointer difference type of the Blaze library.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatTransExpr.h:219
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatTransExpr.h:567
Header file for auxiliary alias declarations.
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatTransExpr.h:230
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:132
IteratorCategory iterator_category
The iterator category.
Definition: DMatTransExpr.h:181
Header file for basic type definitions.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatTransExpr.h:207
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:611
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
Header file for the serial shim.
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:108
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTransExpr.h:579
Header file for the MatTransExpr base class.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Header file for the ColumnExprTrait class template.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatTransExpr.h:383
Header file for the IsColumnMajorMatrix type trait.
Header file for the And class template.
ResultType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:156
If_< IsExpression< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:164
TransposeType_< MT > ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:154
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:158
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:618
Header file for the IsUniLower 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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:591
ReferenceType reference
Reference return type.
Definition: DMatTransExpr.h:184
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:495
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
Constraint on the data type.
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
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatTransExpr.h:262
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransExpr.h:452
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Constraint on the data type.
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
Header file for the DMatTransExprTrait class template.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:371
ValueType value_type
Type of the underlying elements.
Definition: DMatTransExpr.h:182
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DMatTransExpr.h:196
ResultType_< MT > RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:114
PointerType pointer
Pointer return type.
Definition: DMatTransExpr.h:183
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
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.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatTransExpr.h:178
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:304
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
IfTrue_< useAssign, const ResultType, const DMatTransExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:161
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
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
IteratorType iterator_
Iterator to the current element.
Definition: DMatTransExpr.h:402
ElementType_< MT > ElementType
Resulting element type.
Definition: DMatTransExpr.h:157
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 dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:80
Header file for the TDMatTransExprTrait class template.
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatTransExpr.h:470
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatTransExpr.h:251
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
DifferenceType difference_type
Difference between two iterators.
Definition: DMatTransExpr.h:185
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:348
Header file for the IsDenseMatrix type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:526
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
CompositeType_< MT > CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:115
ElementType * PointerType
Pointer return type.
Definition: DMatTransExpr.h:176
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatTransExpr.h:359
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:395
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatTransExpr.h:484
Header file for the dense matrix transposer.
DMatTransExpr(const MT &dm) noexcept
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:425
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTransExpr.h:601
Header file for the SubmatrixExprTrait class template.
Header file for run time assertion macros.
ElementType ValueType
Type of the underlying elements.
Definition: DMatTransExpr.h:175
Utility type for generic codes.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:293
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
ConstIterator_< MT > IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatTransExpr.h:188
Header file for the TransExprTrait class template.
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:65
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransExpr.h:437
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:506
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-increment operator.
Definition: DMatTransExpr.h:241
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DMatTransExpr.h:536
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
ElementType & ReferenceType
Reference return type.
Definition: DMatTransExpr.h:177
auto load() const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatTransExpr.h:282
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:170
Header file for the IsRowMajorMatrix type trait.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatTransExpr.h:272
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.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatTransExpr.h:174
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:337
#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
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:155
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:516
Header file for the IntegralConstant class template.
size_t nonZeros() const
Returns the number of non-zero elements in the dense matrix.
Definition: DMatTransExpr.h:546
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:557
Header file for the empty type.
DMatTransExpr< MT, SO > This
Type of this DMatTransExpr instance.
Definition: DMatTransExpr.h:153
Header file for the IsHermitian type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:326
System settings for the inline keywords.
#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
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:315
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.