lin
|
Member pointer backed constant tensor. More...
#include <lin/views/const_tensor_view.hpp>
Public Types | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
![]() | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
![]() | |
typedef traits< D > | Traits |
Traits information for this type. More... | |
Public Member Functions | |
constexpr | ConstTensorView (ConstTensorView< D > const &)=default |
constexpr | ConstTensorView (ConstTensorView< D > &&)=default |
constexpr ConstTensorView< D > & | operator= (ConstTensorView< D > const &)=default |
constexpr ConstTensorView< D > & | operator= (ConstTensorView< D > &&)=default |
constexpr | ConstTensorView (typename Traits::elem_t const *elems) |
Constructs a new constant tensor tensor view with the provided backing array. More... | |
constexpr | ConstTensorView (typename Traits::elem_t const *elems, size_t r, size_t c) |
Constructs a new constant tensor tensor view with the provided backing array and requested dimensions. More... | |
constexpr Traits::elem_t const * | data () const |
Retrives a constant pointer to the element backing array. More... | |
![]() | |
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... | |
Private Attributes | |
Traits::elem_t const *const | elems |
Additional Inherited Members | |
![]() | |
constexpr D & | derived () |
constexpr D const & | derived () const |
Member pointer backed constant tensor.
D | Derived type. |
This allows users to interpret arbitrary buffers as tensor objects. The user specified buffer is assumed to be at least as large as the tensor's maximum size and elements are read and written to the buffer in row major order.
typedef traits<D> lin::internal::ConstTensorView< D >::Traits |
Traits information for this type.
|
inline |
Constructs a new constant tensor tensor view with the provided backing array.
elems | Constant element backing array. |
The element backing array is a assumed to be in row major order. Elements of the tensor initially hold whatever values were left in the backing array.
The backing array should be at least as large as the maximum size of the tensor (see internal::traits information).
The size of the tensor defaults to the maximum allowed size.
|
inline |
Constructs a new constant tensor tensor view with the provided backing array and requested dimensions.
elems | Constant element backing array. |
r | Initial row dimension. |
c | Initial column dimension. |
The element backing array is a assumed to be in row major order. Elements of the tensor initially hold whatever values were left in the backing array.
The backing array should be at least as large as the maximum size of the tensor (see internal::traits information).
Lin assertions errors will be triggered if the requested dimensions aren't possible given the tensor's traits.
|
inline |
Retrives a constant pointer to the element backing array.
This is the same buffer the tensor view was constructed with.