20 #include "utilities.hpp"
21 #include "dim_array.hpp"
26 fread_be(&read_size,
sizeof(
int), 1, fd) ;
27 this->resize(read_size) ;
28 fread_be(this->set_data(),
sizeof(
int), size, fd) ;
33 int const size{
static_cast<int>(this->get_size())};
34 fwrite_be(&size,
sizeof(
int), 1, fd) ;
35 fwrite_be(this->get_data(),
sizeof(
int), size, fd) ;
39 ostream& operator<< (ostream& o,
const Dim_array& so) {
41 for (
int i=0 ; i<so.
get_ndim()-1 ; i++)
43 o << so.back() <<
")" ;
Class for storing the dimensions of an array.
int get_ndim() const
Returns the number of dimensions.
Dim_array(int dim)
Standard constructor.
void save(FILE *) const
Save function.
Memory_mapped_array< int > Data_type
Sylvain's stuff.