Blaze  3.6
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Attributes | Static Private Attributes | List of all members
blaze::DVecMapExpr< VT, OP, TF > Class Template Reference

Expression object for the dense vector map() function.The DVecMapExpr class represents the compile time expression for the evaluation of a custom operation on each element of a dense vector via the map() function. More...

#include <DVecMapExpr.h>

Inherits blaze::VecMapExpr< DenseVector< DVecMapExpr< VT, OP, TF >, TF > >, and blaze::Computation.

Classes

class  ConstIterator
 Iterator over the elements of the dense vector map expression. More...
 

Public Types

using This = DVecMapExpr< VT, OP, TF >
 Type of this DVecMapExpr instance.
 
using BaseType = DenseVector< This, TF >
 Base type of this DVecMapExpr instance.
 
using ResultType = MapTrait_t< RT, OP >
 Result type for expression template evaluations.
 
using TransposeType = TransposeType_t< ResultType >
 Transpose type for expression template evaluations.
 
using ElementType = ElementType_t< ResultType >
 Resulting element type.
 
using ReturnType = decltype(std::declval< OP >()(std::declval< RN >()))
 Return type for expression template evaluations.
 
using CompositeType = If_t< useAssign, const ResultType, const DVecMapExpr & >
 Data type for composite expression templates.
 
using Operand = If_t< IsExpression_v< VT >, const VT, const VT & >
 Composite data type of the dense vector expression.
 
using Operation = OP
 Data type of the custom unary operation.
 
using VectorType = VT
 Type of the vector.
 

Public Member Functions

 DVecMapExpr (const VT &dv, OP op) noexcept
 Constructor for the DVecMapExpr 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...
 
BLAZE_ALWAYS_INLINE auto load (size_t index) const noexcept
 Access to the SIMD elements of the vector. More...
 
ConstIterator begin () const
 Returns an iterator to the first non-zero element of the dense vector. More...
 
ConstIterator end () const
 Returns an iterator just past the last non-zero element of the dense vector. More...
 
size_t size () const noexcept
 Returns the current size/dimension of the vector. More...
 
Operand operand () const noexcept
 Returns the dense vector operand. More...
 
Operation operation () const
 Returns a copy of the custom operation. 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 isAligned () const noexcept
 Returns whether the operands of the expression are properly aligned in memory. More...
 
bool canSMPAssign () const noexcept
 Returns whether the expression can be used in SMP assignments. More...
 
BLAZE_ALWAYS_INLINE constexpr VectorTypeoperator~ () noexcept
 Conversion operator for non-constant vectors. More...
 
BLAZE_ALWAYS_INLINE constexpr const VectorTypeoperator~ () const noexcept
 Conversion operator for constant vectors. More...
 

Static Public Attributes

static constexpr bool simdEnabled
 Compilation switch for the expression template evaluation strategy. More...
 
static constexpr bool smpAssignable = VT::smpAssignable
 Compilation switch for the expression template assignment strategy.
 
static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size
 The number of elements packed within a single SIMD element.
 
static constexpr bool transposeFlag = TF
 Transpose flag of the vector.
 

Private Types

using RT = ResultType_t< VT >
 Result type of the dense vector expression.
 
using ET = ElementType_t< VT >
 Element type of the dense vector expression.
 
using RN = ReturnType_t< VT >
 Return type of the dense vector expression.
 

Private Attributes

Operand dv_
 Dense vector of the map expression.
 
Operation op_
 The custom unary operation.
 

Static Private Attributes

static constexpr bool useAssign = ( IsComputation_v<VT> && RequiresEvaluation_v<VT> )
 Compilation switch for the serial evaluation strategy of the map expression. More...
 

Detailed Description

template<typename VT, typename OP, bool TF>
class blaze::DVecMapExpr< VT, OP, TF >

Expression object for the dense vector map() function.

The DVecMapExpr class represents the compile time expression for the evaluation of a custom operation on each element of a dense vector via the map() function.

Constructor & Destructor Documentation

◆ DVecMapExpr()

template<typename VT , typename OP , bool TF>
blaze::DVecMapExpr< VT, OP, TF >::DVecMapExpr ( const VT &  dv,
OP  op 
)
inlineexplicitnoexcept

Constructor for the DVecMapExpr class.

Parameters
dvThe dense vector operand of the map expression.
opThe custom unary operation.

