Blaze 3.9
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
blaze::SVecRepeatExpr< VT, TF, CRAs > Class Template Reference

Expression object for the sparse vector repeat() function. More...

#include <SVecRepeatExpr.h>

Inherits blaze::VecRepeatExpr< SparseVector< SVecRepeatExpr< VT, TF, CRAs... >, TF >, CRAs... >, If_t< IsComputation_v< VT >, Computation, Transformation >, and blaze::RepeatExprData< 1UL, CRAs... >.

Public Types

using This = SVecRepeatExpr< VT, TF, CRAs... >
 Type of this SVecRepeatExpr instance.
 
using BaseType = VecRepeatExpr< SparseVector< This, TF >, CRAs... >
 Base type of this SVecRepeatExpr instance.
 
using ResultType = RepeatTrait_t< VT, CRAs... >
 Result type for expression template evaluations.
 
using TransposeType = TransposeType_t< ResultType >
 Transpose type for expression template evaluations.
 
using ElementType = ElementType_t< VT >
 Resulting element type.
 
using ReturnType = ReturnType_t< VT >
 Return type for expression template evaluations.
 
using CompositeType = const ResultType
 Data type for composite expression templates.
 
using Operand = If_t< IsExpression_v< VT >, const VT, const VT & >
 Composite data type of the sparse vector expression.
 
using VectorType = SVecRepeatExpr< VT, TF, CRAs... >
 Type of the vector.
 

Public Member Functions

template<typename... RRAs>
 SVecRepeatExpr (const VT &sv, RRAs... args) noexcept
 Constructor for the SVecRepeatExpr 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 the number of non-zero elements in the sparse vector. More...
 
Operand operand () const noexcept
 Returns the 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...
 
Conversion operators
BLAZE_ALWAYS_INLINE constexpr SVecRepeatExpr< VT, TF, CRAs... > & operator~ () noexcept
 CRTP-based conversion operation for non-constant vectors. More...
 
BLAZE_ALWAYS_INLINE constexpr const SVecRepeatExpr< VT, TF, CRAs... > & operator~ () const noexcept
 CRTP-based conversion operation for constant vectors. More...
 
constexpr SVecRepeatExpr< VT, TF, CRAs... > & operator* () noexcept
 CRTP-based conversion operation for non-constant vectors. More...
 
constexpr const SVecRepeatExpr< VT, TF, CRAs... > & operator* () const noexcept
 CRTP-based conversion operation for constant vectors. More...
 

Static Public Attributes

static constexpr bool smpAssignable = false
 Compilation switch for the expression template assignment strategy.
 
static constexpr bool transposeFlag
 Transpose flag of the vector.
 

Private Types

using DataType = RepeatExprData< 1UL, CRAs... >
 The type of the RepeatExprData base class.
 

Private Attributes

Operand sv_
 Sparse vector of the repeater expression.
 

Detailed Description

template<typename VT, bool TF, size_t... CRAs>
class blaze::SVecRepeatExpr< VT, TF, CRAs >

Expression object for the sparse vector repeat() function.

The SVecRepeatExpr class represents the compile time expression for repeating a sparse vector via the repeat() function.

Constructor & Destructor Documentation

◆ SVecRepeatExpr()

template<typename VT , bool TF, size_t... CRAs>
template<typename... RRAs>
blaze::SVecRepeatExpr< VT, TF, CRAs >::SVecRepeatExpr ( const VT &  sv,
RRAs...  args 
)
inlineexplicitnoexcept

Constructor for the SVecRepeatExpr class.

Parameters
svThe sparse vector operand of the repeater expression.
argsThe number of repetitions.

Member Function Documentation

◆ at()

template<typename VT , bool TF, size_t... CRAs>
ReturnType blaze::SVecRepeatExpr< VT, TF, CRAs >::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 VT , bool TF, size_t... CRAs>
template<typename T >
bool blaze::SVecRepeatExpr< VT, TF, CRAs >::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 VT , bool TF, size_t... CRAs>
bool blaze::SVecRepeatExpr< VT, TF, CRAs >::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 VT , bool TF, size_t... CRAs>
template<typename T >
bool blaze::SVecRepeatExpr< VT, TF, CRAs >::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.

◆ nonZeros()

template<typename VT , bool TF, size_t... CRAs>
size_t blaze::SVecRepeatExpr< VT, TF, CRAs >::nonZeros ( ) const
inline

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

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

◆ operand()

template<typename VT , bool TF, size_t... CRAs>
Operand blaze::SVecRepeatExpr< VT, TF, CRAs >::operand ( ) const
inlinenoexcept

Returns the sparse vector operand.

Returns
The sparse vector operand.

◆ operator*() [1/2]

BLAZE_ALWAYS_INLINE constexpr const SVecRepeatExpr< VT, TF, CRAs... > & blaze::Vector< SVecRepeatExpr< VT, TF, CRAs... > , TF >::operator*
constexprnoexceptinherited

CRTP-based conversion operation for constant vectors.

Returns
Const reference of the actual type of the vector.

This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a constant reference to the actual type VT.

◆ operator*() [2/2]

BLAZE_ALWAYS_INLINE constexpr SVecRepeatExpr< VT, TF, CRAs... > & blaze::Vector< SVecRepeatExpr< VT, TF, CRAs... > , TF >::operator*
constexprnoexceptinherited

CRTP-based conversion operation for non-constant vectors.

Returns
Mutable reference of the actual type of the vector.

This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a mutable reference to the actual type VT.

◆ operator[]()

template<typename VT , bool TF, size_t... CRAs>
ReturnType blaze::SVecRepeatExpr< VT, TF, CRAs >::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 constexpr const SVecRepeatExpr< VT, TF, CRAs... > & blaze::Vector< SVecRepeatExpr< VT, TF, CRAs... > , TF >::operator~
constexprnoexceptinherited

CRTP-based conversion operation for constant vectors.

Returns
Constant reference of the actual type of the vector.

This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a constant reference to the actual type VT.

◆ operator~() [2/2]

BLAZE_ALWAYS_INLINE constexpr SVecRepeatExpr< VT, TF, CRAs... > & blaze::Vector< SVecRepeatExpr< VT, TF, CRAs... > , TF >::operator~
constexprnoexceptinherited

CRTP-based conversion operation for non-constant vectors.

Returns
Mutable reference of the actual type of the vector.

This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a mutable reference to the actual type VT.

◆ size()

template<typename VT , bool TF, size_t... CRAs>
size_t blaze::SVecRepeatExpr< VT, TF, CRAs >::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: