#include <Cube.hpp>
Classes | |
class | BadSize |
class | BoundsViolation |
Public Member Functions | |
Cube (unsigned nx, unsigned ny, unsigned nz) | |
constructor | |
void | resize (unsigned nx, unsigned ny, unsigned nz) |
resize the cube | |
T & | operator() (unsigned i, unsigned j, unsigned k) |
const T & | operator() (unsigned i, unsigned j, unsigned k) const |
unsigned | nx () const |
unsigned | ny () const |
unsigned | nz () const |
Private Attributes | |
std::vector< std::vector < std::vector< T > > > | _data |
Note: bounds checking is done for the supscript operaters () so don't use this class is speed is of the essence, or implement a method allowing element access without checking the bounds.
vector of vectors of vectors storing the data. Note that we could use just a std::vector<T>, replacing _data[i][j][k] by _data[i*ny*nz + j*nz + k]