1 #ifndef MATIOCPP_MULTIDIMENSIONALARRAY_H
2 #define MATIOCPP_MULTIDIMENSIONALARRAY_H
MultiDimensionalArray is a particular type of Variable specialized for multidimensional arrays of a g...
index_type numberOfElements() const
Get the total number of elements in the array.
reference operator[](const std::vector< index_type > &el)
Access specified element.
matioCpp::Span< element_type > toSpan()
Get this MultiDimensionalArray as a Span.
value_type operator()(const std::vector< index_type > &el) const
Access specified element.
~MultiDimensionalArray()
Destructor.
reference operator()(index_type el)
Access specified element.
MultiDimensionalArray()
The const pointer type.
value_type operator[](index_type el) const
Access specified element.
typename std::allocator_traits< std::allocator< element_type > >::const_pointer const_pointer
The pointer type.
MultiDimensionalArray< T > & operator=(const MultiDimensionalArray< T > &other)
Assignement operator (copy) from another MultiDimensionalArray.
reference operator[](index_type el)
Access specified element.
value_type operator()(index_type el) const
Access specified element.
bool setName(const std::string &newName)
Change the name of the Variable.
bool fromVectorizedArray(const std::vector< index_type > &dimensions, const_pointer inputVector)
Set from a vectorized array.
value_type operator[](const std::vector< index_type > &el) const
Access specified element.
bool indicesFromRawIndex(size_t rawIndex, std::vector< index_type > &el) const
Get the indices given the raw index.
typename get_type< T >::type element_type
Defines the type specified in the template.
reference operator()(const std::vector< index_type > &el)
Access specified element.
MultiDimensionalArray(const std::string &name, const std::vector< index_type > &dimensions)
Constructor.
void clear()
Clear the multidimensional array.
void resize(const std::vector< index_type > &newDimensions)
Resize the vector.
pointer data()
Direct access to the underlying array.
MultiDimensionalArray(const std::string &name, const std::vector< index_type > &dimensions, const_pointer inputVector)
Constructor.
size_t index_type
Defines how to allocate T.
typename std::allocator_traits< std::allocator< element_type > >::pointer pointer
The reference type.
element_type & reference
The type used for indices.
std::remove_cv_t< element_type > value_type
Defines the type of an element of the MultiDimensionalArray.
index_type rawIndexFromIndices(const std::vector< index_type > &el) const
Get the index in the vectorized array corresponding to the provided indices.
The matioCpp::Variable class is the equivalent of matvar_t in matio.
std::string name() const
Get the name of the Variable.
matioCpp::Span< const size_t > dimensions() const
Get the dimensions of this object.
matioCpp::VariableType variableType() const
Get the VariableType.
matioCpp::ValueType valueType() const
Get the ValueType.
VariableType
Define the type of variable.
ValueType
The list of types for an element of a certain variable type.
Utility metafunction to get the ValueType from a given primitive type.