![]() |
My Project
|
Class for N-dimensional index to be used e.g. with STL maps. More...
#include <Util.h>
Public Member Functions | |
Index (int a) | |
Constructor for 1D index. | |
Index (int a, int b) | |
Constructor for 2D index. | |
Index (int a, int b, int c) | |
Constructor for 3D index. | |
bool | operator< (const Index &index) const |
Operator used for sorting the multidimensional indices (last dimension being the most significant) | |
Public Attributes | |
std::vector< int > | val |
The indices for each dimension are stored in val (last being the most significant) | |
Class for N-dimensional index to be used e.g. with STL maps.
The idea is that if you want to sort N-dimensional pointers (e.g. when they are stored in STL maps) it is enough to have the 'operator<' working, instead of needing to calculate something like i=z*x_res*y_res + y*x_res + x;