3#include <iolink/DataType.h>
4#include <iolink/MemoryLayout.h>
5#include <iolink/VectorX.h>
164 bool operator==(
const Indexer& other)
const;
165 bool operator!=(
const Indexer& other)
const;
Stores information about a data type.
Definition: DataType.h:162
This class is used to index a classic array into a multi dimensional array.
Definition: Indexer.h:36
Indexer(const VectorXu64 &shape, DataType dtype)
Constructor with shape and datatype, using default layout and stride.
Indexer(const VectorXu64 &shape, MemoryLayout standardLayout)
Auto compute the Indexer's strides from shape and standard layout.
Indexer(const VectorXu64 &shape, DataType dtype, const VectorXu64 &byteStride)
Constructor with shape, datatype and byte stride, using default layout.
const VectorXu64 & byteStride() const
size_t stride(size_t index) const
Return the current stride for given dimension.
Indexer(const VectorXu64 &shape, DataType dtype, const VectorXu64 &byteStride, const VectorXu64 &layout)
Constructor with shape, datatype, byte stride and layout.
const VectorXu64 & layout() const
Return the layout dimension order.
size_t offset(const VectorXu64 &index) const
Return the computed 1D offset corresponding to indexed sample in multi dimensional array.
Indexer(const VectorXu64 &shape, const VectorXu64 &stride, MemoryLayout standardLayout)
Create an indexer by giving all its informations.
size_t elementCount() const
Returns the number of elements managed by this Indexer.
size_t byteOffset(const VectorXu64 &index) const
Computes the offset in bytes to the given index.
const VectorXu64 & shape() const
Return the shape.
Indexer(const VectorXu64 &shape, DataType dtype, MemoryLayout standardLayout)
Constructor with shape, datatype and standard layout, using default stride.
Indexer(const VectorXu64 &shape, const VectorXu64 &layout)
Initialize the indexer using a custom memory layout.
size_t byteStride(size_t index) const
const VectorXu64 & stride() const
Return the stride.
Indexer(const VectorXu64 &shape, const VectorXu64 &stride, const VectorXu64 &layout)
Create an indexer by giving all its informations.
size_t byteCount() const
Get the total number of bytes needed to adress this indexer, taking the padding into account.
size_t layout(size_t index) const
Return the dimension index of the nth one in order.
size_t shape(size_t index) const
Return the current size for given dimension.
size_t dimensionCount() const
The number of dimensions managed by this indexer.
Indexer(const VectorXu64 &shape)
Simpliest way to initialize an indexer from a shape.
bool isContinuous() const
Checks if the indexed elements are contiguous.
A dynamically sized arithmetic vector.
Definition: VectorX.h:18
All IOLink symbols are enclosed in this namespace.
Definition: ArrayX.h:8
MemoryLayout
This enum indicates how a multidimensionnal array is stored in continuous memory.
Definition: MemoryLayout.h:11