Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Attributes | List of all members
etl::fast_magic_view< V, N > Struct Template Reference

A view (virtual) of a static magic matrix. More...

#include <virtual_views.hpp>

Public Types

using value_type = V
 The value type.
 

Public Member Functions

value_type operator[] (size_t i)
 Returns the element at the given index. More...
 
value_type operator[] (size_t i) const
 Returns the element at the given index. More...
 
value_type read_flat (size_t i) const
 Returns the value at the given index This function never has side effects. More...
 
value_type operator() (size_t i, size_t j)
 Access to the value at the given (i, j) position. More...
 
value_type operator() (size_t i, size_t j) const
 Access to the value at the given (i, j) position. More...
 
template<typename E >
constexpr bool alias (const E &rhs) const noexcept
 Test if this expression aliases with the given expression. More...
 
template<typename Visitor >
void visit ([[maybe_unused]] Visitor &&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
 

Detailed Description

template<typename V, size_t N>
struct etl::fast_magic_view< V, N >

A view (virtual) of a static magic matrix.

Member Function Documentation

◆ alias()

template<typename V , size_t N>
template<typename E >
constexpr bool etl::fast_magic_view< V, N >::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()() [1/2]

template<typename V , size_t N>
value_type etl::fast_magic_view< V, N >::operator() ( size_t  i,
size_t  j 
)
inline

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

Parameters
iThe first index
jThe second index
Returns
The value at the position (i, j)

◆ operator()() [2/2]

template<typename V , size_t N>
value_type etl::fast_magic_view< V, N >::operator() ( size_t  i,
size_t  j 
) const
inline

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

Parameters
iThe first index
jThe second index
Returns
The value at the position (i, j)

◆ operator[]() [1/2]

template<typename V , size_t N>
value_type etl::fast_magic_view< V, N >::operator[] ( size_t  i)
inline

Returns the element at the given index.

Parameters
iThe index
Returns
a reference to the element at the given index.

◆ operator[]() [2/2]

template<typename V , size_t N>
value_type etl::fast_magic_view< V, N >::operator[] ( size_t  i) const
inline

Returns the element at the given index.

Parameters
iThe index
Returns
a reference to the element at the given index.

◆ read_flat()

template<typename V , size_t N>
value_type etl::fast_magic_view< V, N >::read_flat ( size_t  i) const
inline

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

Parameters
iThe index
Returns
the value at the given index.

◆ visit()

template<typename V , size_t N>
template<typename Visitor >
void etl::fast_magic_view< V, N >::visit ( [[maybe_unused] ] Visitor &&  visitor) const
inline

Apply the given visitor to this expression and its descendants.

Parameters
visitorThe visitor to apply

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