23 #include "headcpp.hpp"
30 class Point :
public Memory_mapped {
33 Memory_mapped_array<double>
coord ;
41 for (
int i=0 ; i<
ndim ; i++)
coord[i] = 0 ;
45 void save (FILE*)
const ;
47 double&
set(
int i) {assert(i>0); assert(i<=
ndim);
return coord[i-1] ;}
The class Point is used to store the coordinates of a point.
Memory_mapped_array< double > coord
Array on the coordinates (mainly designed for absolute Cartesian coordinates).
friend ostream & operator<<(ostream &, const Point &)
Display.
double operator()(int i) const
Read only access to a coordinate.
int ndim
Number of dimensions.
void save(FILE *) const
Saving function.
const int & get_ndim() const
Returns the number of dimensions.
Point(int n)
Standard constructor (the coordinates are not affected).
double & set(int i)
Read/write of a coordinate.