35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_ 89 :
public VecTransExpr< SparseVector< SVecTransExpr<VT,TF>, TF > >
90 ,
private If< IsComputation<VT>, Computation, Transformation >::Type
108 template<
typename VT2 >
111 enum :
bool { value = useAssign };
123 template<
typename VT2 >
124 struct UseSMPAssign {
125 enum :
bool { value = VT2::smpAssignable && useAssign };
136 template<
typename VT2 >
137 struct GetConstIterator {
140 struct Failure {
using Type = INVALID_TYPE; };
166 enum :
bool { smpAssignable = VT::smpAssignable };
199 if( index >=
sv_.size() ) {
202 return (*
this)[index];
231 inline size_t size() const noexcept {
242 return sv_.nonZeros();
298 template<
typename T >
299 inline bool canAlias(
const T* alias )
const noexcept {
300 return sv_.canAlias( alias );
310 template<
typename T >
311 inline bool isAliased(
const T* alias )
const noexcept {
312 return sv_.isAliased( alias );
322 return sv_.canSMPAssign();
345 template<
typename VT2 >
354 assign( tmp, rhs.sv_ );
373 template<
typename VT2 >
382 assign( tmp, rhs.sv_ );
401 template<
typename VT2 >
410 addAssign( tmp, rhs.sv_ );
433 template<
typename VT2 >
442 subAssign( tmp, rhs.sv_ );
465 template<
typename VT2 >
474 multAssign( tmp, rhs.sv_ );
497 template<
typename VT2 >
525 template<
typename VT2 >
553 template<
typename VT2 >
585 template<
typename VT2 >
618 template<
typename VT2 >
672 template<
typename VT
692 template<
typename VT
710 template<
typename VT
770 template<
typename VT
794 template<
typename VT
817 template<
typename VT,
bool TF >
818 struct Size< SVecTransExpr<VT,TF>, 0UL >
819 :
public Size<VT,0UL>
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:437
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecTransExpr.h:264
Header file for auxiliary alias declarations.
Operand sv_
Sparse vector of the transposition expression.
Definition: SVecTransExpr.h:328
Header file for basic type definitions.
Header file for the SparseVector base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SVecTransExpr.h:321
EnableIf_< IsDenseMatrix< MT1 > > 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:164
Header file for the FalseType type/value trait base class.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecTransExpr.h:185
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: SVecTransExpr.h:149
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
EnableIf_< IsDenseVector< VT1 > > 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:193
#define BLAZE_CREATE_HAS_TYPE_MEMBER_TYPE_TRAIT(TYPE_TRAIT_NAME, MEMBER_NAME)
Macro for the creation of a type trait for compile time checks for member types.This macro creates th...
Definition: HasMember.h:182
Expression object for sparse vector transpositions.The SVecTransExpr class represents the compile tim...
Definition: Forward.h:146
Header file for the Computation base class.
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: SVecTransExpr.h:150
Header file for the RequiresEvaluation type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecTransExpr.h:276
EnableIf_< IsDenseMatrix< MT1 > > 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:133
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:77
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the dense vector transposer.
EnableIf_< IsDenseMatrix< MT1 > > 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:102
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
CompositeType_< VT > CT
Composite type of the sparse vector expression.
Definition: SVecTransExpr.h:94
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper obje...
Definition: Forward.h:147
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
#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:61
decltype(auto) transTo(const DenseVector< VT, TF > &dv)
Conditional calculation of the transpose of the given dense vector.
Definition: DVecTransExpr.h:798
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecTransExpr.h:211
Header file for the exception macros of the math module.
Operand operand() const noexcept
Returns the sparse vector operand.
Definition: SVecTransExpr.h:287
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
typename GetConstIterator< VT >::Type ConstIterator
Iterator over the elements of the dense vector.
Definition: SVecTransExpr.h:158
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecTransExpr.h:252
Header file for the VecTransExpr base class.
Header file for run time assertion macros.
SVecTransExpr(const VT &sv) noexcept
Constructor for the SVecTransExpr class.
Definition: SVecTransExpr.h:174
If_< IsExpression< VT >, const VT, const VT &> Operand
Composite data type of the sparse vector expression.
Definition: SVecTransExpr.h:161
Utility type for generic codes.
IfTrue_< useAssign, const ResultType, const SVecTransExpr &> CompositeType
Data type for composite expression templates.
Definition: SVecTransExpr.h:155
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
ElementType_< VT > ElementType
Resulting element type.
Definition: SVecTransExpr.h:151
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecTransExpr.h:241
Header file for the HasMember type traits.
#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:81
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Header file for the sparse vector transposer.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecTransExpr.h:231
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:139
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the IntegralConstant class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecTransExpr.h:198
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecTransExpr.h:311
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: SVecTransExpr.h:152
Header file for the Size type trait.
#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
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:427
Header file for the TrueType type/value trait base class.
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecTransExpr.h:221
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecTransExpr.h:299