#include <Table.hpp>
Public Member Functions | |
Table () | |
template<typename... Sizes> | |
Table (Sizes... sizes) | |
Array & | data () |
const Array & | data () const |
template<typename... Indices, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Indices...>()>> | |
size_t | flattenedIndex (Indices... indices) const |
template<typename... Indices, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Indices...>()>> | |
double & | operator() (Indices... indices) |
template<typename... Indices, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Indices...>()>> | |
double | operator() (Indices... indices) const |
template<typename Index , typename = std::enable_if_t<N == 1 && CompileTimeUtils::isIntegralArgList<1, Index>()>> | |
double & | operator[] (Index index) |
template<typename Index , typename = std::enable_if_t<N == 1 && CompileTimeUtils::isIntegralArgList<1, Index>()>> | |
double | operator[] (Index index) const |
template<typename... Sizes, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Sizes...>()>> | |
void | resize (Sizes... sizes) |
void | setToZero () |
size_t | size () const |
size_t | size (size_t dim) const |
Private Attributes | |
Array | _data |
std::array< size_t, N > | _sizes |
An instance of the Table<N> class template holds an N-dimensional table of double values, offering indexed access for reading and writing individual values. All values are stored in a single data array. Values with adjacent rightmost indices are stored next to each other.
This constructor constructs a table holding the specified number of items in each of the N dimensions. All values are set to zero.
This function returns a writable reference to the underlying data array. Resizing the array other than through the Table::resize() function results in unpredictable behavior.
This function returns a read-only reference to the underlying data array.
|
inline |
This template function returns the flattened index in the underlying data array for the specified N indices.
|
inline |
This function returns a writable reference to the value at the specified N indices. There is no range checking. Out-of-range index values cause unpredictable behavior.
|
inline |
This function returns a copy of the value at the specified N indices. There is no range checking. Out-of-range index values cause unpredictable behavior.
|
inline |
This function returns a writable reference to the value at the specified index (for a one-dimensional table only). There is no range checking. Out-of-range index values cause unpredictable behavior.
|
inline |
This function returns a copy of the value at the specified index (for a one-dimensional table only). There is no range checking. Out-of-range index values cause unpredictable behavior.
|
inline |
This function resizes the table so that it holds the specified number of items in each of the N dimensions. All values are set to zero, i.e. any values that were previously in the table are lost.
|
inline |
This function sets all values in the table to zero, without changing the number of items.
|
inline |
This function returns the total number of items in the table.
|
inline |
This function returns the number of items in the dimension indicated by the specified zero-based index.