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

View that shows one dimension of a matrix. More...

#include <dim_view.hpp>

Public Types

using sub_type = T
 The sub type.
 
using value_type = value_t< sub_type >
 The value contained in the expression.
 
using memory_type = memory_t< sub_type >
 The memory acess type.
 
using const_memory_type = const_memory_t< sub_type >
 The const memory access type.
 
using return_type = return_helper< sub_type, decltype(std::declval< sub_type >()(0, 0))>
 The type returned by the view.
 
using const_return_type = const_return_helper< sub_type, decltype(std::declval< sub_type >()(0, 0))>
 The const type return by the view.
 

Public Member Functions

 dim_view (sub_type sub, size_t i)
 Construct a new dim_view over the given sub expression. More...
 
const_return_type operator[] (size_t j) const
 Returns the element at the given index. More...
 
return_type operator[] (size_t j)
 Returns the element 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...
 
const_return_type operator() (size_t j) const
 Returns the element at the given index. More...
 
return_type operator() (size_t j)
 Returns the element at the given index. More...
 
template<typename E >
bool alias (const E &rhs) const noexcept
 Test if this expression aliases with the given expression. More...
 

Friends

struct etl_traits< dim_view >
 

Detailed Description

template<typename T, size_t D>
struct etl::dim_view< T, D >

View that shows one dimension of a matrix.

Template Parameters
TThe type of expression on which the view is made
DThe dimension to show

Constructor & Destructor Documentation

◆ dim_view()

template<typename T , size_t D>
etl::dim_view< T, D >::dim_view ( sub_type  sub,
size_t  i 
)
inline

Construct a new dim_view over the given sub expression.

Parameters
subThe sub expression
iThe sub index

Member Function Documentation

◆ alias()

template<typename T , size_t D>
template<typename E >
bool etl::dim_view< T, D >::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 T , size_t D>
const_return_type etl::dim_view< T, D >::operator() ( size_t  j) const
inline

Returns the element at the given index.

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

◆ operator()() [2/2]

template<typename T , size_t D>
return_type etl::dim_view< T, D >::operator() ( size_t  j)
inline

Returns the element at the given index.

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

◆ operator[]() [1/2]

template<typename T , size_t D>
const_return_type etl::dim_view< T, D >::operator[] ( size_t  j) const
inline

Returns the element at the given index.

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

◆ operator[]() [2/2]

template<typename T , size_t D>
return_type etl::dim_view< T, D >::operator[] ( size_t  j)
inline

Returns the element at the given index.

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

◆ read_flat()

template<typename T , size_t D>
value_type etl::dim_view< T, D >::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.

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