35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_ 93 class SVecTransExpr :
public SparseVector< SVecTransExpr<VT,TF>, TF >
94 ,
private VecTransExpr
95 ,
private If< IsComputation<VT>, Computation, EmptyType >::Type
113 template<
typename VT2 >
116 enum :
bool { value = useAssign };
128 template<
typename VT2 >
129 struct UseSMPAssign {
130 enum :
bool { value = VT2::smpAssignable && useAssign };
141 template<
typename VT2 >
142 struct GetConstIterator {
145 struct Failure {
using Type = INVALID_TYPE; };
171 enum :
bool { smpAssignable = VT::smpAssignable };
203 inline ReturnType
at(
size_t index )
const {
204 if( index >=
sv_.size() ) {
207 return (*
this)[index];
216 inline ConstIterator
begin()
const {
226 inline ConstIterator
end()
const {
236 inline size_t size() const noexcept {
247 return sv_.nonZeros();
257 inline ConstIterator
find(
size_t index )
const {
303 template<
typename T >
304 inline bool canAlias(
const T* alias )
const noexcept {
305 return sv_.canAlias( alias );
315 template<
typename T >
316 inline bool isAliased(
const T* alias )
const noexcept {
317 return sv_.isAliased( alias );
327 return sv_.canSMPAssign();
350 template<
typename VT2 >
359 assign( tmp, rhs.sv_ );
378 template<
typename VT2 >
387 assign( tmp, rhs.sv_ );
406 template<
typename VT2 >
415 addAssign( tmp, rhs.sv_ );
438 template<
typename VT2 >
447 subAssign( tmp, rhs.sv_ );
470 template<
typename VT2 >
479 multAssign( tmp, rhs.sv_ );
502 template<
typename VT2 >
530 template<
typename VT2 >
558 template<
typename VT2 >
590 template<
typename VT2 >
623 template<
typename VT2 >
677 template<
typename VT
716 template<
typename VT
738 template<
typename VT,
bool TF >
739 struct Size< SVecTransExpr<VT,TF> > :
public Size<VT>
755 template<
typename VT >
771 template<
typename VT >
787 template<
typename VT,
bool TF,
bool AF >
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecTransExpr.h:269
Compile time check for row vector types.This type trait tests whether or not the given template argum...
Definition: IsRowVector.h:80
Header file for auxiliary alias declarations.
Operand sv_
Sparse vector of the transposition expression.
Definition: SVecTransExpr.h:333
Evaluation of the expression type type of a subvector operation.Via this type trait it is possible to...
Definition: SubvectorExprTrait.h:79
Header file for basic type definitions.
Header file for the SparseVector base class.
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: SVecTransExpr.h:155
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SVecTransExpr.h:326
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:160
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecTransExpr.h:190
Evaluation of the expression type of a sparse vector transpose operation.Via this type trait it is po...
Definition: TSVecTransExprTrait.h:74
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: SVecTransExpr.h:154
Header file for the IsRowVector type trait.
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
Header file for the And class template.
#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:136
Header file for the Computation base class.
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:323
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecTransExpr.h:281
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:129
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
ElementType_< VT > ElementType
Resulting element type.
Definition: SVecTransExpr.h:156
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: SVecTransExpr.h:157
GetConstIterator< VT >::Type ConstIterator
Iterator over the elements of the dense vector.
Definition: SVecTransExpr.h:163
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:143
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Evaluation of the expression type of a sparse vector transpose operation.Via this type trait it is po...
Definition: SVecTransExprTrait.h:74
Header file for the dense vector transposer.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
CompositeType_< VT > CT
Composite type of the sparse vector expression.
Definition: SVecTransExpr.h:99
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:98
#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
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:137
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#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
If_< IsExpression< VT >, const VT, const VT &> Operand
Composite data type of the sparse vector expression.
Definition: SVecTransExpr.h:166
Compile time check for column vector types.This type trait tests whether or not the given template ar...
Definition: IsColumnVector.h:80
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecTransExpr.h:216
Header file for the exception macros of the math module.
Operand operand() const noexcept
Returns the sparse vector operand.
Definition: SVecTransExpr.h:292
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.
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecTransExpr.h:257
Header file for the IsSparseVector type trait.
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:179
IfTrue_< useAssign, const ResultType, const SVecTransExpr &> CompositeType
Data type for composite expression templates.
Definition: SVecTransExpr.h:160
Utility type for generic codes.
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:160
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Header file for the TransExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecTransExpr.h:246
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:223
Header file for the SVecTransExprTrait class template.
Header file for the sparse vector transposer.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecTransExpr.h:236
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:75
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:120
Header file for the SubvectorExprTrait class template.
Header file for the TSVecTransExprTrait class template.
SVecTransExpr< VT, TF > This
Type of this SVecTransExpr instance.
Definition: SVecTransExpr.h:153
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecTransExpr.h:203
Header file for the IsColumnVector type trait.
Header file for the empty type.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecTransExpr.h:316
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
typename T::Operand Operand_
Alias declaration for nested Operand type definitions.The Operand_ alias declaration provides a conve...
Definition: Aliases.h:223
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:226
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecTransExpr.h:304