Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
etl::mean_l_transformer< T > Struct Template Reference

Transform (dynamic) that averages the expression from the left, effectively removing the left dimension. More...

#include <reduc_transformers.hpp>

Public Types

using sub_type = T
 The type on which the expression works.
 
using value_type = value_t< T >
 The type of valuie.
 

Public Member Functions

 mean_l_transformer (sub_type expr)
 Construct a new transformer around the given expression. More...
 
value_type operator[] (size_t j) const
 Returns the value at the given index. More...
 
value_type read_flat (size_t j) const noexcept
 Returns the value at the given index This function never has side effects. More...
 
template<typename... Sizes>
value_type operator() (size_t j, Sizes... sizes) const
 Access to the value at the given (j, sizes...) position. More...
 
template<typename E >
bool alias (const E &rhs) const noexcept
 Test if this expression aliases with the given expression. More...
 
template<typename V >
void visit (V &&visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
void ensure_cpu_up_to_date () const
 Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value).
 
void ensure_gpu_up_to_date () const
 Copy back from the GPU to the expression memory if necessary.
 

Static Public Attributes

static constexpr bool gpu_computable = false
 

Friends

struct etl_traits< mean_l_transformer >
 
std::ostream & operator<< (std::ostream &os, const mean_l_transformer &transformer)
 Display the transformer on the given stream. More...
 

Detailed Description

template<typename T>
struct etl::mean_l_transformer< T >

Transform (dynamic) that averages the expression from the left, effectively removing the left dimension.

Template Parameters
TThe type on which the transformer is applied

Constructor & Destructor Documentation

◆ mean_l_transformer()

template<typename T >
etl::mean_l_transformer< T >::mean_l_transformer ( sub_type  expr)
inlineexplicit

Construct a new transformer around the given expression.

Parameters
exprThe sub expression

Member Function Documentation

◆ alias()

template<typename T >
template<typename E >
bool etl::mean_l_transformer< T >::alias ( const E &  rhs) const
inlinenoexcept

Test if this expression aliases with the given expression.

Parameters
rhsThe other expression to test
Returns
true if the two expressions aliases, false otherwise

◆ operator()()

template<typename T >
template<typename... Sizes>
value_type etl::mean_l_transformer< T >::operator() ( size_t  j,
Sizes...  sizes 
) const
inline

Access to the value at the given (j, sizes...) position.

Parameters
jThe first index
sizesThe remaining indices
Returns
The value at the position (j, sizes...)

◆ operator[]()

template<typename T >
value_type etl::mean_l_transformer< T >::operator[] ( size_t  j) const
inline

Returns the value at the given index.

Parameters
jThe index
Returns
the value at the given index.

◆ read_flat()

template<typename T >
value_type etl::mean_l_transformer< T >::read_flat ( size_t  j) const
inlinenoexcept

Returns the value at the given index This function never has side effects.

Parameters
jThe index
Returns
the value at the given index.

◆ visit()

template<typename T >
template<typename V >
void etl::mean_l_transformer< T >::visit ( V &&  visitor) const
inline

Apply the given visitor to this expression and its descendants.

Parameters
visitorThe visitor to apply

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  os,
const mean_l_transformer< T > &  transformer 
)
friend

Display the transformer on the given stream.

Parameters
osThe output stream
transformerThe transformer to print
Returns
the output stream

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