35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATREALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATREALEXPR_H_
107 template<
typename MT
144 template<
typename MT2 >
147 enum { value = useAssign };
160 template<
typename MT2 >
161 struct UseSMPAssign {
162 enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
302 return it_ == rhs.
it_;
313 return it_ != rhs.
it_;
324 return it_ < rhs.
it_;
335 return it_ > rhs.
it_;
346 return it_ <= rhs.
it_;
357 return it_ >= rhs.
it_;
368 return it_ - rhs.
it_;
417 enum { vectorizable = 0 };
420 enum { smpAssignable = MT::smpAssignable };
455 inline ReturnType
at(
size_t i,
size_t j )
const {
456 if( i >=
dm_.rows() ) {
459 if( j >=
dm_.columns() ) {
504 return dm_.columns();
524 template<
typename T >
536 template<
typename T >
538 return dm_.isAliased( alias );
548 return dm_.isAligned();
558 return dm_.canSMPAssign();
581 template<
typename MT2
596 assign( ~lhs,
real( tmp ) );
615 template<
typename MT2
635 assign( ~lhs,
real( tmp ) );
654 template<
typename MT2
656 friend inline typename EnableIf< UseAssign<MT2> >::Type
657 addAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatRealExpr& rhs )
668 const RT tmp(
serial( rhs.dm_ ) );
669 addAssign( ~lhs,
real( tmp ) );
692 template<
typename MT2
694 friend inline typename EnableIf< UseAssign<MT2> >::Type
695 subAssign( DenseMatrix<MT2,SO2>& lhs,
const DMatRealExpr& rhs )
706 const RT tmp(
serial( rhs.dm_ ) );
707 subAssign( ~lhs,
real( tmp ) );
739 template<
typename MT2
741 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
753 const RT tmp( rhs.dm_ );
773 template<
typename MT2
775 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
780 typedef typename SelectType< SO == SO2, RT, OT >::Type TmpType;
792 const TmpType tmp( rhs.dm_ );
812 template<
typename MT2
814 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
826 const RT tmp( rhs.dm_ );
850 template<
typename MT2
852 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
864 const RT tmp( rhs.dm_ );
918 template<
typename MT
948 template<
typename MT
950 inline const DMatRealExpr<MT,SO>&
real(
const DMatRealExpr<MT,SO>& dm )
970 template<
typename MT,
bool SO >
987 template<
typename MT,
bool SO >
988 struct Columns<
DMatRealExpr<MT,SO> > :
public Columns<MT>
1004 template<
typename MT,
bool SO >
1005 struct IsAligned<
DMatRealExpr<MT,SO> > :
public IsTrue< IsAligned<MT>::value >
1021 template<
typename MT,
bool SO >
1022 struct IsSymmetric<
DMatRealExpr<MT,SO> > :
public IsTrue< IsSymmetric<MT>::value >
1038 template<
typename MT,
bool SO >
1039 struct IsHermitian<
DMatRealExpr<MT,SO> > :
public IsTrue< IsHermitian<MT>::value >
1055 template<
typename MT,
bool SO >
1056 struct IsLower<
DMatRealExpr<MT,SO> > :
public IsTrue< IsLower<MT>::value >
1072 template<
typename MT,
bool SO >
1073 struct IsUniLower<
DMatRealExpr<MT,SO> > :
public IsTrue< IsUniLower<MT>::value >
1089 template<
typename MT,
bool SO >
1090 struct IsStrictlyLower<
DMatRealExpr<MT,SO> > :
public IsTrue< IsStrictlyLower<MT>::value >
1106 template<
typename MT,
bool SO >
1107 struct IsUpper<
DMatRealExpr<MT,SO> > :
public IsTrue< IsUpper<MT>::value >
1123 template<
typename MT,
bool SO >
1124 struct IsUniUpper<
DMatRealExpr<MT,SO> > :
public IsTrue< IsUniUpper<MT>::value >
1140 template<
typename MT,
bool SO >
1141 struct IsStrictlyUpper<
DMatRealExpr<MT,SO> > :
public IsTrue< IsStrictlyUpper<MT>::value >
1157 template<
typename MT >
1162 typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1163 , DMatRealExpr<MT,false>
1164 , INVALID_TYPE >::Type Type;
1173 template<
typename MT >
1178 typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1179 , DMatRealExpr<MT,true>
1180 , INVALID_TYPE >::Type Type;
1189 template<
typename MT,
bool SO,
bool AF >
1194 typedef typename RealExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1203 template<
typename MT,
bool SO >
1208 typedef typename RealExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1217 template<
typename MT,
bool SO >
1222 typedef typename RealExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
RealExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatRealExpr.h:130
Header file for the UnderlyingNumeric type trait.
Pointer difference type of the Blaze library.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatRealExpr.h:455
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
ElementType & ReferenceType
Reference return type.
Definition: DMatRealExpr.h:195
Header file for basic type definitions.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatRealExpr.h:440
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatRealExpr.h:172
#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
#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
PointerType pointer
Pointer return type.
Definition: DMatRealExpr.h:201
MT::OppositeType OT
Opposite type of the dense matrix expression.
Definition: DMatRealExpr.h:116
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatRealExpr.h:472
Header file for the RealExprTrait class template.
Header file for the MatRealExpr base class.
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.
Header file for the RequiresEvaluation type trait.
DMatRealExpr< MT, SO > This
Type of this DMatRealExpr instance.
Definition: DMatRealExpr.h:169
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
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
Constraint on the data type.
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatRealExpr.h:248
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:323
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:90
ValueType value_type
Type of the underlying elements.
Definition: DMatRealExpr.h:200
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:334
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatRealExpr.h:192
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
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
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatRealExpr.h:280
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:345
#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.
DMatRealExpr(const MT &dm)
Constructor for the DMatRealExpr class.
Definition: DMatRealExpr.h:428
const RealExprTrait< MT >::Type real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatRealExpr.h:920
ReferenceType reference
Reference return type.
Definition: DMatRealExpr.h:202
Base class for all matrix real part expression templates.The MatRealExpr class serves as a tag for al...
Definition: MatRealExpr.h:65
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatRealExpr.h:403
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Header file for the real trait.
#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
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DMatRealExpr.h:214
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatRealExpr.h:367
Constraints on the storage order of matrix types.
Header file for the real shim.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:356
IteratorType it_
Iterator to the current matrix element.
Definition: DMatRealExpr.h:410
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 canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatRealExpr.h:557
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Operand dm_
Dense matrix of the real part expression.
Definition: DMatRealExpr.h:564
Header file for the DMatRealExprTrait class template.
Header file for the serial shim.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatRealExpr.h:269
Header file for the TDMatRealExprTrait class template.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatRealExpr.h:503
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
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatRealExpr.h:115
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
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
Utility type for generic codes.
Expression object for the dense matrix real() function.The DMatRealExpr class represents the compile ...
Definition: DMatRealExpr.h:109
Base template for the RealTrait class.The RealTrait class template offers the possibility to select t...
Definition: RealTrait.h:78
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:301
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatRealExpr.h:312
ResultType::ElementType ElementType
Resulting element type.
Definition: DMatRealExpr.h:173
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatRealExpr.h:117
#define BLAZE_CONSTRAINT_MUST_NOT_BE_BUILTIN_TYPE(T)
Constraint on the data type.In case the given data type T is a built-in data type, a compilation error is created.
Definition: Builtin.h:116
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatRealExpr.h:391
ElementType ValueType
Type of the underlying elements.
Definition: DMatRealExpr.h:193
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatRealExpr.h:290
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatRealExpr.h:196
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatRealExpr.h:525
RealTrait< RT >::Type ResultType
Result type for expression template evaluations.
Definition: DMatRealExpr.h:170
ElementType * PointerType
Pointer return type.
Definition: DMatRealExpr.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:122
Header file for the IsDenseVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DMatRealExpr.h:199
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatRealExpr.h:182
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatRealExpr.h:379
Operand operand() const
Returns the dense matrix operand.
Definition: DMatRealExpr.h:513
Header file for the IsRowMajorMatrix type trait.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatRealExpr.h:171
Header file for the IsComputation type trait class.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatRealExpr.h:259
Evaluation of the return type of a real part expression.Via this type trait it is possible to evaluat...
Definition: RealExprTrait.h:88
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
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
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatRealExpr.h:206
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatRealExpr.h:237
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatRealExpr.h:176
#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.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatRealExpr.h:547
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatRealExpr.h:493
Header file for the IsUpper type trait.
Header file for exception macros.
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatRealExpr.h:483
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatRealExpr.h:537
Iterator over the elements of the dense matrix.
Definition: DMatRealExpr.h:188
Header file for the IsHermitian type trait.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatRealExpr.h:225
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
Constraint on the data type.
SelectType< useAssign, const ResultType, const DMatRealExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatRealExpr.h:179
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatRealExpr.h:203