MultiIndex
Public Member Functions | Public Attributes
Multitable< T > Struct Template Reference

#include <multitable.hpp>

Collaboration diagram for Multitable< T >:
Collaboration graph
[legend]

List of all members.

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)
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

Detailed Description

template<class T>
struct Multitable< T >

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.


Constructor & Destructor Documentation

template<class T >
Multitable< T >::Multitable ( const vector< int > &  dimensions = vector<int>())

This constructor gets width of table for each dimension

Parameters:
dimensionsarray of sizes of table along each dimension

Member Function Documentation

template<class T >
int Multitable< T >::GetCellGlobalIndex ( const vector< int > &  cell_indices) const

Function converts cell coordinates to global index in a long array

Parameters:
cell_indicescoordinates of cell in the table
template<class T >
T Multitable< T >::GetValue ( const vector< int > &  cell_indices)

This function gets value of one cell

Parameters:
cell_indicescoordinates of cell in the table
template<class T>
void Multitable< T >::Resize ( const vector< int > &  dimensions,
value = T() 
)

This function resize the table to new dimensions

Parameters:
dimensionsarray of sizes of table along each dimension
template<class T>
template<class Archive >
void Multitable< T >::serialize ( Archive &  arc,
unsigned int  version 
) [inline]

Function for Boost.Serialization

template<class T>
void Multitable< T >::SetValue ( value,
const vector< int > &  cell_indices 
)

This function sets value in one cell

Parameters:
valuevalue to set
cell_indicescoordinates of cell in the table

Member Data Documentation

template<class T>
vector<int> Multitable< T >::dimensions

Dimensions of table

template<class T>
vector<T> Multitable< T >::table

Actual data as one-dimensional array


The documentation for this struct was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator