35#ifndef _CMGRAPHS_MAPTYPE_H_
36#define _CMGRAPHS_MAPTYPE_H_
44#include "chomp/multiwork/mwdata.h"
45#include "chomp/system/textfile.h"
69 virtual void setParam (
const double *left,
const double *right,
85 virtual void compute (
const double *xleft,
const double *xright,
86 double *yleft,
double *yright,
int dim,
87 const spcCoord *coord,
int subdiv)
const = 0;
91 int dim,
const spcCoord *coord,
int subdiv)
const;
97 bool adjust (
bool successful,
int subdiv);
126 virtual std::string
name ()
const;
188 for (
int i = 0; i <
nParam; ++ i)
199 throw "Requested left parameter not defined.";
206 throw "Requested right parameter not defined.";
211 int dim,
const spcCoord *coord,
int subdiv)
const
213 double *buffer =
new double [4 * dim];
214 double *xLeft = buffer;
215 double *xRight = buffer + dim;
216 for (
int i = 0; i < dim; ++ i)
218 xLeft [i] = x [i]. leftBound ();
219 xRight [i] = x [i]. rightBound ();
221 double *yLeft = buffer + 2 * dim;
222 double *yRight = buffer + 3 * dim;
223 this ->
compute (xLeft, xRight, yLeft, yRight, dim, coord, subdiv);
224 for (
int i = 0; i < dim; ++ i)
237 return std::string ();
251 for (
int i = 0; i <
nParam; ++ i)
267 double *left = (n > 0) ?
new double [n] : 0;
268 double *right = (n > 0) ?
new double [n] : 0;
269 for (
int i = 0; i < n; ++ i)
294 return std::string (
"map");
This is an abstract class which defines the interface to other classes that describe maps for the use...
virtual void setParam(const double *left, const double *right, int n)
Sets the parameters to the given intervals defined by their left and right coordinates.
std::string getOptInfo() const
Gets a single line of information on optimization of the computation of the map, so that it can be us...
double * leftParam
The left ends of the parameter intervals of the map.
void useOptInfo(const std::string &info)
Uses a prevously saved line of information on optimization of the computation of the map for the same...
virtual double getTimeStep(int subdiv) const
Returns the time step, which is 1 for a map, or the time t of integration in case of a time-t map of ...
int nParam
The number of parameters defined.
bool adjust(bool successful, int subdiv)
Adjusts parameters if necessary after a successful computation or after an unsuccessful computation o...
virtual std::string name() const
Returns the name of the map.
void loadInternals(chomp::multiwork::mwData &data)
Retrieves the internal paramters and other data of the map from the mwData structure.
double * rightParam
The right ends of the parameter intervals of the map.
const double & getLeftParam(int n) const
Returns the left value of the given parameter.
virtual void compute(const double *xleft, const double *xright, double *yleft, double *yright, int dim, const spcCoord *coord, int subdiv) const =0
Computes the image of a box whose left and right coordinates are given.
virtual ~MapType()
The destructor of an object which describe a map.
MapType()
The default constructor of an object which describes a map.
MapType & operator=(const MapType &)
The assignment operator should not be used.
const double & getRightParam(int n) const
Returns the right value of the given parameter.
void operator()(const IntervalType *x, IntervalType *y, int dim, const spcCoord *coord, int subdiv) const
An interface to the function 'compute' based on intervals.
void saveInternals(chomp::multiwork::mwData &data) const
Saves the internal parameters and other data of the map to the mwData structure.
Data types for interval arithmetic.
capd::DInterval IntervalType
The type of an interval (from the CAPD library 2.9/3.0 beta).
Customizable data types for the Conley-Morse graphs computation program.
int spcCoord
The type of coordinates of cubes in the phase space.