35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECIMAGEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECIMAGEXPR_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,
imag( tmp ) );
581 template<
typename VT2 >
594 assign( ~lhs,
imag( tmp ) );
613 template<
typename VT2 >
614 friend inline typename EnableIf< UseAssign<VT2> >::Type
615 addAssign( DenseVector<VT2,TF>& lhs,
const DVecImagExpr& rhs )
625 const RT tmp(
serial( rhs.dv_ ) );
626 addAssign( ~lhs,
imag( tmp ) );
649 template<
typename VT2 >
650 friend inline typename EnableIf< UseAssign<VT2> >::Type
651 subAssign( DenseVector<VT2,TF>& lhs,
const DVecImagExpr& rhs )
661 const RT tmp(
serial( rhs.dv_ ) );
662 subAssign( ~lhs,
imag( tmp ) );
685 template<
typename VT2 >
686 friend inline typename EnableIf< UseAssign<VT2> >::Type
687 multAssign( DenseVector<VT2,TF>& lhs,
const DVecImagExpr& rhs )
697 const RT tmp(
serial( rhs.dv_ ) );
698 multAssign( ~lhs,
imag( 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 DVecImagExpr<VT,TF>&
imag(
const DVecImagExpr<VT,TF>& dv )
968 template<
typename VT,
bool TF >
985 template<
typename VT,
bool TF >
986 struct IsAligned<
DVecImagExpr<VT,TF> > :
public IsTrue< IsAligned<VT>::value >
1002 template<
typename VT >
1007 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
1008 , DVecImagExpr<VT,false>
1009 , INVALID_TYPE >::Type Type;
1018 template<
typename VT >
1023 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1024 , DVecImagExpr<VT,true>
1025 , INVALID_TYPE >::Type Type;
1034 template<
typename VT,
bool TF,
bool AF >
1039 typedef typename ImagExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
Header file for the UnderlyingNumeric type trait.
Header file for the DVecImagExprTrait class template.
Header file for the ImagExprTrait class template.
Pointer difference type of the Blaze library.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:320
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecImagExpr.h:245
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecImagExpr.h:471
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecImagExpr.h:525
Header file for basic type definitions.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecImagExpr.h:461
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecImagExpr.h:182
Header file for the imaginary shim.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Evaluation of the return type of a imaginary part expression.Via this type trait it is possible to ev...
Definition: ImagExprTrait.h:88
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:331
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
IteratorCategory iterator_category
The iterator category.
Definition: DVecImagExpr.h:185
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecImagExpr.h:493
Header file for the DenseVector base class.
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecImagExpr.h:103
Base template for the ImagTrait class.The ImagTrait class template offers the possibility to select t...
Definition: ImagTrait.h:78
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.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecImagExpr.h:505
SelectType< useAssign, const ResultType, const DVecImagExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecImagExpr.h:165
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecImagExpr.h:255
DifferenceType difference_type
Difference between two iterators.
Definition: DVecImagExpr.h:189
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecImagExpr.h:353
const ImagExprTrait< MT >::Type imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatImagExpr.h:920
Constraint on the data type.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecImagExpr.h:365
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ImagTrait< RT >::Type ResultType
Result type for expression template evaluations.
Definition: DVecImagExpr.h:157
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecImagExpr.h:389
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.
ValueType value_type
Type of the underlying elements.
Definition: DVecImagExpr.h:186
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecImagExpr.h:425
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecImagExpr.h:211
Operand operand() const
Returns the dense vector operand.
Definition: DVecImagExpr.h:481
#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
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
DVecImagExpr(const VT &dv)
Constructor for the DVecImagExpr class.
Definition: DVecImagExpr.h:414
Header file for the IsAligned type trait.
ElementType & ReferenceType
Reference return type.
Definition: DVecImagExpr.h:181
Constraint on the data type.
Iterator over the elements of the dense vector.
Definition: DVecImagExpr.h:174
#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
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecImagExpr.h:104
Header file for the VecImagExpr base class.
Constraint on the data type.
Base class for all vector imaginary part expression templates.The VecImagExpr class serves as a tag f...
Definition: VecImagExpr.h:65
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the serial shim.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecImagExpr.h:266
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecImagExpr.h:451
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:342
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
ElementType * PointerType
Pointer return type.
Definition: DVecImagExpr.h:180
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 vector imag() function.The DVecImagExpr class represents the compile ...
Definition: DVecImagExpr.h:97
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecImagExpr.h:515
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:309
#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
Header file for the imaginary trait.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecImagExpr.h:438
ElementType ValueType
Type of the underlying elements.
Definition: DVecImagExpr.h:179
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecImagExpr.h:178
PointerType pointer
Pointer return type.
Definition: DVecImagExpr.h:187
Operand dv_
Dense vector of the imaginary part expression.
Definition: DVecImagExpr.h:532
Header file for the IsDenseVector type trait.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecImagExpr.h:276
Header file for the TDVecImagExprTrait class template.
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecImagExpr.h:159
#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
DVecImagExpr< VT, TF > This
Type of this DVecImagExpr instance.
Definition: DVecImagExpr.h:156
ImagExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecImagExpr.h:117
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecImagExpr.h:223
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecImagExpr.h:158
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
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecImagExpr.h:234
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecImagExpr.h:168
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:287
IteratorType it_
Iterator to the current vector element.
Definition: DVecImagExpr.h:396
Header file for the SubvectorExprTrait class template.
Header file for exception macros.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecImagExpr.h:377
ReferenceType reference
Reference return type.
Definition: DVecImagExpr.h:188
Header file for the IsColumnVector type trait.
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecImagExpr.h:192
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecImagExpr.h:298
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
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecImagExpr.h:162
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.
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecImagExpr.h:200
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.