34 #ifndef _FINRESDYN_ATTRACTOR_H_ 35 #define _FINRESDYN_ATTRACTOR_H_ 54 template <
class GraphType>
62 void add (
int edge) {
g. addEdge (edge);
return;}
77 template <
class NumType>
79 const NumType *leftBounds,
const NumType *rightBounds)
82 for (
int i = 0; i < dim; ++ i)
85 (rightBounds [i], leftBounds [i]);
100 template <
class MapType,
class CoverType,
class GraphType,
class NumArray>
102 GraphType &graph, NumArray initialPoint,
int iterCount,
106 typedef typename CoverType::NumberType NumType;
107 int dim = cover. dim ();
110 std::auto_ptr<NumType> xPtr (
new NumType [dim]);
111 NumType *x = xPtr.
get ();
112 for (
int i = 0; i < dim; ++ i)
113 x [i] = initialPoint [i];
114 function. initialPoint (x, iterCount);
119 std::auto_ptr<NumType> yPtr (
new NumType [dim << 1]);
120 NumType *leftBounds = yPtr.
get ();
121 NumType *rightBounds = leftBounds + dim;
122 NumType *leftImage = leftBounds;
123 NumType *rightImage = rightBounds;
124 NumType maxDiameter2 = 0;
129 while (current < cover. size ())
135 cover.
get (current, leftBounds, rightBounds);
138 function. image (leftBounds, rightBounds,
139 leftImage, rightImage);
143 cover. cover (leftImage, rightImage, edgeAdder, &diam2);
146 if (maxDiameter2 < diam2)
147 maxDiameter2 = diam2;
150 if ((maxCoverSize > 0) && (cover. size () > maxCoverSize))
151 throw "Maximal allowed cover size exceeded.";
157 if (!(current % 1371))
159 scon << std::setw (10) << cover. size () <<
160 "\b\b\b\b\b\b\b\b\b\b";
164 return static_cast<double> (maxDiameter2);
168 #endif // _FINRESDYN_ATTRACTOR_H_ Various output streams for the program.
Rigorous rounding of arithmetic operations.
A class for rounding operations which uses the BOOST library.
NumType diameter2(const int dim, const NumType *leftBounds, const NumType *rightBounds)
Computes an upper bound for the square of the diameter of a given box.
void add(int edge)
Adds an edge to the graph.
EdgeAdder(GraphType &graph)
The only allowed constructor of an edge adder object.
A directed graph class and some algorithms.
GraphType & g
A reference to the graph to which the vertices are to be added.
Auxiliary class for adding edges to a graph.
double constructAttractor(const MapType &function, CoverType &cover, GraphType &graph, NumArray initialPoint, int iterCount, int maxCoverSize)
Constructs a cover of an attractor for a given dynamical system.