35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECREALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECREALEXPR_H_
131 template<
typename VT2 >
134 enum { value = useAssign };
147 template<
typename VT2 >
148 struct UseSMPAssign {
149 enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
288 return it_ == rhs.
it_;
299 return it_ != rhs.
it_;
310 return it_ < rhs.
it_;
321 return it_ > rhs.
it_;
332 return it_ <= rhs.
it_;
343 return it_ >= rhs.
it_;
354 return it_ - rhs.
it_;
403 enum { vectorizable = 0 };
406 enum { smpAssignable = VT::smpAssignable };
438 inline ReturnType
at(
size_t index )
const {
439 if( index >=
dv_.size() ) {
442 return (*
this)[index];
492 template<
typename T >
504 template<
typename T >
506 return dv_.isAliased( alias );
516 return dv_.isAligned();
526 return dv_.canSMPAssign();
549 template<
typename VT2 >
562 assign( ~lhs,
real( tmp ) );
581 template<
typename VT2 >
594 assign( ~lhs,
real( tmp ) );
613 template<
typename VT2 >
614 friend inline typename EnableIf< UseAssign<VT2> >::Type
615 addAssign( DenseVector<VT2,TF>& lhs,
const DVecRealExpr& rhs )
625 const RT tmp(
serial( rhs.dv_ ) );
626 addAssign( ~lhs,
real( tmp ) );
649 template<
typename VT2 >
650 friend inline typename EnableIf< UseAssign<VT2> >::Type
651 subAssign( DenseVector<VT2,TF>& lhs,
const DVecRealExpr& rhs )
661 const RT tmp(
serial( rhs.dv_ ) );
662 subAssign( ~lhs,
real( tmp ) );
685 template<
typename VT2 >
686 friend inline typename EnableIf< UseAssign<VT2> >::Type
687 multAssign( DenseVector<VT2,TF>& lhs,
const DVecRealExpr& rhs )
697 const RT tmp(
serial( rhs.dv_ ) );
698 multAssign( ~lhs,
real( tmp ) );
722 template<
typename VT2 >
723 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
734 const RT tmp( rhs.dv_ );
754 template<
typename VT2 >
755 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
766 const RT tmp( rhs.dv_ );
786 template<
typename VT2 >
787 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
798 const RT tmp( rhs.dv_ );
822 template<
typename VT2 >
823 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
834 const RT tmp( rhs.dv_ );
858 template<
typename VT2 >
859 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
870 const RT tmp( rhs.dv_ );
916 template<
typename VT
946 template<
typename VT
948 inline const DVecRealExpr<VT,TF>&
real(
const DVecRealExpr<VT,TF>& dv )
968 template<
typename VT,
bool TF >
985 template<
typename VT,
bool TF >
986 struct IsAligned<
DVecRealExpr<VT,TF> > :
public IsTrue< IsAligned<VT>::value >
1002 template<
typename VT >
1007 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
1008 , DVecRealExpr<VT,false>
1009 , INVALID_TYPE >::Type Type;
1018 template<
typename VT >
1023 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1024 , DVecRealExpr<VT,true>
1025 , INVALID_TYPE >::Type Type;
1034 template<
typename VT,
bool TF,
bool AF >
1039 typedef typename RealExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
ElementType & ReferenceType
Reference return type.
Definition: DVecRealExpr.h:181
RealTrait< RT >::Type ResultType
Result type for expression template evaluations.
Definition: DVecRealExpr.h:157
RealExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecRealExpr.h:117
DifferenceType difference_type
Difference between two iterators.
Definition: DVecRealExpr.h:189
Header file for the UnderlyingNumeric type trait.
Pointer difference type of the Blaze library.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecRealExpr.h:505
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Header file for the VecRealExpr base class.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecRealExpr.h:461
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecRealExpr.h:192
Header file for basic type definitions.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecRealExpr.h:178
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecRealExpr.h:104
Iterator over the elements of the dense vector.
Definition: DVecRealExpr.h:174
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:309
Header file for the DVecRealExprTrait class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the DenseVector base class.
Header file for the TDVecRealExprTrait class template.
DVecRealExpr< VT, TF > This
Type of this DVecRealExpr instance.
Definition: DVecRealExpr.h:156
Header file for the RealExprTrait class template.
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.
Expression object for the dense vector real() function.The DVecRealExpr class represents the compile ...
Definition: DVecRealExpr.h:97
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecRealExpr.h:162
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecRealExpr.h:223
PointerType pointer
Pointer return type.
Definition: DVecRealExpr.h:187
Header file for the RequiresEvaluation type trait.
DVecRealExpr(const VT &dv)
Constructor for the DVecRealExpr class.
Definition: DVecRealExpr.h:414
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecRealExpr.h:245
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecRealExpr.h:377
Constraint on the data type.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecRealExpr.h:389
ValueType value_type
Type of the underlying elements.
Definition: DVecRealExpr.h:186
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecRealExpr.h:211
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
Operand operand() const
Returns the dense vector operand.
Definition: DVecRealExpr.h:481
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecRealExpr.h:438
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecRealExpr.h:515
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecRealExpr.h:266
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecRealExpr.h:525
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.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Base class for all vector real part expression templates.The VecRealExpr class serves as a tag for al...
Definition: VecRealExpr.h:65
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecRealExpr.h:200
#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
Operand dv_
Dense vector of the real part expression.
Definition: DVecRealExpr.h:532
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
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecRealExpr.h:425
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:298
Header file for the IsAligned type trait.
ElementType * PointerType
Pointer return type.
Definition: DVecRealExpr.h:180
Constraint on the data type.
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
Header file for the real shim.
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecRealExpr.h:158
Header file for the EnableIf class template.
Header file for the serial shim.
IteratorType it_
Iterator to the current vector element.
Definition: DVecRealExpr.h:396
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecRealExpr.h:365
ReferenceType reference
Reference return type.
Definition: DVecRealExpr.h:188
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
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.
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecRealExpr.h:159
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecRealExpr.h:182
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecRealExpr.h:234
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
SelectType< useAssign, const ResultType, const DVecRealExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecRealExpr.h:165
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecRealExpr.h:493
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecRealExpr.h:451
#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
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecRealExpr.h:255
Header file for the IsDenseVector type trait.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecRealExpr.h:168
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:342
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:320
Header file for the IsComputation type trait class.
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
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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 SubvectorExprTrait class template.
Header file for exception macros.
Header file for the IsColumnVector type trait.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:331
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecRealExpr.h:276
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:287
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:81
#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.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecRealExpr.h:353
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecRealExpr.h:103
IteratorCategory iterator_category
The iterator category.
Definition: DVecRealExpr.h:185
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecRealExpr.h:471
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ElementType ValueType
Type of the underlying elements.
Definition: DVecRealExpr.h:179