Public Member Functions | Public Attributes | List of all members
alvar::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. More...
 
 Index (int a, int b)
 Constructor for 2D index. More...
 
 Index (int a, int b, int c)
 Constructor for 3D index. More...
 
bool operator< (const Index &index) const
 Operator used for sorting the multidimensional indices (last dimension being the most significant) More...
 

Public Attributes

std::vector< int > val
 The indices for each dimension are stored in val (last being the most significant) More...
 

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 237 of file Util.h.

Constructor & Destructor Documentation

alvar::Index::Index ( int  a)

Constructor for 1D index.

Definition at line 245 of file Util.cpp.

alvar::Index::Index ( int  a,
int  b 
)

Constructor for 2D index.

Definition at line 247 of file Util.cpp.

alvar::Index::Index ( int  a,
int  b,
int  c 
)

Constructor for 3D index.

Definition at line 252 of file Util.cpp.

Member Function Documentation

bool alvar::Index::operator< ( const Index index) const

Operator used for sorting the multidimensional indices (last dimension being the most significant)

Definition at line 258 of file Util.cpp.

Member Data Documentation

std::vector<int> alvar::Index::val

The indices for each dimension are stored in val (last being the most significant)

Definition at line 239 of file Util.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 19:27:24