Chi-Tech
|
#include <ndarray.h>
Data Structures | |
struct | bool_pack |
Public Member Functions | |
template<typename D > | |
NDArray (const std::vector< D > &dims) | |
template<typename D , size_t N> | |
NDArray (const std::array< D, N > &dims) | |
template<typename D > | |
NDArray (const std::initializer_list< D > &dims) | |
template<typename D > | |
NDArray (const std::vector< D > &dims, T value) | |
template<typename D , size_t N> | |
NDArray (const std::array< D, N > &dims, T value) | |
template<typename D > | |
NDArray (const std::initializer_list< D > &dims, T value) | |
NDArray () | |
NDArray (NDArray< T > const &other) | |
NDArray< T > & | operator= (NDArray< T > const &other) |
NDArray (NDArray< T > &&other) noexcept | |
NDArray< T > & | operator= (NDArray< T > &&)=delete |
void | set (T value) |
void | swap (NDArray< T > &other) |
size_t | size () const noexcept |
bool | empty () const noexcept |
T * | begin () const noexcept |
const T * | cbegin () const noexcept |
T * | end () const noexcept |
const T * | cend () const noexcept |
T * | data () const noexcept |
size_t | rank () const noexcept |
std::vector< size_t > | dimension () const |
template<typename D > | |
void | resize (const std::vector< D > &dims) |
template<typename D , size_t N> | |
void | resize (const std::array< D, N > &dims) |
template<typename D > | |
void | resize (const std::initializer_list< D > &dims) |
template<typename... Args> | |
T & | operator() (Args... args) noexcept |
template<typename... Args> | |
T const & | operator() (Args... args) const noexcept |
template<typename... Args> | |
T & | at (Args... args) noexcept |
template<typename... Args> | |
size_t | MapNDtoLin (Args... args) const |
~NDArray () | |
Private Types | |
template<class... U> | |
using | conjunction = std::is_same< bool_pack< true, U::value... >, bool_pack< U::value..., true > > |
template<typename... U> | |
using | AllIntegral = typename conjunction< std::is_integral< U >... >::type |
Private Attributes | |
size_t | rank_ |
size_t * | dimensions_ |
size_t * | strides_ |
size_t | size_ |
T * | base_ |
|
private |
|
private |
|
inlineexplicit |
Creates an array with the specified number of elements in each dimension, from a vector-list.
dims | std::vector list of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inlineexplicit |
Creates an array with the specified number of elements in each dimension, from an array.
dims | std::array list of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inline |
Creates an array with the specified number of elements in each dimension, from an initializer-list.
dims | std::vector list of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inlineexplicit |
Creates an array with the specified number of elements in each dimension, from a vector. Each entry in the array is assigned the designated value.
dims | std::vector list of the number of elements in each dimension. |
value | The value to assing to each element. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inlineexplicit |
Creates an array with the specified number of elements in each dimension, from an array. Each entry in the array is assigned the designated value.
dims | std::array list of the number of elements in each dimension. |
value | The value to assing to each element. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inline |
Creates an array with the specified number of elements in each dimension, from an initializer-list. Each entry in the array is assigned the designated value.
dims | std::initializer list of the number of elements in each dimension. |
value | The value to assing to each element. |
std::bad_alloc | if memory allocation fails. |
This constructor creates an array with the specified size.
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
Accesses the specified element with safety checks.
args | The indices of the desired element. |
std::invalid_argument | if the number of arguments are incorrect and std::out_of_range if one of the dimension-indices are out of range. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Returns a linear index to the specified element with safety checks.
args | The indices of the desired element. |
std::invalid_argument | if the number of arguments are incorrect and std::out_of_range if one of the dimension-indices are out of range. |
|
inlinenoexcept |
|
inlinenoexcept |
|
delete |
Deleted move assignment operator
|
inline |
|
inlinenoexcept |
|
inline |
Resizes the array with an array.
dims | std::array of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This method resizes the array to the specified number of elements. If the current size is equal to the new size, no memory allocation occurs.
|
inline |
Resizes the array with an initializer_list.
dims | std::initializer_list of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This method resizes the array to the specified number of elements. If the current size is equal to the new size, no memory allocation occurs.
|
inline |
Resizes the array with a vector.
dims | std::vector of the number of elements in each dimension. |
std::bad_alloc | if memory allocation fails. |
This method resizes the array to the specified number of elements. If the current size is equal to the new size, no memory allocation occurs.
|
inline |
|
inlinenoexcept |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |