35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATTRANSEXPR_H_
86 class SMatTransExpr :
public SparseMatrix< SMatTransExpr<MT,SO>, SO >
87 ,
private MatTransExpr
88 ,
private SelectType< IsComputation<MT>::value, Computation, EmptyType >::Type
107 template<
typename MT2 >
110 enum { value = useAssign };
122 template<
typename MT2 >
123 struct UseSMPAssign {
124 enum { value = MT2::smpAssignable && useAssign };
156 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
157 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
158 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
159 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
270 enum { smpAssignable = MT::smpAssignable };
325 return sm_.columns();
345 return sm_.nonZeros();
365 template<
typename T >
367 return sm_.canAlias( alias );
377 template<
typename T >
379 return sm_.isAliased( alias );
389 return sm_.canSMPAssign();
412 template<
typename MT2
442 template<
typename MT2
472 template<
typename MT2
474 friend inline typename EnableIf< UseAssign<MT2> >::Type
482 DMatTransposer<MT2,!SO2> tmp( ~lhs );
506 template<
typename MT2
508 friend inline typename EnableIf< UseAssign<MT2> >::Type
516 DMatTransposer<MT2,!SO2> tmp( ~lhs );
548 template<
typename MT2
550 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
558 DMatTransposer<MT2,!SO2> tmp( ~lhs );
578 template<
typename MT2
580 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
588 SMatTransposer<MT2,!SO2> tmp( ~lhs );
608 template<
typename MT2
610 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
618 DMatTransposer<MT2,!SO2> tmp( ~lhs );
643 template<
typename MT2
645 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
653 DMatTransposer<MT2,!SO2> tmp( ~lhs );
687 template<
typename MT2
689 friend inline Operand trans(
const SMatTransExpr<MT2,SO2>& sm )
731 template<
typename MT
752 template<
typename MT,
bool SO,
bool AF >
753 struct SubmatrixExprTrait< SMatTransExpr<MT,SO>, AF >
757 typedef typename TransExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
766 template<
typename MT,
bool SO >
767 struct RowExprTrait< SMatTransExpr<MT,SO> >
771 typedef typename TransExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
780 template<
typename MT,
bool SO >
781 struct ColumnExprTrait< SMatTransExpr<MT,SO> >
785 typedef typename TransExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
Header file for the sparse matrix transposer.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:245
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatTransExpr.h:153
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatTransExpr.h:133
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SMatTransExpr.h:303
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
PointerType pointer
Pointer return type.
Definition: SMatTransExpr.h:164
#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:242
Header file for the MatTransExpr base class.
Iterator over the elements of the sparse matrix transposition expression.
Definition: SMatTransExpr.h:148
Header file for the ColumnExprTrait class template.
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatTransExpr.h:93
Operand sm_
Sparse matrix of the transposition expression.
Definition: SMatTransExpr.h:395
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatTransExpr.h:256
Header file for the Computation base class.
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatTransExpr.h:92
Header file for the RequiresEvaluation type trait.
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying pointers.
Definition: SMatTransExpr.h:156
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2404
ReferenceType reference
Reference return type.
Definition: SMatTransExpr.h:165
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:107
Constraint on the data type.
Header file for the SparseMatrix base class.
Constraint on the data type.
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: SMatTransExpr.h:159
void smpAddAssign(DenseMatrix< 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:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
MT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: SMatTransExpr.h:134
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SMatTransExpr.h:136
MT::TransposeType ResultType
Result type for expression template evaluations.
Definition: SMatTransExpr.h:132
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: SMatTransExpr.h:158
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatTransExpr.h:366
SMatTransExpr(const MT &sm)
Constructor for the SMatTransExpr class.
Definition: SMatTransExpr.h:278
IteratorType it_
Iterator over the elements of the sparse matrix expression.
Definition: SMatTransExpr.h:263
MT::ElementType ElementType
Resulting element type.
Definition: SMatTransExpr.h:135
IteratorCategory iterator_category
The iterator category.
Definition: SMatTransExpr.h:162
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:271
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatTransExpr.h:334
Expression object for the transposition of a dense matrix.The DMatTransposer class is a wrapper objec...
Definition: DMatTransposer.h:71
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SMatTransExpr.h:172
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2405
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the dense matrix transposer.
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
const IteratorType operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:203
Expression object for the transposition of a sparse matrix.The SMatTransposer class is a wrapper obje...
Definition: Forward.h:103
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatTransExpr.h:290
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatTransExpr.h:142
Header file for run time assertion macros.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatTransExpr.h:388
SelectType< useAssign, const ResultType, const SMatTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatTransExpr.h:139
SMatTransExpr< MT, SO > This
Type of this SMatTransExpr instance.
Definition: SMatTransExpr.h:131
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:301
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:331
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: SMatTransExpr.h:157
Header file for the TransExprTrait class template.
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatTransExpr.h:354
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatTransExpr.h:344
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatTransExpr.h:324
Header file for the RemoveReference type trait.
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatTransExpr.h:155
DifferenceType difference_type
Difference between two iterators.
Definition: SMatTransExpr.h:166
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatTransExpr.h:213
size_t index() const
Access to the current index of the sparse element.
Definition: SMatTransExpr.h:223
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatTransExpr.h:234
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:907
Header file for the IsComputation type trait class.
#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
Expression object for sparse matrix transpositions.The SMatTransExpr class represents the compile tim...
Definition: Forward.h:102
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SMatTransExpr.h:314
Header file for basic type definitions.
const ValueType operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatTransExpr.h:193
ValueType value_type
Type of the underlying pointers.
Definition: SMatTransExpr.h:163
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatTransExpr.h:182
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatTransExpr.h:378
Header file for the empty type.
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.