Member Function Documentation

◆ at()

template<typename VT , typename OP , bool TF>
ReturnType blaze::DVecMapExpr< VT, OP, TF >::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.

◆ begin()

template<typename VT , typename OP , bool TF>
ConstIterator blaze::DVecMapExpr< VT, OP, TF >::begin ( ) const
inline

Returns an iterator to the first non-zero element of the dense vector.

Returns
Iterator to the first non-zero element of the dense vector.

◆ canAlias()

template<typename VT , typename OP , bool TF>
template<typename T >
bool blaze::DVecMapExpr< VT, OP, TF >::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 , typename OP , bool TF>
bool blaze::DVecMapExpr< VT, OP, TF >::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.

◆ end()

template<typename VT , typename OP , bool TF>
ConstIterator blaze::DVecMapExpr< VT, OP, TF >::end ( ) const
inline

Returns an iterator just past the last non-zero element of the dense vector.

Returns
Iterator just past the last non-zero element of the dense vector.

◆ isAliased()

template<typename VT , typename OP , bool TF>
template<typename T >
bool blaze::DVecMapExpr< VT, OP, TF >::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.

◆ isAligned()

template<typename VT , typename OP , bool TF>
bool blaze::DVecMapExpr< VT, OP, TF >::isAligned ( ) const
inlinenoexcept

Returns whether the operands of the expression are properly aligned in memory.

Returns
true in case the operands are aligned, false if not.

◆ load()

template<typename VT , typename OP , bool TF>
BLAZE_ALWAYS_INLINE auto blaze::DVecMapExpr< VT, OP, TF >::load ( size_t  index) const
inlinenoexcept

Access to the SIMD elements of the vector.

Parameters
indexAccess index. The index has to be in the range $[0..N-1]$.
Returns
Reference to the accessed values.

◆ operand()

template<typename VT , typename OP , bool TF>
Operand blaze::DVecMapExpr< VT, OP, TF >::operand ( ) const
inlinenoexcept

Returns the dense vector operand.

Returns
The dense vector operand.

◆ operation()

template<typename VT , typename OP , bool TF>
Operation blaze::DVecMapExpr< VT, OP, TF >::operation ( ) const
inline

Returns a copy of the custom operation.

Returns
A copy of the custom operation.

◆ operator[]()

template<typename VT , typename OP , bool TF>
ReturnType blaze::DVecMapExpr< VT, OP, TF >::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]

template<typename VT, bool TF>
BLAZE_ALWAYS_INLINE constexpr VectorType& blaze::Vector< VT, TF >::operator~ ( )
inlinenoexceptinherited

Conversion operator for non-constant vectors.

Returns
Reference of the actual type of the vector.

◆ operator~() [2/2]

template<typename VT, bool TF>
BLAZE_ALWAYS_INLINE constexpr const VectorType& blaze::Vector< VT, TF >::operator~ ( ) const
inlinenoexceptinherited

Conversion operator for constant vectors.

Returns
Const reference of the actual type of the vector.

◆ size()

template<typename VT , typename OP , bool TF>
size_t blaze::DVecMapExpr< VT, OP, TF >::size ( ) const
inlinenoexcept

Returns the current size/dimension of the vector.

Returns
The size of the vector.

Member Data Documentation

◆ simdEnabled

template<typename VT , typename OP , bool TF>
constexpr bool blaze::DVecMapExpr< VT, OP, TF >::simdEnabled
static
Initial value:
=
( VT::simdEnabled &&
If_t< HasSIMDEnabled_v<OP>, GetSIMDEnabled<OP,ET>, HasLoad<OP> >::value )

Compilation switch for the expression template evaluation strategy.

◆ useAssign

template<typename VT , typename OP , bool TF>
constexpr bool blaze::DVecMapExpr< VT, OP, TF >::useAssign = ( IsComputation_v<VT> && RequiresEvaluation_v<VT> )
staticprivate

Compilation switch for the serial evaluation strategy of the map expression.

The useAssign compile time constant expression represents a compilation switch for the serial evaluation strategy of the map expression. In case the given dense vector expression of type VT is a computation expression and requires an intermediate evaluation, useAssign will be set to 1 and the map expression will be evaluated via the assign function family. Otherwise useAssign will be set to 0 and the expression will be evaluated via the subscript operator.


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