IOLink
IOL_v1.1.0_release
|
A multi dimensionnal array. More...
#include <iolink/ArrayX.h>
Public Types | |
using | ValueType = T |
The data type of array's elements. | |
Public Member Functions | |
ArrayX (const VectorXu64 &shape) | |
Create an array with the given shape. More... | |
ArrayX (const Indexer &indexer) | |
Create an array with a memory layout fitting the given indexer. More... | |
ArrayX (const ArrayX &other) | |
ArrayX & | operator= (const ArrayX &other) |
ArrayX (ArrayX &&other) noexcept | |
ArrayX & | operator= (ArrayX &&other) noexcept |
size_t | dimensionCount () const |
The number of dimensions of the array. | |
const VectorXu64 & | shape () const |
Return the shape of the array. | |
const Indexer & | indexer () const |
Return the indexer instance used by the array. | |
T | at (const VectorXu64 &index) const |
Get an element of the array. More... | |
void | setAt (const VectorXu64 &index, T value) |
Set a value to an element of the array. More... | |
void | reshape (const VectorXu64 &shape) |
Change the shape of the array. More... | |
const T * | buffer () const |
Return a pointer to the internal buffer. | |
T * | buffer () |
A multi dimensionnal array.
This class should not be used as is, you must use its aliases or it will not work. The current aliases are:
T | The type of element stored in the array. |
|
explicit |
Create an array with the given shape.
The memory layout of the array will be the default one used by IOLink, the Fortran one, in wich the leftmost dimension is the continuous one.
shape | The shape of the array. |
|
explicit |
Create an array with a memory layout fitting the given indexer.
indexer | the Indexer instance describing the mmeory layout. |
T iolink::ArrayX< T >::at | ( | const VectorXu64 & | index | ) | const |
Get an element of the array.
index | The index of the element to get. |
T* iolink::ArrayX< T >::buffer | ( | ) |
void iolink::ArrayX< T >::reshape | ( | const VectorXu64 & | shape | ) |
Change the shape of the array.
shape | The new shape. |
void iolink::ArrayX< T >::setAt | ( | const VectorXu64 & | index, |
T | value | ||
) |
Set a value to an element of the array.
index | The index of the element to set. |
value | The value to set at the given index. |