|
| | Grid (const IdxVector &size=IdxVector::Zero(), const T &val=T()) |
| | Construct a grid of a given size and fill it with the given value.
|
| |
| | Grid (const IdxVector &size, const T *values) |
| | Construct a grid of a given size with values in ()-major format.
|
| |
|
| Grid (const Grid< T, D > &other)=default |
| | Copy constructor and assignment operator.
|
| |
|
Grid & | operator= (const Grid< T, D > &other)=default |
| |
| uint | size () const |
| | Returns the number of elements stored.
|
| |
| const IdxVector & | sizeVector () const |
| | Returns the size vector (a D-dimensional vector with the size along each dimension).
|
| |
| bool | empty () const |
| | Returns true if the grid is empty (i.e. if size() ==0).
|
| |
| void | clear () |
| | Erases all data and makes the grid empty.
|
| |
|
const T & | at (const IdxVector &idx) const |
| | Access an element with a D-dimensional index.
|
| |
|
T & | at (const IdxVector &idx) |
| |
| const T & | at (uint idx) const |
| | Access an element with a linear index.
|
| |
| T & | at (uint idx) |
| |
|
const T & | at (const Iterator &it) const |
| | Access an element with an iterator.
|
| |
|
T & | at (const Iterator &it) |
| |
| const T * | data () const |
| | Read only access to the underlying data.
|
| |
| T * | data () |
| | Read-write access to the underlying data.
|
| |
| Iterator | begin () |
| | Get an iterator on this grid at the first element.
|
| |
| Iterator | begin () const |
| |
| Iterator | end () |
| | Get an iterator on this grid past the last element.
|
| |
| Iterator | end () const |
| |
template<typename T, uint D>
class Ra::Core::Grid< T, D >
This class stores a D-dimensional grid of elements of arbitrary type. in a contiguous memory block. Elements are stored in column-major order. e.g. for a 3x3x3 array the element vector looks like [A000, A100, A200, A010,... A222]. Elements are accessible with a D-dimensional Vector, or linearly with iterators, thanks to the std-like interface provided.
Definition at line 17 of file Grid.hpp.