NGen
|
#include <mdarray.hpp>
Classes | |
struct | iterator |
Public Types | |
using | value_type = T |
using | container_type = std::vector<value_type> |
using | size_type = typename container_type::size_type |
using | difference_type = typename container_type::difference_type |
using | reference = typename container_type::reference |
using | const_reference = typename container_type::const_reference |
using | pointer = typename container_type::pointer |
using | const_pointer = typename container_type::const_pointer |
Public Member Functions | |
mdarray ()=default | |
mdarray (const boost::span< const size_type > dsizes) | |
constexpr | mdarray (std::initializer_list< size_type > dsizes) |
reference | at (const boost::span< const size_type > n) |
reference | operator[] (const boost::span< const size_type > n) noexcept |
const_reference | at (const boost::span< const size_type > n) const |
const_reference | operator[] (const boost::span< const size_type > n) const noexcept |
void | insert (const boost::span< const size_type > n, value_type value) |
Insert a multi-dimensonal value at the given index. | |
void | insert (std::initializer_list< std::pair< const boost::span< const size_type >, value_type > > args) |
size_type | size () const noexcept |
Get the size of allocated values in this mdarray (aka the allocated elements in the backing vector) | |
iterator | begin () const noexcept |
iterator | end () const noexcept |
size_type | rank () const noexcept |
Get the rank of this mdarray. | |
boost::span< const size_t > | shape () const noexcept |
Get the shape of this mdarray. | |
size_type | index (const boost::span< const size_type > n) const |
Index a multi-dimensional set of indices to a single address index. | |
void | deindex (size_type idx, boost::span< size_type > n) const |
Retrieve the multi-dimensional index from a given address index. | |
Public Attributes | |
friend | iterator |
Private Member Functions | |
template<typename Tp > | |
size_type | max_size (Tp shape) |
void | bounds_check (const boost::span< const size_type > n) const |
Private Attributes | |
std::vector< size_type > | m_shape |
container_type | m_data |
using ngen::mdarray< T >::const_pointer = typename container_type::const_pointer |
using ngen::mdarray< T >::const_reference = typename container_type::const_reference |
using ngen::mdarray< T >::container_type = std::vector<value_type> |
using ngen::mdarray< T >::difference_type = typename container_type::difference_type |
using ngen::mdarray< T >::pointer = typename container_type::pointer |
using ngen::mdarray< T >::reference = typename container_type::reference |
using ngen::mdarray< T >::size_type = typename container_type::size_type |
using ngen::mdarray< T >::value_type = T |
|
default |
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
|
inlinenoexcept |
References ngen::mdarray< T >::iterator.
|
inlineprivate |
References ngen::mdarray< T >::m_shape.
Referenced by ngen::mdarray< T >::at(), ngen::mdarray< T >::at(), and ngen::mdarray< T >::insert().
|
inline |
Retrieve the multi-dimensional index from a given address index.
[in] | idx | Address index (aka flat index) |
[out] | n | outputted index |
References ngen::mdarray< T >::m_shape, ngen::mdarray< T >::rank(), and ngen::mdarray< T >::size().
|
inlinenoexcept |
References ngen::mdarray< T >::iterator, and ngen::mdarray< T >::m_data.
|
inline |
Index a multi-dimensional set of indices to a single address index.
n |
References ngen::mdarray< T >::index(), ngen::mdarray< T >::m_shape, ngen::mdarray< T >::rank(), and ngen::mdarray< T >::size().
Referenced by ngen::mdarray< T >::at(), ngen::mdarray< T >::at(), ngen::mdarray< T >::index(), ngen::mdarray< T >::insert(), ngen::mdarray< T >::operator[](), and ngen::mdarray< T >::operator[]().
|
inline |
Insert a multi-dimensonal value at the given index.
n | A multi-dimensional index with the same size as m_shape . |
value | The value to set at the given index. |
References ngen::mdarray< T >::bounds_check(), ngen::mdarray< T >::index(), and ngen::mdarray< T >::m_data.
Referenced by ngen::mdarray< T >::insert().
|
inline |
References ngen::mdarray< T >::insert().
|
inlineprivate |
References ngen::mdarray< T >::shape().
|
inlinenoexcept |
References ngen::mdarray< T >::index(), and ngen::mdarray< T >::m_data.
|
inlinenoexcept |
References ngen::mdarray< T >::index(), and ngen::mdarray< T >::m_data.
|
inlinenoexcept |
Get the rank of this mdarray.
References ngen::mdarray< T >::m_shape.
Referenced by ngen::mdarray< T >::deindex(), and ngen::mdarray< T >::index().
|
inlinenoexcept |
Get the shape of this mdarray.
References ngen::mdarray< T >::m_shape.
Referenced by ngen::mdarray< T >::max_size().
|
inlinenoexcept |
Get the size of allocated values in this mdarray (aka the allocated elements in the backing vector)
References ngen::mdarray< T >::m_data.
Referenced by ngen::mdarray< T >::deindex(), and ngen::mdarray< T >::index().
friend ngen::mdarray< T >::iterator |
Referenced by ngen::mdarray< T >::begin(), and ngen::mdarray< T >::end().
|
private |
|
private |