Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
blaze::SMatSVecMultExpr< MT, VT > Class Template Reference

Expression object for sparse matrix-sparse vector multiplications.The SMatSVecMultExpr class represents the compile time expression for multiplications between row-major sparse matrices and sparse vectors. More...

#include <SMatSVecMultExpr.h>

Inherits blaze::MatVecMultExpr< SparseVector< SMatSVecMultExpr< MT, VT >, false > >, and blaze::Computation.

Public Types

enum  : bool { smpAssignable }
 Compilation switch for the expression template assignment strategy.
 
using This = SMatSVecMultExpr< MT, VT >
 Type of this SMatSVecMultExpr instance.
 
using ResultType = MultTrait_< MRT, VRT >
 Result type for expression template evaluations.
 
using TransposeType = TransposeType_< ResultType >
 Transpose type for expression template evaluations.
 
using ElementType = ElementType_< ResultType >
 Resulting element type.
 
using ReturnType = const ElementType
 Return type for expression template evaluations.
 
using CompositeType = const ResultType
 Data type for composite expression templates.
 
using LeftOperand = If_< IsExpression< MT >, const MT, const MT &>
 Composite type of the left-hand side sparse matrix expression.
 
using RightOperand = If_< IsExpression< VT >, const VT, const VT &>
 Composite type of the right-hand side sparse vector expression.
 
using LT = IfTrue_< evaluateMatrix, const MRT, MCT >
 Type for the assignment of the left-hand side sparse matrix operand.
 
using RT = IfTrue_< evaluateVector, const VRT, VCT >
 Type for the assignment of the right-hand side sparse vector operand.
 
using VectorType = SMatSVecMultExpr< MT, VT >
 Type of the vector.
 

Public Member Functions

 SMatSVecMultExpr (const MT &mat, const VT &vec) noexcept
 Constructor for the SMatSVecMultExpr class. More...
 
ReturnType operator[] (size_t index) const
 Subscript operator for the direct access to the vector elements. More...
 
ReturnType at (size_t index) const
 Checked access to the vector elements. More...
 
size_t size () const noexcept
 Returns the current size/dimension of the vector. More...
 
size_t nonZeros () const
 Returns an estimation for the number of non-zero elements in the sparse vector. More...
 
LeftOperand leftOperand () const noexcept
 Returns the left-hand side sparse matrix operand. More...
 
RightOperand rightOperand () const noexcept
 Returns the right-hand side sparse vector operand. More...
 
template<typename T >
bool canAlias (const T *alias) const noexcept
 Returns whether the expression can alias with the given address alias. More...
 
template<typename T >
bool isAliased (const T *alias) const noexcept
 Returns whether the expression is aliased with the given address alias. More...
 
bool canSMPAssign () const noexcept
 Returns whether the expression can be used in SMP assignments. More...
 
BLAZE_ALWAYS_INLINE VectorTypeoperator~ () noexcept
 Conversion operator for non-constant vectors. More...
 
BLAZE_ALWAYS_INLINE const VectorTypeoperator~ () const noexcept
 Conversion operator for constant vectors. More...
 

Private Types

enum  : bool { evaluateMatrix = RequiresEvaluation<MT>::value }
 Compilation switch for the composite type of the left-hand side sparse matrix expression.
 
enum  : bool { evaluateVector = RequiresEvaluation<VT>::value || IsComputation<VT>::value }
 Compilation switch for the composite type of the right-hand side sparse vector expression.
 
using MRT = ResultType_< MT >
 Result type of the left-hand side sparse matrix expression.
 
using VRT = ResultType_< VT >
 Result type of the right-hand side sparse vector expression.
 
using MCT = CompositeType_< MT >
 Composite type of the left-hand side sparse matrix expression.
 
using VCT = CompositeType_< VT >
 Composite type of the right-hand side sparse vector expression.
 

Private Attributes

LeftOperand mat_
 Left-hand side sparse matrix of the multiplication expression.
 
RightOperand vec_
 Right-hand side sparse vector of the multiplication expression.
 

Detailed Description

