32#ifndef _CMGRAPHS_TWOCIRC_H_
33#define _CMGRAPHS_TWOCIRC_H_
44#include "chomp/system/textfile.h"
63 void compute (
const double *xleft,
const double *xright,
64 double *yleft,
double *yright,
int dim,
65 const spcCoord *coord,
int subdiv)
const;
84 using chomp::homology::sbug;
87 if (((x. leftBound () > 0) || (x. rightBound () < 0)) ||
88 ((y. leftBound () > 0) || (y. rightBound () < 0)))
92 sqrt (denomTmp) : power (denomTmp,
94 if ((denominator. leftBound () <= 0) &&
95 (denominator. rightBound () >= 0))
97 throw "Denominator contains zero.";
105 if ((x. leftBound () == 0) && (x. rightBound () == 0))
113 double yMin = y. leftBound ();
120 double yMax = y. rightBound ();
132 if ((y. leftBound () == 0) && (y. rightBound () == 0))
139 double xMaxAbs ((-(x. leftBound ()) > x. rightBound ()) ?
140 -(x. leftBound ()) : x. rightBound ());
141 double yMaxAbs ((-(y. leftBound ()) > y. rightBound ()) ?
142 -(y. leftBound ()) : y. rightBound ());
148 if (x. leftBound () == 0)
150 xLeft = (root == 2) ? -1 : 0;
154 IntervalType numerator (x. leftBound (), x. leftBound ());
156 IntervalType denominator (power (-numerator, fraction2));
157 xLeft = (numerator / denominator). leftBound ();
162 if (y. leftBound () == 0)
164 yLeft = (root == 2) ? -1 : 0;
168 IntervalType numerator (y. leftBound (), y. leftBound ());
170 IntervalType denominator (power (-numerator, fraction2));
171 yLeft = (numerator / denominator). leftBound ();
176 if (x. rightBound () == 0)
178 xRight = (root == 2) ? 1 : 0;
182 IntervalType numerator (x. rightBound (), x. rightBound ());
184 IntervalType denominator (power (numerator, fraction2));
185 xRight = (numerator / denominator). leftBound ();
190 if (y. rightBound () == 0)
192 yRight = (root == 2) ? 1 : 0;
196 IntervalType numerator (y. rightBound (), y. rightBound ());
198 IntervalType denominator (power (numerator, fraction2));
199 yRight = (numerator / denominator). leftBound ();
209 double *yleft,
double *yright,
int dim,
const spcCoord *,
int)
const
211 using chomp::homology::sbug;
215 throw "Test mapping for two circles: dim = 2 only!";
223 int whichMap =
static_cast<int> (std::floor (
getLeftParam (0)));
252 coefExt = std::sqrt (2);
255 coefInt = std::sqrt (2);
256 coefExt = std::sqrt (3);
260 coefExt = std::sqrt (2);
265 coefInt = std::sqrt (2);
271 throw "Wrong parameter value - unknown map requested.";
275 if (radius2. rightBound () < 4)
280 else if (radius2. leftBound () > 4)
287 x = intervalHull (coefInt * xInt, coefExt * xExt);
288 y = intervalHull (coefInt * yInt, coefExt * yExt);
292 yleft [0] = x. leftBound ();
293 yright [0] = x. rightBound ();
294 yleft [1] = y. leftBound ();
295 yright [1] = y. rightBound ();
This class defines a test mapping by a formula from Jacek Szybowski.
void compute(const double *xleft, const double *xright, double *yleft, double *yright, int dim, const spcCoord *coord, int subdiv) const
Computes the image of a box whose left and right coordinates are given.
void computeMap0(IntervalType &x, IntervalType &y, int root) const
Computes the core map. Replaces 'x' and 'y' with their images.
MapTwoCirc()
The default constructor.
This is an abstract class which defines the interface to other classes that describe maps for the use...
const double & getLeftParam(int n) const
Returns the left value of the given parameter.
Data types for interval arithmetic.
void resetRounding()
This function resets rounding switches of the processor and sets rounding to the nearest.
bool testIntervals(bool throwException=false)
Testing interval arithmetic.
capd::DInterval IntervalType
The type of an interval (from the CAPD library 2.9/3.0 beta).
int spcCoord
The type of coordinates of cubes in the phase space.