IOLink  IOL_v1.2.0_release
iolink::ArrayX< T > Class Template Reference

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)
 
ArrayXoperator= (const ArrayX &other)
 
 ArrayX (ArrayX &&other) noexcept
 
ArrayXoperator= (ArrayX &&other) noexcept
 
size_t dimensionCount () const
 The number of dimensions of the array.
 
const VectorXu64shape () const
 Return the shape of the array.
 
const Indexerindexer () const
 Return the indexer instance used by the array.
 
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 ()
 
std::string toString () const
 Return a string representation.
 

Detailed Description

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
TThe type of element stored in the array.

Constructor & Destructor Documentation

◆ ArrayX() [1/2]

template<typename T >
iolink::ArrayX< T >::ArrayX ( const VectorXu64 shape)
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.

Parameters
shapeThe shape of the array.

◆ ArrayX() [2/2]

template<typename T >
iolink::ArrayX< T >::ArrayX ( const Indexer indexer)
explicit

Create an array with a memory layout fitting the given indexer.

Parameters
indexerthe Indexer instance describing the mmeory layout.

Member Function Documentation

◆ at()

template<typename T >
T iolink::ArrayX< T >::at ( const VectorXu64 index) const

Get an element of the array.

Parameters
indexThe index of the element to get.

◆ buffer()

template<typename T >
T* iolink::ArrayX< T >::buffer ( )

◆ reshape()

template<typename T >
void iolink::ArrayX< T >::reshape ( const VectorXu64 shape)

Change the shape of the array.

Parameters
shapeThe new shape.

◆ setAt()

template<typename T >
void iolink::ArrayX< T >::setAt ( const VectorXu64 index,
value 
)

Set a value to an element of the array.

Parameters
indexThe index of the element to set.
valueThe value to set at the given index.

The documentation for this class was generated from the following file: