|
lin
|
Member pointer backed tensor. More...
#include <lin/views/tensor_view.hpp>
Public Types | |
| typedef traits< D > | Traits |
| Traits information for this type. More... | |
Public Types inherited from lin::internal::Base< D > | |
| typedef traits< D > | Traits |
| Traits information for this type. More... | |
Public Types inherited from lin::internal::Mapping< D > | |
| typedef traits< D > | Traits |
| Traits information for this type. More... | |
Public Types inherited from lin::internal::Stream< D > | |
| typedef traits< D > | Traits |
| Traits information for this type. More... | |
Public Member Functions | |
| constexpr | TensorView (TensorView< D > const &)=default |
| constexpr | TensorView (TensorView< D > &&)=default |
| constexpr TensorView< D > & | operator= (TensorView< D > const &)=default |
| constexpr TensorView< D > & | operator= (TensorView< D > &&)=default |
| constexpr | TensorView (typename Traits::elem_t *elems) |
| Constructs a new tensor tensor view with the provided backing array. More... | |
| constexpr | TensorView (typename Traits::elem_t *elems, size_t r, size_t c) |
| Constructs a new tensor tensor view with the provided backing array and requested dimensions. More... | |
| constexpr Traits::elem_t * | data () |
| Retrives a pointer to the element backing array. More... | |
Public Member Functions inherited from lin::internal::Base< D > | |
| constexpr | Base (Base< D > const &)=default |
| constexpr | Base (Base< D > &&)=default |
| constexpr Base< D > & | operator= (Base< D > const &)=default |
| constexpr Base< D > & | operator= (Base< D > &&)=default |
| constexpr Traits::elem_t * | data () |
| Retrives a pointer to the element backing array. More... | |
| constexpr Traits::elem_t const * | data () const |
| Retrives a constant pointer to the element backing array. More... | |
| constexpr Traits::elem_t & | operator() (size_t i, size_t j) |
| Provides read and write access to tensor elements. More... | |
| constexpr Traits::elem_t & | operator() (size_t i) |
| Provides read and write access to tensor elements. More... | |
Public Member Functions inherited from lin::internal::Mapping< D > | |
| constexpr | Mapping (Mapping< D > const &)=default |
| constexpr | Mapping (Mapping< D > &&)=default |
| constexpr Mapping< D > & | operator= (Mapping< D > const &)=default |
| constexpr Mapping< D > & | operator= (Mapping< D > &&)=default |
| constexpr Traits::elem_t & | operator() (size_t i, size_t j) |
| Provides read and write access to tensor elements. More... | |
| 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) |
| Provides read and write 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) |
| Provides read and write access to tensor elements. More... | |
| constexpr Traits::elem_t | operator[] (size_t i) const |
| Provides read only access to tensor elements. More... | |
| template<typename T , std::enable_if_t< is_detected< assign_expr, typename Traits::elem_t, T >::value, size_t > = 0> | |
| constexpr D & | operator= (std::initializer_list< T > const &list) |
| Copy an initializer list's elements into the tensor's elements. More... | |
| template<class C , std::enable_if_t< conjunction< have_same_dimensions< D, C >, is_detected< assign_expr, typename Traits::elem_t, traits_elem_t< C >> >::value, size_t > = 0> | |
| constexpr D & | operator= (Stream< C > const &s) |
| Copy another tensor's elements into this tenosr's elements. More... | |
Public Member Functions inherited from lin::internal::Stream< D > | |
| 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... | |
Public Member Functions inherited from lin::internal::Dimensions< D > | |
| 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 | elems |
Additional Inherited Members | |
Protected Member Functions inherited from lin::internal::Stream< D > | |
| constexpr D & | derived () |
| constexpr D const & | derived () const |
Member pointer backed 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::TensorView< D >::Traits |
Traits information for this type.
|
inline |
Constructs a new tensor tensor view with the provided backing array.
| elems | 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 tensor tensor view with the provided backing array and requested dimensions.
| elems | 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 pointer to the element backing array.
This is the same buffer the tensor view was constructed with.
1.8.11