Template Struct NDArray#

Struct Documentation#

template<typename Element>
struct NDArray#

A type representing an N-dimensional array

Template Parameters:

Element – the type of each element in this array

Public Functions

inline explicit NDArray(NDSize size)#

Initialize an NDArray with an N-dimensional size

inline NDArray(NDSize size, Element defaultValue)#

Initialize an NDArray with an N-dimensional size and initialize all the elements to the provided value

inline NDArray(NDSize size, std::initializer_list<Element> initList)#

Initialize an NDArray with an N-dimensional size and initialize each element with a brace init list

inline const NDSize &size() const noexcept#

The N-dimensional size of this N-dimensional array

inline Size flattenedSize() const noexcept#

The flattened version size of this N-dimensional array, which is the total number of elements

inline Dimension dimensions() const noexcept#
inline Element &operator[](const NDIndex &index)#

Get the element at specified N-dimensional index

inline const Element &operator[](const NDIndex &index) const#

Get the element at specified N-dimensional index

inline Element &flattenedAt(const Index flattenedIndex)#

Get the element at the specified flattened index

inline const Element &flattenedAt(const Index flattenedIndex) const#

Get the element at the specified flattened index

inline Element *data() noexcept#
inline const Element *data() const noexcept#
inline auto begin() noexcept#
inline auto end() noexcept#
inline auto begin() const noexcept#
inline auto end() const noexcept#