A multi dimensionnal array.
More...
#include <iolink/ArrayX.h>
|
using | ValueType = T |
| The data type of array's elements.
|
|
|
| ArrayX (const VectorXu64 &shape) |
| Create an array with the given shape.
|
|
| ArrayX (const Indexer &indexer) |
| Create an array with a memory layout fitting the given indexer.
|
|
| 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.
|
|
void | setAt (const VectorXu64 &index, T value) |
| Set a value to an element of the array.
|
|
void | reshape (const VectorXu64 &shape) |
| Change the shape of the array.
|
|
const T * | buffer () const |
| Return a pointer to the internal buffer.
|
|
T * | buffer () |
| Return a non-const pointer to the internal buffer.
|
|
std::string | toString () const |
| Return a string representation.
|
|
bool | operator== (const ArrayX &other) const |
|
bool | operator!= (const ArrayX &other) const |
|
template<typename T>
class iolink::ArrayX< T >
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:
- Arrayi8
- Arrayi16
- Arrayi32
- Arrayi64
- Arrayu8
- Arrayu16
- Arrayu32
- Arrayu64
- Arrayf
- Arrayd
- Template Parameters
-
T | The type of element stored in the array. |
- Examples
- serializationArray.cpp.
◆ ArrayX() [1/2]
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.
- Parameters
-
shape | The shape of the array. |
◆ ArrayX() [2/2]
Create an array with a memory layout fitting the given indexer.
- Parameters
-
indexer | the Indexer instance describing the mmeory layout. |
◆ at()
Get an element of the array.
- Warning
- If Array has an empty shape (dimension count = 0), this method has an undefined behavior.
- Parameters
-
index | The index of the element to get. |
◆ reshape()
Change the shape of the array.
- Parameters
-
◆ setAt()
Set a value to an element of the array.
- Warning
- If Array has an empty shape (dimension count = 0), this method has an undefined behavior.
- Parameters
-
index | The index of the element to set. |
value | The value to set at the given index. |
- Examples
- serializationArray.cpp.
The documentation for this class was generated from the following file: