35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECCONJEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECCONJEXPR_H_
95 class SVecConjExpr :
public SparseVector< SVecConjExpr<VT,TF>, TF >
132 template<
typename VT2 >
135 enum { value = useAssign };
148 template<
typename VT2 >
149 struct UseSMPAssign {
150 enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
174 enum { smpAssignable = VT::smpAssignable };
229 return Element(
conj( it_->value() ), it_->index() );
249 return conj( it_->value() );
270 return it_ == rhs.
it_;
281 return it_ != rhs.
it_;
292 return it_ - rhs.
it_;
332 inline ReturnType
at(
size_t index )
const {
333 if( index >=
sv_.size() ) {
336 return (*
this)[index];
376 return sv_.nonZeros();
432 template<
typename T >
434 return sv_.canAlias( alias );
444 template<
typename T >
446 return sv_.isAliased( alias );
456 return sv_.canSMPAssign();
479 template<
typename VT2 >
487 assign( ~lhs, rhs.sv_ );
488 assign( ~lhs,
conj( ~lhs ) );
507 template<
typename VT2 >
517 assign( ~lhs, rhs.sv_ );
519 const Iterator
end( (~lhs).
end() );
520 for( Iterator element=(~lhs).
begin(); element!=
end; ++element ) {
541 template<
typename VT2 >
542 friend inline typename EnableIf< UseAssign<VT2> >::Type
543 addAssign( DenseVector<VT2,TF>& lhs,
const SVecConjExpr& rhs )
553 const ResultType tmp(
serial( rhs ) );
554 addAssign( ~lhs, tmp );
577 template<
typename VT2 >
578 friend inline typename EnableIf< UseAssign<VT2> >::Type
579 subAssign( DenseVector<VT2,TF>& lhs,
const SVecConjExpr& rhs )
589 const ResultType tmp(
serial( rhs ) );
590 subAssign( ~lhs, tmp );
613 template<
typename VT2 >
614 friend inline typename EnableIf< UseAssign<VT2> >::Type
615 multAssign( DenseVector<VT2,TF>& lhs,
const SVecConjExpr& rhs )
625 const ResultType tmp(
serial( rhs ) );
626 multAssign( ~lhs, tmp );
649 template<
typename VT2 >
650 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
681 template<
typename VT2 >
682 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
693 const ResultType tmp( rhs );
717 template<
typename VT2 >
718 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
729 const ResultType tmp( rhs );
753 template<
typename VT2 >
754 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
765 const ResultType tmp( rhs );
810 template<
typename VT
847 template<
typename VT
884 template<
typename VT
886 inline typename SVecConjExpr<VT,TF>::Operand
conj(
const SVecConjExpr<VT,TF>& sv )
914 template<
typename VT
916 inline const SVecTransExpr<VT,!TF>
conj(
const SVecTransExpr<SVecConjExpr<VT,TF>,!TF>& sv )
920 return SVecTransExpr<VT,!TF>( sv.operand().operand() );
936 template<
typename VT,
bool TF >
953 template<
typename VT >
958 typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
959 ,
typename SVecConjExpr<VT,false>::Operand
960 , INVALID_TYPE >::Type Type;
969 template<
typename VT >
974 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
975 ,
typename SVecConjExpr<VT,true>::Operand
976 , INVALID_TYPE >::Type Type;
985 template<
typename VT >
986 struct SVecConjExprTrait< SVecTransExpr<
SVecConjExpr<VT,true>, false > >
990 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
991 , SVecTransExpr<VT,false>
992 , INVALID_TYPE >::Type Type;
1001 template<
typename VT >
1002 struct TSVecConjExprTrait< SVecTransExpr<
SVecConjExpr<VT,false>, true > >
1006 typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
1007 , SVecTransExpr<VT,true>
1008 , INVALID_TYPE >::Type Type;
1017 template<
typename VT,
bool TF,
bool AF >
1022 typedef typename ConjExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecConjExpr.h:386
ConjExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecConjExpr.h:118
Pointer difference type of the Blaze library.
SVecConjExpr< VT, TF > This
Type of this SVecConjExpr instance.
Definition: SVecConjExpr.h:157
ValueType & ReferenceType
Reference return type.
Definition: SVecConjExpr.h:193
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Expression object for the sparse vector conj() function.The SVecConjExpr class represents the compile...
Definition: Forward.h:120
Header file for basic type definitions.
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecConjExpr.h:238
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecConjExpr.h:207
Header file for the SparseVector base class.
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecConjExpr.h:298
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecConjExpr.h:248
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecConjExpr.h:355
Element ValueType
Type of the underlying pointers.
Definition: SVecConjExpr.h:191
ET ElementType
Resulting element type.
Definition: SVecConjExpr.h:160
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Iterator over the elements of the sparse vector complex conjugate expression.
Definition: SVecConjExpr.h:180
ValueType * PointerType
Pointer return type.
Definition: SVecConjExpr.h:192
TT TransposeType
Transpose type for expression template evaluations.
Definition: SVecConjExpr.h:159
Header file for the VecConjExpr 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
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecConjExpr.h:217
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecConjExpr.h:280
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecConjExpr.h:163
Constraint on the data type.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
ReferenceType reference
Reference return type.
Definition: SVecConjExpr.h:200
Header file for the ValueIndexPair class.
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecConjExpr.h:102
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
size_t index() const
Access to the current index of the sparse element.
Definition: SVecConjExpr.h:258
IteratorCategory iterator_category
The iterator category.
Definition: SVecConjExpr.h:197
ValueType value_type
Type of the underlying pointers.
Definition: SVecConjExpr.h:198
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
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecConjExpr.h:269
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecConjExpr.h:103
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:79
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecConjExpr.h:319
Constraint on the data type.
#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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
PointerType pointer
Pointer return type.
Definition: SVecConjExpr.h:199
VT::TransposeType TT
Transpose type of the sparse vector expression.
Definition: SVecConjExpr.h:104
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecConjExpr.h:345
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Operand operand() const
Returns the sparse vector operand.
Definition: SVecConjExpr.h:421
Header file for the EnableIf class template.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecConjExpr.h:445
Header file for the serial shim.
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecConjExpr.h:188
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecConjExpr.h:169
Header file for the conjugate shim.
SelectType< useAssign, const ResultType, const SVecConjExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecConjExpr.h:166
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecConjExpr.h:101
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
Evaluation of the return type of a complex conjugate expression.Via this type trait it is possible to...
Definition: ConjExprTrait.h:87
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
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
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecConjExpr.h:190
Utility type for generic codes.
Header file for the TSVecConjExprTrait class template.
Header file for the SVecConjExprTrait class template.
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecConjExpr.h:185
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecConjExpr.h:433
DifferenceType difference_type
Difference between two iterators.
Definition: SVecConjExpr.h:201
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecConjExpr.h:455
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
Header file for the RemoveReference type trait.
SVecConjExpr(const VT &sv)
Constructor for the SVecConjExpr class.
Definition: SVecConjExpr.h:308
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecConjExpr.h:332
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.
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
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecConjExpr.h:365
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
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecConjExpr.h:228
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecConjExpr.h:194
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecConjExpr.h:410
Header file for the SubvectorExprTrait class template.
VT::ElementType ET
Element type of the sparse vector expression.
Definition: SVecConjExpr.h:105
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecConjExpr.h:398
Header file for exception macros.
Header file for the CTransExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecConjExpr.h:375
Header file for the IsColumnVector type trait.
RT ResultType
Result type for expression template evaluations.
Definition: SVecConjExpr.h:158
Header file for the ConjExprTrait class template.
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecConjExpr.h:291
Operand sv_
Sparse vector of the complex conjugate expression.
Definition: SVecConjExpr.h:462
#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
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.