My Project
Public Member Functions | Public Attributes | List of all members
Index Struct Reference

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)
 

Detailed Description

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;

Definition at line 246 of file Util.h.


The documentation for this struct was generated from the following file: