lin
|
Tensor interface providing read only access to elements. More...
#include <lin/core/types/stream.hpp>
Public Types | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
Public Member Functions | |
constexpr | Stream (Stream< D > const &)=default |
constexpr | Stream (Stream< D > &&)=default |
constexpr Stream< D > & | operator= (Stream< D > const &)=default |
constexpr Stream< D > & | operator= (Stream< D > &&)=default |
constexpr size_t | rows () const |
constexpr size_t | cols () const |
constexpr size_t | size () const |
constexpr Traits::elem_t | operator() (size_t i, size_t j) const |
Provides read only access to tensor elements. More... | |
constexpr Traits::elem_t | operator() (size_t i) const |
Provides read only access to tensor elements. More... | |
constexpr Traits::elem_t | operator[] (size_t i) const |
Provides read only access to tensor elements. More... | |
constexpr Traits::eval_t | eval () const |
Forces evaluation of this stream to a value backed type. More... | |
Protected Member Functions | |
constexpr D & | derived () |
constexpr D const & | derived () const |
Tensor interface providing read only access to elements.
D | Derived type. |
This is the first of the three main entry points on the lin inheritance tree and is therefore the parent class for all other tensor types.
All that is provided at this level is read only access to tensor elements and dimension information. It also adds the ability to force the evaluation of any tensor stream to a value backed object.
This class, and the entire inheritance tree, employs the curiosly recurring template patter (CRTP). As such, derived types are required to implement most of the methods listed in this class.
It's main purpose is to provide an interface the supports lazy evaluation.
typedef traits<D> lin::internal::Stream< D >::Traits |
Traits information for this type.
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
This is always the number of rows times the number of columns in the tensor.
|
inline |
Provides read only access to tensor elements.
i | Row index. |
j | Column index. |
If accessing data from a lazily evaluation tensor operation, you may want to consider for the creation of a value backed type to reduce overhead.
|
inline |
Provides read only access to tensor elements.
i | Index. |
Element access proceeds as if all the elements of the tensor stream were flattened into an array in row major order.
If accessing data from a lazily evaluation tensor operation, you may want to consider for the creation of a value backed type to reduce overhead.
|
inline |
Provides read only access to tensor elements.
i | Index. |
Element access proceeds as if all the elements of the tensor stream were flattened into an array in row major order.
If accessing data from a lazily evaluation tensor operation, you may want to consider for the creation of a value backed type to reduce overhead.
|
inline |
Forces evaluation of this stream to a value backed type.
This is especially useful when working with a proxy to a lazily evaluated expression.
The return type is dependant on the evaluation type stored in its traits.