MultiIndex
|
#include <multitable.hpp>
Public Member Functions | |
Multitable (const vector< int > &dimensions=vector< int >()) | |
void | Resize (const vector< int > &dimensions, T value=T()) |
void | SetValue (T value, const vector< int > &cell_indices) |
T | GetValue (const vector< int > &cell_indices) |
template<class Archive > | |
void | serialize (Archive &arc, unsigned int version) |
int | GetCellGlobalIndex (const vector< int > &cell_indices) const |
Public Attributes | |
vector< T > | table |
vector< int > | dimensions |
This class implements interface of multidimensional array with fast write/read operations. In fact data is stored in a long array. Global index of particular item in this array is calculated from item coordinates.
Multitable< T >::Multitable | ( | const vector< int > & | dimensions = vector<int>() | ) |
This constructor gets width of table for each dimension
dimensions | array of sizes of table along each dimension |
int Multitable< T >::GetCellGlobalIndex | ( | const vector< int > & | cell_indices | ) | const |
Function converts cell coordinates to global index in a long array
cell_indices | coordinates of cell in the table |
T Multitable< T >::GetValue | ( | const vector< int > & | cell_indices | ) |
This function gets value of one cell
cell_indices | coordinates of cell in the table |
void Multitable< T >::Resize | ( | const vector< int > & | dimensions, |
T | value = T() |
||
) |
This function resize the table to new dimensions
dimensions | array of sizes of table along each dimension |
void Multitable< T >::serialize | ( | Archive & | arc, |
unsigned int | version | ||
) | [inline] |
Function for Boost.Serialization
void Multitable< T >::SetValue | ( | T | value, |
const vector< int > & | cell_indices | ||
) |
This function sets value in one cell
value | value to set |
cell_indices | coordinates of cell in the table |
vector<int> Multitable< T >::dimensions |
Dimensions of table
vector<T> Multitable< T >::table |
Actual data as one-dimensional array