35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_ 91 :
public MatTransExpr< DenseMatrix< DMatTransExpr<MT,SO>, SO > >
92 ,
private If< IsComputation_v<MT>, Computation, Transformation >::Type
111 static constexpr
bool useAssign = RequiresEvaluation_v<MT>;
114 template<
typename MT2 >
116 static constexpr
bool UseAssign_v =
useAssign;
128 template<
typename MT2 >
199 if( i >=
dm_.columns() ) {
202 if( j >=
dm_.rows() ) {
221 return dm_.load(j,i);
262 inline size_t rows() const noexcept {
263 return dm_.columns();
283 return dm_.spacing();
293 return dm_.nonZeros();
304 return dm_.nonZeros( i );
324 template<
typename T >
325 inline bool canAlias(
const T* alias )
const noexcept {
326 return dm_.isAliased( alias );
336 template<
typename T >
337 inline bool isAliased(
const T* alias )
const noexcept {
338 return dm_.isAliased( alias );
348 return dm_.isAligned();
358 return dm_.canSMPAssign();
381 template<
typename MT2
392 assign( tmp, rhs.dm_ );
411 template<
typename MT2
430 const TmpType tmp(
serial( rhs ) );
450 template<
typename MT2
452 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
453 -> EnableIf_t< UseAssign_v<MT2> >
460 DMatTransposer<MT2,!SO2> tmp( ~lhs );
461 addAssign( tmp, rhs.dm_ );
484 template<
typename MT2
486 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
487 -> EnableIf_t< UseAssign_v<MT2> >
494 DMatTransposer<MT2,!SO2> tmp( ~lhs );
495 subAssign( tmp, rhs.dm_ );
518 template<
typename MT2
520 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
521 -> EnableIf_t< UseAssign_v<MT2> >
528 DMatTransposer<MT2,!SO2> tmp( ~lhs );
529 schurAssign( tmp, rhs.dm_ );
560 template<
typename MT2
563 -> EnableIf_t< UseSMPAssign_v<MT2> >
570 DMatTransposer<MT2,!SO2> tmp( ~lhs );
590 template<
typename MT2
593 -> EnableIf_t< UseSMPAssign_v<MT2> >
597 using TmpType = If_t< SO == SO2, ResultType, OppositeType >;
609 const TmpType tmp( rhs );
629 template<
typename MT2
632 -> EnableIf_t< UseSMPAssign_v<MT2> >
639 DMatTransposer<MT2,!SO2> tmp( ~lhs );
663 template<
typename MT2
666 -> EnableIf_t< UseSMPAssign_v<MT2> >
673 DMatTransposer<MT2,!SO2> tmp( ~lhs );
698 template<
typename MT2
701 -> EnableIf_t< UseSMPAssign_v<MT2> >
708 DMatTransposer<MT2,!SO2> tmp( ~lhs );
763 template<
typename MT
803 template<
typename MT
805 inline decltype(
auto)
trans( const DMatTransExpr<MT,SO>& dm )
827 template<
typename MT
830 inline decltype(
auto)
trans( const DMatScalarMultExpr<MT,ST,SO>& dm )
834 return trans( dm.leftOperand() ) * dm.rightOperand();
850 template<
typename MT,
bool SO >
851 struct HasConstDataAccess< DMatTransExpr<MT,SO> >
852 :
public HasConstDataAccess<MT>
868 template<
typename MT,
bool SO >
869 struct IsAligned< DMatTransExpr<MT,SO> >
870 :
public IsAligned<MT>
886 template<
typename MT,
bool SO >
887 struct IsPadded< DMatTransExpr<MT,SO> >
888 :
public IsPadded<MT>
Header file for auxiliary alias declarations.
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DMatTransExpr.h:282
Compile time type selection.The If class template selects one of the two given types T1 and T2 depend...
Definition: If.h:59
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTransExpr.h:347
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:90
#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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:224
Header file for the MatTransExpr base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:357
#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
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:138
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatTransExpr.h:230
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
Header file for the Computation base class.
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatTransExpr.h:313
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:272
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:364
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the SIMD trait.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatTransExpr.h:158
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatTransExpr.h:216
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatTransExpr.h:140
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:147
Header file for the If class template.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:252
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:262
TransposeType_t< MT > ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:137
#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.
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:76
Header file for the GetMemberType type trait.
Header file for the IsAligned type trait.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the transposition expression.
Definition: DMatTransExpr.h:111
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatTransExpr.h:325
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatTransExpr.h:163
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:337
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransExpr.h:183
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Header file for the dense matrix transposer.
Header file for the HasConstDataAccess type trait.
DMatTransExpr(const MT &dm) noexcept
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:171
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:96
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
Utility type for generic codes.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
size_t nonZeros() const
Returns the number of non-zero elements in the dense matrix.
Definition: DMatTransExpr.h:292
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:241
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:66
CompositeType_t< MT > CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:97
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:141
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
#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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
Header file for the IsComputation type trait class.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatTransExpr.h:155
ResultType_t< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:139
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:303
System settings for the inline keywords.
If_t< useAssign, const ResultType, const DMatTransExpr &> CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:144
#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
If_t< IsExpression_v< MT >, const MT, const MT &> Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:150
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransExpr.h:198