|
| ArrayTable () |
|
template<typename... Sizes> |
| ArrayTable (Sizes... sizes) |
|
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 - 1, Indices...>()>> |
Array & | operator() (Indices... indices) |
|
template<typename... Indices, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Indices...>()>> |
double | operator() (Indices... indices) const |
|
template<typename... Indices, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N - 1, Indices...>()>> |
const Array & | operator() (Indices... indices) const |
|
template<typename Index , typename = std::enable_if_t<N == 2 && CompileTimeUtils::isIntegralArgList<1, Index>()>> |
Array & | operator[] (Index index) |
|
template<typename Index , typename = std::enable_if_t<N == 2 && CompileTimeUtils::isIntegralArgList<1, Index>()>> |
const Array & | operator[] (Index index) const |
|
template<typename... Sizes, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Sizes...>()>> |
void | resize (Sizes... sizes) |
|
size_t | rowSize () const |
|
void | setToZero () |
|
size_t | size () const |
|
size_t | size (size_t dim) const |
|
template<size_t N>
class ArrayTable< N >
The ArrayTable<N> class template implements multi-dimensional tables with special support for rows in the last table dimension. Specifically, a ArrayTable<N> instance holds an N-dimensional table of double values. The combination of the first N-1 indices addresses a row in an (N-1)-dimensional table of rows; the last index addresses a column within a row. The values are stored as a list of Array objects, allowing read and write access to individual values as well as to rows of values as a whole.
It is possible and allowed to resize the rows individually through their reference. In that case the caller should ensure that all rows end up with the same size (the ArrayTable implementation does not check this requirement and does not rely on it). Note that the size(N-1) function returns the original row size as it has been specified in the constructor or in the most recent resize() invocation. The rowsize() function returns the size of the first row in the table, or zero if the table is empty.
template<size_t N>
template<typename... Sizes, typename = std::enable_if_t<CompileTimeUtils::isIntegralArgList<N, Sizes...>()>>
This function resizes the table so that it holds the specified number of items in each of the N dimensions. If the last dimension in the list is nonzero, the arrays holding the data are resized correspondingly and all values are set to zero. If the last dimension is zero, the arrays are emptied and should be appropriately resized by the client code. In any case, any values that were previously in the table are lost.