13#ifndef CXXUTILS_ARRAYREP_H
14#define CXXUTILS_ARRAYREP_H
79 const std::string& context =
"");
88 explicit Arrayrep (
const std::vector<unsigned int>& shape);
99 explicit Arrayrep (
const unsigned int shape[],
unsigned int n);
143 void write_subarray(std::ostream& stream, std::vector<Arrayelt>::size_type& idx,
unsigned dimIndex)
const;
Namespace for helper functions.
float Arrayelt
The type of an element of an Array.
Representation class for Array's.
void write_array(std::ostream &stream) const
Creates a text representation of the array content.
void write_subarray(std::ostream &stream, std::vector< Arrayelt >::size_type &idx, unsigned dimIndex) const
Helper function for write_array.
std::vector< Arrayelt > m_data
The array data, stored using the C array ordering.
void init_sizes(bool resize_data=false)
Initialize the m_sizes vector from the m_shape vector.
Arrayrep()
Default constructor.
std::vector< unsigned int > m_sizes
Subarray sizes, for faster access.
std::vector< unsigned int > m_shape
The array shape.