20 #ifndef __DIM_ARRAY_HPP_
21 #define __DIM_ARRAY_HPP_
23 #include "headcpp.hpp"
54 int&
set(
int i) {assert(i>=0); assert(i<size);
return data[i];}
59 int operator() (
int i)
const {assert(i>=0); assert(i<size);
return data[i];}
67 void operator= (
const Dim_array& so) {assert (size==so.size);
for (
int i=0 ;i<size;i++) data[i] = so.data[i];}
71 void save (FILE*)
const ;
78 ostream& operator<< (ostream&,
const Dim_array&) ;
79 inline bool operator== (
const Dim_array& a,
const Dim_array& b) {
80 bool res = (a.get_ndim()==b.get_ndim()) ?
true :
false ;
82 for (
int i=0 ; i<a.get_ndim() && res ; i++)
87 inline bool operator!= (
const Dim_array& a,
const Dim_array& b) {
return !(a==b) ;}
Class for storing the dimensions of an array.
int get_ndim() const
Returns the number of dimensions.
Dim_array(int dim)
Standard constructor.
int & set(int i)
Read/write of the size of a given dimension.
void save(FILE *) const
Save function.
Dim_array(const Dim_array &so)
Copy constructor.
int operator()(int i) const
Read only of the size of a given dimension.
Dim_array & operator=(Dim_array &&so)
Operator =.
int size_type
Sylvain's stuff.
Dim_array(Dim_array &&so)
Move constructor.
void swap(Dim_array &so)
Sylvain's stuff.
void operator=(const Dim_array &so)
Assignement to annother Dim_array.
Memory_mapped_array< int > Data_type
Sylvain's stuff.