lin
|
Value backed, read only tensor interface. More...
#include <lin/core/types/const_base.hpp>
Public Types | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
![]() | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
Public Member Functions | |
constexpr | ConstBase (ConstBase< D > const &)=default |
constexpr | ConstBase (ConstBase< D > &&)=default |
constexpr ConstBase< D > & | operator= (ConstBase< D > const &)=default |
constexpr ConstBase< D > & | operator= (ConstBase< D > &&)=default |
constexpr Traits::elem_t const * | data () const |
Retrives a constant pointer to the element backing array. More... | |
constexpr Traits::elem_t const & | operator() (size_t i, size_t j) const |
Provides read only access to tensor elements. More... | |
constexpr Traits::elem_t const & | operator() (size_t i) |
Provides read only access to tensor elements. More... | |
![]() | |
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... | |
![]() | |
constexpr | Dimensions (Dimensions< D > const &)=default |
constexpr | Dimensions (Dimensions< D > &&)=default |
constexpr Dimensions< D > & | operator= (Dimensions< D > const &)=default |
constexpr Dimensions< D > & | operator= (Dimensions< D > &&)=default |
constexpr size_t | rows () const |
constexpr size_t | cols () const |
constexpr void | resize (size_t r, size_t c) |
Resizes a tensor's dimensions. More... | |
Additional Inherited Members | |
![]() | |
constexpr D & | derived () |
constexpr D const & | derived () const |
Value backed, read only tensor interface.
D | Derived type. |
This is the third of the three main entry points on the lin inheritance tree after internal::Mapping.
Here, direct tracking of runtime dimensions and the ability to resize is added. A getter to retrive a pointer to the element backing array is also included.
The main purpose is to provide an interface that supports value backed types - i.e. those directly storing tensor elements in a member array or and a pointer.
typedef traits<D> lin::internal::ConstBase< D >::Traits |
Traits information for this type.
|
inline |
Retrives a constant pointer to the element backing array.
The elements of the tensor are layed out in row major order in the backing array. They are stored contiguously in memory.
|
inline |
Provides read only access to tensor elements.
i | Row index. |
j | Column index. |
If the indices are out of bounds as defined by the tensor's current dimensions, lin assertion errors will be triggered.
|
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 the index is out of bounds as defined by the tensor's current size, lin lin assertion errors will be triggered.