template<typename MT, typename VT>
class blaze::SMatSVecMultExpr< MT, VT >

Expression object for sparse matrix-sparse vector multiplications.

The SMatSVecMultExpr class represents the compile time expression for multiplications between row-major sparse matrices and sparse vectors.

Constructor & Destructor Documentation

◆ SMatSVecMultExpr()

template<typename MT , typename VT >
blaze::SMatSVecMultExpr< MT, VT >::SMatSVecMultExpr ( const MT &  mat,
const VT &  vec 
)
inlineexplicitnoexcept

Constructor for the SMatSVecMultExpr class.

Parameters
matThe left-hand side sparse matrix operand of the multiplication expression.
vecThe right-hand side sparse vector operand of the multiplication expression.

Member Function Documentation

◆ at()

template<typename MT , typename VT >
ReturnType blaze::SMatSVecMultExpr< MT, VT >::at ( size_t  index) const
inline

Checked access to the vector elements.

Parameters
indexAccess index. The index has to be in the range $[0..N-1]$.
Returns
The resulting value.
Exceptions
std::out_of_rangeInvalid vector access index.

◆ canAlias()

template<typename MT , typename VT >
template<typename T >
bool blaze::SMatSVecMultExpr< MT, VT >::canAlias ( const T *  alias) const
inlinenoexcept

Returns whether the expression can alias with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case the expression can alias, false otherwise.

◆ canSMPAssign()

template<typename MT , typename VT >
bool blaze::SMatSVecMultExpr< MT, VT >::canSMPAssign ( ) const
inlinenoexcept

Returns whether the expression can be used in SMP assignments.

Returns
true in case the expression can be used in SMP assignments, false if not.

◆ isAliased()

template<typename MT , typename VT >
template<typename T >
bool blaze::SMatSVecMultExpr< MT, VT >::isAliased ( const T *  alias) const
inlinenoexcept

Returns whether the expression is aliased with the given address alias.

Parameters
aliasThe alias to be checked.
Returns
true in case an alias effect is detected, false otherwise.

◆ leftOperand()

template<typename MT , typename VT >
LeftOperand blaze::SMatSVecMultExpr< MT, VT >::leftOperand ( ) const
inlinenoexcept

Returns the left-hand side sparse matrix operand.

Returns
The left-hand side sparse matrix operand.

◆ nonZeros()

template<typename MT , typename VT >
size_t blaze::SMatSVecMultExpr< MT, VT >::nonZeros ( ) const
inline

Returns an estimation for the number of non-zero elements in the sparse vector.

Returns
The estimate for the number of non-zero elements in the sparse vector.

◆ operator[]()

template<typename MT , typename VT >
ReturnType blaze::SMatSVecMultExpr< MT, VT >::operator[] ( size_t  index) const
inline

Subscript operator for the direct access to the vector elements.

Parameters
indexAccess index. The index has to be in the range $[0..N-1]$.
Returns
The resulting value.

◆ operator~() [1/2]

BLAZE_ALWAYS_INLINE VectorType& blaze::Vector< SMatSVecMultExpr< MT, VT > , TF >::operator~ ( )
inlinenoexceptinherited

Conversion operator for non-constant vectors.

Returns
Reference of the actual type of the vector.

◆ operator~() [2/2]

BLAZE_ALWAYS_INLINE const VectorType& blaze::Vector< SMatSVecMultExpr< MT, VT > , TF >::operator~ ( ) const
inlinenoexceptinherited

Conversion operator for constant vectors.

Returns
Const reference of the actual type of the vector.

◆ rightOperand()

template<typename MT , typename VT >
RightOperand blaze::SMatSVecMultExpr< MT, VT >::rightOperand ( ) const
inlinenoexcept

Returns the right-hand side sparse vector operand.

Returns
The right-hand side sparse vector operand.

◆ size()

template<typename MT , typename VT >
size_t blaze::SMatSVecMultExpr< MT, VT >::size ( ) const
inlinenoexcept

Returns the current size/dimension of the vector.

Returns
The size of the vector.

The documentation for this class was generated from the following files: