35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATTRANSEXPR_H_
103 template<
typename MT
107 ,
private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
126 template<
typename MT2 >
129 enum { value = useAssign };
141 template<
typename MT2 >
142 struct UseSMPAssign {
143 enum { value = MT2::smpAssignable && useAssign };
280 inline IntrinsicType
load()
const {
407 enum { vectorizable = MT::vectorizable };
410 enum { smpAssignable = MT::smpAssignable };
445 inline ReturnType
at(
size_t i,
size_t j )
const {
446 if( i >=
dm_.columns() ) {
449 if( j >=
dm_.rows() ) {
469 return dm_.load(j,i);
478 inline const ElementType*
data()
const {
511 return dm_.columns();
531 return dm_.spacing();
541 return dm_.nonZeros();
552 return dm_.nonZeros( i );
572 template<
typename T >
574 return dm_.isAliased( alias );
584 template<
typename T >
586 return dm_.isAliased( alias );
596 return dm_.isAligned();
606 return dm_.canSMPAssign();
629 template<
typename MT2
640 assign( tmp, rhs.
dm_ );
659 template<
typename MT2
678 const TmpType tmp(
serial( rhs ) );
698 template<
typename MT2
700 friend inline typename EnableIf< UseAssign<MT2> >::Type
701 addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
708 DMatTransposer<MT2,!SO2> tmp( ~lhs );
709 addAssign( tmp, rhs.dm_ );
732 template<
typename MT2
734 friend inline typename EnableIf< UseAssign<MT2> >::Type
735 subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatTransExpr& rhs )
742 DMatTransposer<MT2,!SO2> tmp( ~lhs );
743 subAssign( tmp, rhs.dm_ );
774 template<
typename MT2
776 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
784 DMatTransposer<MT2,!SO2> tmp( ~lhs );
804 template<
typename MT2
806 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
811 typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
823 const TmpType tmp( rhs );
843 template<
typename MT2
845 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
853 DMatTransposer<MT2,!SO2> tmp( ~lhs );
877 template<
typename MT2
879 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
887 DMatTransposer<MT2,!SO2> tmp( ~lhs );
942 template<
typename MT
981 template<
typename MT
983 inline typename DMatTransExpr<MT,SO>::Operand
trans(
const DMatTransExpr<MT,SO>& dm )
1003 template<
typename MT,
bool SO >
1004 struct Rows< DMatTransExpr<MT,SO> > :
public Columns<MT>
1020 template<
typename MT,
bool SO >
1021 struct Columns< DMatTransExpr<MT,SO> > :
public Rows<MT>
1037 template<
typename MT,
bool SO >
1038 struct IsAligned< DMatTransExpr<MT,SO> > :
public IsTrue< IsAligned<MT>::value >
1054 template<
typename MT,
bool SO >
1055 struct IsPadded< DMatTransExpr<MT,SO> > :
public IsTrue< IsPadded<MT>::value >
1071 template<
typename MT,
bool SO >
1072 struct IsSymmetric< DMatTransExpr<MT,SO> > :
public IsTrue< IsSymmetric<MT>::value >
1088 template<
typename MT,
bool SO >
1089 struct IsHermitian< DMatTransExpr<MT,SO> > :
public IsTrue< IsHermitian<MT>::value >
1105 template<
typename MT,
bool SO >
1106 struct IsLower< DMatTransExpr<MT,SO> > :
public IsTrue< IsUpper<MT>::value >
1122 template<
typename MT,
bool SO >
1123 struct IsUniLower< DMatTransExpr<MT,SO> > :
public IsTrue< IsUniUpper<MT>::value >
1139 template<
typename MT,
bool SO >
1140 struct IsStrictlyLower< DMatTransExpr<MT,SO> > :
public IsTrue< IsStrictlyUpper<MT>::value >
1156 template<
typename MT,
bool SO >
1157 struct IsUpper< DMatTransExpr<MT,SO> > :
public IsTrue< IsLower<MT>::value >
1173 template<
typename MT,
bool SO >
1174 struct IsUniUpper< DMatTransExpr<MT,SO> > :
public IsTrue< IsUniLower<MT>::value >
1190 template<
typename MT,
bool SO >
1191 struct IsStrictlyUpper< DMatTransExpr<MT,SO> > :
public IsTrue< IsStrictlyLower<MT>::value >
1207 template<
typename MT >
1208 struct DMatTransExprTrait< DMatTransExpr<MT,false> >
1212 typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1213 ,
typename DMatTransExpr<MT,false>::Operand
1214 , INVALID_TYPE >::Type Type;
1223 template<
typename MT >
1224 struct TDMatTransExprTrait< DMatTransExpr<MT,true> >
1228 typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1229 ,
typename DMatTransExpr<MT,true>::Operand
1230 , INVALID_TYPE >::Type Type;
1239 template<
typename MT,
bool SO,
bool AF >
1240 struct SubmatrixExprTrait< DMatTransExpr<MT,SO>, AF >
1244 typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1253 template<
typename MT,
bool SO >
1254 struct RowExprTrait< DMatTransExpr<MT,SO> >
1258 typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1267 template<
typename MT,
bool SO >
1268 struct ColumnExprTrait< DMatTransExpr<MT,SO> >
1272 typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
Pointer difference type of the Blaze library.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatTransExpr.h:217
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatTransExpr.h:228
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DMatTransExpr.h:179
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
DMatTransExpr(const MT &dm)
Constructor for the DMatTransExpr class.
Definition: DMatTransExpr.h:418
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatTransExpr.h:205
SelectType< useAssign, const ResultType, const DMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatTransExpr.h:159
Expression object for dense matrix transpositions.The DMatTransExpr class represents the compile time...
Definition: DMatTransExpr.h:105
#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:81
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
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:79
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:381
Header file for the IsColumnMajorMatrix type trait.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatTransExpr.h:152
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatTransExpr.h:186
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatTransExpr.h:595
Header file for the RequiresEvaluation type trait.
Operand dm_
Dense matrix of the transposition expression.
Definition: DMatTransExpr.h:612
Operand operand() const
Returns the dense matrix operand.
Definition: DMatTransExpr.h:561
Header file for the IsUniLower type trait.
ReferenceType reference
Reference return type.
Definition: DMatTransExpr.h:182
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatTransExpr.h:489
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:117
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DMatTransExpr.h:151
Constraint on the data type.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatTransExpr.h:260
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatTransExpr.h:445
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatTransExpr.h:463
Constraint on the data type.
MT::ElementType ElementType
Resulting element type.
Definition: DMatTransExpr.h:154
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatTransExpr.h:280
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:369
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatTransExpr.h:585
ValueType value_type
Type of the underlying elements.
Definition: DMatTransExpr.h:180
ConstIterator(IteratorType iterator)
Constructor for the ConstIterator class.
Definition: DMatTransExpr.h:194
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
PointerType pointer
Pointer return type.
Definition: DMatTransExpr.h:181
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
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatTransExpr.h:176
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:302
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatTransExpr.h:162
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
IteratorType iterator_
Iterator to the current element.
Definition: DMatTransExpr.h:400
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:79
Header file for the TDMatTransExprTrait class template.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatTransExpr.h:155
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatTransExpr.h:111
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DMatTransExpr.h:153
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatTransExpr.h:249
#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:78
const ElementType * data() const
Low-level data access to the matrix elements.
Definition: DMatTransExpr.h:478
DifferenceType difference_type
Difference between two iterators.
Definition: DMatTransExpr.h:183
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the SelectType class template.
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:346
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
Header file for the serial shim.
ElementType * PointerType
Pointer return type.
Definition: DMatTransExpr.h:174
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatTransExpr.h:357
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatTransExpr.h:393
Header file for the dense matrix transposer.
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
size_t spacing() const
Returns the spacing between the beginning of two rows/columns.
Definition: DMatTransExpr.h:530
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
ElementType ValueType
Type of the underlying elements.
Definition: DMatTransExpr.h:173
Utility type for generic codes.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatTransExpr.h:510
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatTransExpr.h:520
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:291
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatTransExpr.h:430
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatTransExpr.h:500
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatTransExpr.h:239
#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:122
ElementType & ReferenceType
Reference return type.
Definition: DMatTransExpr.h:175
Iterator over the elements of the dense matrix.
Definition: DMatTransExpr.h:168
Header file for the IsRowMajorMatrix type trait.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatTransExpr.h:270
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
Header file for the IsComputation type trait class.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatTransExpr.h:172
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:335
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatTransExpr.h:112
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
size_t nonZeros() const
Returns the number of non-zero elements in the dense matrix.
Definition: DMatTransExpr.h:540
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatTransExpr.h:605
Header file for the IsUpper type trait.
Header file for exception macros.
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DMatTransExpr.h:156
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row/column.
Definition: DMatTransExpr.h:551
Header file for the empty type.
DMatTransExpr< MT, SO > This
Type of this DMatTransExpr instance.
Definition: DMatTransExpr.h:150
Header file for the IsHermitian type trait.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:324
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 canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatTransExpr.h:573
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatTransExpr.h:313
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.