The Conley-Morse Graphs Software
worker.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file worker.h
4///
5/// The worker class for the Conley-Morse graphs computation program.
6/// This file contains the definition of the worker class which processes
7/// a single chunk of the parameter range.
8///
9/// @author Pawel Pilarczyk
10///
11/////////////////////////////////////////////////////////////////////////////
12
13// Copyright (C) 1997-2014 by Pawel Pilarczyk.
14//
15// This file is part of my research software package. This is free software:
16// you can redistribute it and/or modify it under the terms of the GNU
17// General Public License as published by the Free Software Foundation,
18// either version 3 of the License, or (at your option) any later version.
19//
20// This software is distributed in the hope that it will be useful,
21// but WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23// GNU General Public License for more details.
24//
25// You should have received a copy of the GNU General Public License
26// along with this software; see the file "license.txt". If not,
27// please, see <https://www.gnu.org/licenses/>.
28
29// Started on February 11, 2008. Last revision: March 29, 2022.
30
31
32#ifndef _CMGRAPHS_WORKER_H_
33#define _CMGRAPHS_WORKER_H_
34
35
36// include some standard C++ header files
37#include <string>
38#include <sstream>
39#include <cstdio>
40#include <vector>
41#include <string>
42
43// include selected header files from the CHomP library
44#include "chomp/system/config.h"
45#include "chomp/system/textfile.h"
46#include "chomp/system/timeused.h"
47#include "chomp/cubes/cube.h"
48#include "chomp/multiwork/mw.h"
49#include "chomp/struct/digraph.h"
50
51// include local header files
52#include "config.h"
53#include "typedefs.h"
54#include "typedyns.h"
55#include "utils.h"
56#include "compmdec.h"
57#include "plotmdec.h"
58#include "eigenval.h"
59#include "dataconv.h"
60#include "datavector.h"
61#include "matchdec.h"
62#include "mapopt.h"
63
64
65// --------------------------------------------------
66// ---------------- the worker class -----------------
67// --------------------------------------------------
68
69/// The worker class that processes single chunks of data
70/// which contain the definition of a selected rectangular area
71/// in the set of parameters to process.
72class Worker: public chomp::multiwork::mwWorker
73{
74public:
75 /// The default constructor
76 Worker (bool _local = false);
77
78 /// Destructor part for the worker specialization.
79 ~Worker ();
80
81private:
82 /// A function for the initialization of a worker.
83 int Initialize (chomp::multiwork::mwData &data);
84
85 /// A function for processing a piece of data by a worker.
86 int Process (chomp::multiwork::mwData &data);
87
88 /// The copy constructor is not allowed.
89 Worker (const Worker &) {return;}
90
91 /// The assignment operator is not allowed.
92 Worker &operator = (const Worker &) {return *this;}
93
94private:
95 /// Is the work being done locally? That is, in the same process
96 /// as the coordinator? If so, then the global variables are not
97 /// reset, such as pointbase, because this might affect the
98 /// coordinator's data.
99 bool local;
100
101 /// Waiting time measurement between consecutive pieces.
102 chomp::homology::timeused waitingTime;
103
104 /// Is the worker waiting for anything?
106
107}; /* class Worker */
108
109// --------------------------------------------------
110
111inline Worker::Worker (bool _local): local (_local), waiting (true)
112{
113 waitingTime = 0;
114 return;
115} /* Worker::Worker */
116
117// --------------------------------------------------
118
120{
121 using namespace chomp::homology;
122
123//DEBUG if (waiting && !local && (static_cast<double> (waitingTime) > 1.0))
124 if (waiting && !local)
125 {
126 sbug << "It took " << waitingTime <<
127 " to decide to quit.\n";
128 }
129 return;
130} /* Worker::Worker */
131
132// --------------------------------------------------
133
134inline int Worker::Initialize (chomp::multiwork::mwData &data)
135{
136 // ignore the received data and say it was Ok
137 return chomp::multiwork::mwOk;
138} /* Worker::Initialize */
139
140inline int Worker::Process (chomp::multiwork::mwData &data)
141{
142 using namespace chomp::homology;
143 using namespace chomp::multiwork;
144
145 // display waiting time if considerable
146 if (static_cast<double> (waitingTime) > 1.0)
147 {
148 sbug << "It took " << waitingTime <<
149 " to receive data.\n";
150 }
151 waiting = false;
152
153 // prepare a stopwatch to measure the time of processing
154 timeused processingTime;
155 processingTime = 0;
156
157 // reset the variables for computing max image diameter and volume
160
161 // decode the number of the data pack to process
162 int dataNumber = 0;
163 data >> dataNumber;
164
165 // the parameter space dimension
166 int dim = 0;
167 data >> dim;
168 if (dim != paramDim)
169 {
170 sout << "! Wrong parameter space dimension (" << dim <<
171 "). Rejecting the data.\n";
172 data. Reset ();
173 return mwReject;
174 }
175
176 // the ranges of the parameter boxes
177 parCoord parLeft [paramDim];
178 parCoord parRight [paramDim];
179 for (int i = 0; i < paramDim; ++ i)
180 {
181 int n = 0;
182 data >> n;
183 parLeft [i] = static_cast<parCoord> (n);
184 data >> n;
185 parRight [i] = static_cast<parCoord> (n);
186 }
187
188 // the size of Morse sets to skip the Conley index computation above
189 int skipIndices = 0;
190 data >> skipIndices;
191
192 // read the file name prefix for ODE integration optimization data
193 std::string mapOptPrefix;
194 data >> mapOptPrefix;
195
196 // read the file name prefix to which Morse decompositions are saved
197 std::string sharePrefix;
198 data >> sharePrefix;
199
200 // read the file name prefix to which pictures of the phase space
201 // are saved
202 std::string phaseSpacePrefix;
203 data >> phaseSpacePrefix;
204
205 // read the file name prefix to which the list of cubes are saved
206 std::string cubesPrefix;
207 data >> cubesPrefix;
208
209 // read the file name prefix for cached Morse decompositions
210 std::string morseDecPrefix;
211 data >> morseDecPrefix;
212
213 // read the file name prefix for Conley-Morse graphs
214 std::string graphsPrefix;
215 data >> graphsPrefix;
216
217 // read the file name prefix for post-processing information
218 std::string procPrefix;
219 data >> procPrefix;
220
221 // should the full phase space be plotted in a PNG file?
222 bool fullPhaseSpace (false);
223 data >> fullPhaseSpace;
224
225 // receive map optimization data
226 std::vector<std::vector<std::string> > mapOptHints;
227 data >> mapOptHints;
228
229 // the ending control number
230 int ctrl = 0;
231 data >> ctrl;
232 if (ctrl != controlNumber)
233 {
234 data. Reset ();
235 sout << "! Data incomplete. Rejecting it.\n";
236 return mwReject;
237 }
238
239 // compute the number of parameter boxes to process
240 int volume = 1;
241 for (int i = 0; i < paramDim; ++ i)
242 {
243 int prevVolume = volume;
244 volume *= parRight [i] - parLeft [i];
245 if (volume < prevVolume)
246 throw "Too many boxes for processing by a worker.";
247 }
248
249 // show a message on which boxes are going to be processed
250 if (volume > 1)
251 {
252 sout << "Processing " << dataNumber << ": " << volume <<
253 " boxes in ";
254 for (int i = 0; i < paramDim; ++ i)
255 {
256 sout << (i ? "x" : "") << "[" << parLeft [i] <<
257 "," << parRight [i] << "]";
258 }
259 sout << "...\n";
260 }
261 // show a message about processing a single parameter box
262 else
263 {
264 sout << "Processing " << dataNumber << ": the box " <<
265 parCube (parLeft, paramDim) << "...\n";
266 }
267
268
269 // prepare the offset and the width of the phase space region
270 double offset [spaceDim];
271 for (int i = 0; i < spaceDim; ++ i)
272 offset [i] = spaceOffset [i];
273 double width [spaceDim];
274 for (int i = 0; i < spaceDim; ++ i)
275 width [i] = spaceWidth [i];
276
277 // prepare an object for storing the ranges of coordinates
278 // in the Morse sets
279 CoordMinMax coordMinMax;
280
281 // prepare the data for storing results of computations
282 // for individual boxes
283 parCubes paramBoxes;
284 std::vector<theMapType *> theMap (volume);
285 std::vector<theCubMapType *> theCubMap0 (volume);
286 std::vector<theCubMapType *> theCubMap1 (volume);
287 std::vector<theMorseDecompositionType *> morseDec (volume);
288 std::vector<bool> morseDecComputed (volume, false);
289 std::vector<double> timeUsed (volume, 0);
290 std::vector<std::vector<int> > wrongIndices (volume);
291 std::vector<std::vector<int> > skippedIndices (volume);
292 std::vector<std::vector<int> > attractors (volume);
293
294 // run one set of computations
295 int countRead = 0;
296 int countWritten = 0;
297 int countComputed = 0;
298 parRect rect (parLeft, parRight, paramDim);
299 const parCoord *curCoord;
300 while ((curCoord = rect. get ()) != 0)
301 {
302 // start measuring the time of processing this box
303 chomp::homology::timeused stopwatch;
304
305 // determine if this is an internal boundary point
306 bool intBoundaryPoint = internalBoundaryPoint
307 (curCoord, parLeft, parRight, paramSubdiv, paramDim);
308
309 // force reading/writing cached Conley indices
310 intBoundaryPoint = true;
311
312 // prepare filenames for cached indices, the phase space PNG,
313 // and the sets of cubes to be saved to files
314 std::string pictureFileName = phaseSpacePrefix +
315 coord2str (curCoord, paramDim) + ".png";
316 std::string morseDecFileName = morseDecPrefix. empty () ?
317 "" : (morseDecPrefix +
318 coord2str (curCoord, paramDim) + ".bz2");
319 std::string graphFileName = graphsPrefix. empty () ?
320 "" : (graphsPrefix +
321 coord2str (curCoord, paramDim) + ".txt");
322 std::string cacheFileName ((intBoundaryPoint &&
323 !sharePrefix. empty ()) ? (sharePrefix +
324 coord2str (curCoord, paramDim) + ".ind") : "");
325 std::string cubesFilePrefix = cubesPrefix. empty () ? "" :
326 (cubesPrefix + coord2str (curCoord, paramDim) +
327 "c");
328 std::string procFilePrefix = procPrefix. empty () ? "" :
329 (procPrefix + coord2str (curCoord, paramDim));
330 std::string mapOptFileName = mapOptPrefix. empty () ? "" :
331 (mapOptPrefix + coord2str (curCoord, paramDim));
332
333 // skip this parameter box if the corresponding index cache
334 // file exists and the task was to generate this cache only
335 if ((volume == 1) &&
336 (cacheFileName. empty () ||
337 fileExists (cacheFileName. c_str ())) &&
338 (phaseSpacePrefix. empty () ||
339 fileExists (pictureFileName. c_str ())) &&
340 (morseDecPrefix. empty () ||
341 fileExists (morseDecFileName. c_str ())) &&
342 (graphsPrefix. empty () ||
343 fileExists (graphFileName. c_str ())))
344 {
345 bool exists = false;
346 if (cacheFileName. empty ())
347 sout << "No Conley index cache to compute. ";
348 else if (fileExists (cacheFileName. c_str ()))
349 {
350 sout << "Conley index cache already exists. ";
351 exists = true;
352 }
353 if (phaseSpacePrefix. empty ())
354 sout << "No phase space picture to save. ";
355 else if (fileExists (pictureFileName. c_str ()))
356 {
357 sout << "Phase space picture already exists. ";
358 exists = true;
359 }
360 if (morseDecPrefix. empty ())
361 sout << "No Morse decomp cache to save. ";
362 else if (fileExists (morseDecFileName. c_str ()))
363 {
364 sout << "Morse decomp cache already exists. ";
365 exists = true;
366 }
367 else if (fileExists (graphFileName. c_str ()))
368 {
369 sout << "C-M graph txt file already exists. ";
370 exists = true;
371 }
372#ifndef CONFIG_ONLYPREPROCESSING
373 if (exists)
374 sout << "Skipping the box, "
375 "because at least one file exists.\n";
376 else
377 sout << "Skipping the box, "
378 "because the result would be lost.\n";
379 break;
380#else
381 if (exists)
382 {
383 sout << "Skipping the box.\n";
384 break;
385 }
386 sout << "Processing the box anyway.\n";
387#endif
388 }
389
390 // add the analyzed box to the set of parameter boxes
391 int curNumber = paramBoxes. size ();
392 parCube paramBox (curCoord, paramDim);
393 paramBoxes. add (paramBox);
394 if (paramBoxes. size () == curNumber)
395 throw "A repeated box found in the iterations.";
396
397 // prepare the actual parameters for the map
398 double leftMapParam [paramCount];
399 double rightMapParam [paramCount];
400 computeParam (curCoord, leftMapParam, rightMapParam);
401 sbug << "Box " << paramBox << ":";
402 for (int i = 0; i < paramCount; ++ i)
403 {
404 sbug << " [" << leftMapParam [i] << "," <<
405 rightMapParam [i] << "]";
406 }
407 sbug << ".\n";
408
409 // create the map object and set its parameters
410 theMap [curNumber] = new theMapType ();
411 theMap [curNumber] -> setParam (leftMapParam, rightMapParam,
412 paramCount);
413
414 // apply map optimization data
415 if (!mapOptHints [curNumber]. empty ())
416 {
417 sbug << "Using " <<
418 mapOptHints [curNumber]. size () <<
419 " map optimization hints.\n";
420 for (std::vector<std::string>::const_iterator it =
421 mapOptHints [curNumber]. begin ();
422 it != mapOptHints [curNumber]. end (); ++ it)
423 {
424 theMap [curNumber] -> useOptInfo (*it);
425 }
426 }
427
428 // prepare an object of the cubical map
429 // at the highest subdivision level to be used
430 // in the definition of the Morse decomposition
431 theCubMap0 [curNumber] = new theCubMapType (offset, width,
432 1 << finalDepth, finalDepth, *(theMap [curNumber]));
433 theCubMap0 [curNumber] -> cache = true;
434 theCubMap1 [curNumber] = new theCubMapType (offset, width,
435 1 << (finalDepth + 1), finalDepth + 1,
436 *(theMap [curNumber]));
437 theCubMap1 [curNumber] -> cache = true;
438
439 // compute the Morse decomposition
440 sbug << "Computing Morse decomposition for " <<
441 paramBox << "...\n";
442 bool computed = false;
443 morseDec [curNumber] = computeMorseDecomposition
444 (*(theMap [curNumber]),
445 *(theCubMap0 [curNumber]), *(theCubMap1 [curNumber]),
446 offset, width, skipIndices,
447 cacheFileName, pictureFileName, cubesFilePrefix,
448 morseDecFileName, graphFileName,
449 procFilePrefix, mapOptFileName,
450 computed, wrongIndices [curNumber],
451 skippedIndices [curNumber], attractors [curNumber],
452 false, leftMapParam, rightMapParam, paramCount);
453 morseDecComputed [curNumber] = computed;
454
455 // update a counter of computed Morse decompositions
456 if (computed)
457 {
458 ++ countComputed;
459 if (intBoundaryPoint)
460 ++ countWritten;
461 }
462 else
463 ++ countRead;
464
465 // update the min and max coordinates of Morse sets
466 int_t nMorseSets = morseDec [curNumber] -> count ();
467 for (int_t nSet = 0; nSet < nMorseSets; ++ nSet)
468 coordMinMax ((*(morseDec [curNumber])) [nSet]);
469
470 // save a picture of the computed Morse decomposition
471 if (
472#if (!defined (PLOT_X_COORD) && !defined (PLOT_Y_COORD))
473 (spaceDim == 2) &&
474#endif
475 !phaseSpacePrefix. empty () &&
476 !fileExists (pictureFileName. c_str ()))
477 {
478 sbug << "Saving '" << pictureFileName << "'...\n";
479#ifdef PLOT_X_COORD
480 const int xCoord (PLOT_X_COORD);
481#else
482 const int xCoord (0);
483#endif
484#ifdef PLOT_Y_COORD
485 const int yCoord (PLOT_Y_COORD);
486#else
487 const int yCoord (1);
488#endif
489 plotMorseDecompositionPNG (*(morseDec [curNumber]),
490 pictureFileName. c_str (), xCoord, yCoord,
491 fullPhaseSpace ? (1 << finalDepth) : 0);
492 }
493
494 // remember the time used for processing this cube
495 timeUsed [curNumber] = stopwatch;
496
497 // indicate the percentage of work completed
498 sbug << timeUsed [curNumber] << " sec, " <<
499 ((curNumber + 1) * 100 / volume) << "% done.\n";
500 sbug << "--------------------------------\n";
501 }
502
503 // show statistics of the computations
504 if (volume > 1)
505 {
506 sout << countRead << " sets of Conley indices read, " <<
507 countComputed << " computed (" <<
508 countWritten << " written).\n";
509 }
510
511 // process the computed Morse decompositions
512 // to determine the continuation relations between them
513 std::vector<std::vector<parCube> > matchClasses;
514 if (volume > 1)
515 {
516 sbug << "Matching " << volume <<
517 " Morse decompositions...\n";
518 std::vector<std::vector<int> > noWrongIndices (volume);
519 matchMorseDecompositions (paramBoxes, morseDec,
520 // theMap, offset, width, finalDepth, theCubMap0,
521 theCubMap1,
522 ignoreIsolationForContinuation ? noWrongIndices :
523 wrongIndices, parLeft, parRight, matchClasses);
524
525 // show a summary of what has just been computed
526 int nClasses = matchClasses. size ();
527 if (nClasses == 1)
528 sbug << "There is only one nontrivial class";
529 else
530 {
531 sbug << "There are " << nClasses <<
532 " nontrivial classes";
533 }
534 sbug << " of equivalent Morse decompositions:\n";
535 if (nClasses == 0)
536 sbug << 0;
537 for (int n = 0; n < nClasses; ++ n)
538 sbug << (n ? "+" : "") << matchClasses [n]. size ();
539 sbug << " elements.\n";
540 }
541
542 // show computed max image diameter and volume
543 sbug << "Max img diam = " << theCubMapType::maxImgDiam <<
544 ", max img vol = " << theCubMapType::maxImgVol << ".\n";
545
546 // send back the data containing the result of the processing
547 data. Reset ();
548 data << dataNumber;
549
550 // send the processing time
551 data << static_cast<double> (processingTime);
552
553 // send the lists of numbers of Morse sets with wrong indices
554 data << wrongIndices;
555
556 // send the lists of numbers of Morse sets whose indices were skipped
557 data << skippedIndices;
558
559 // send the lists of attractors
560 data << attractors;
561
562 // send the cubes with the coordinate ranges
563 data << spcCube (coordMinMax. coordLeftMin, spaceDim);
564 data << spcCube (coordMinMax. coordRightMax, spaceDim);
565
566 // send the number of boxes in the data chunk
567 int countBoxes = paramBoxes. size ();
568 data << countBoxes;
569
570 // send data for each box
571 for (int curNumber = 0; curNumber < countBoxes; ++ curNumber)
572 {
573 // send the coordinates of the box
574 data << paramBoxes [curNumber];
575
576 // send the time used for processing this box
577 data << timeUsed [curNumber];
578
579 // send the information on whether this Morse decomposition
580 // was computed or if it was known before
581 data << morseDecComputed [curNumber];
582
583 // send the transitive reduction of the Morse graph
584 diGraph<> connGraph;
585 morseDec [curNumber] -> makegraph (connGraph);
586 diGraph<> morseGraph;
587 transitiveReduction (connGraph, morseGraph);
588 data << morseGraph;
589
590 // send the sizes of each Morse set
591 int nSets = morseDec [curNumber] -> count ();
592 for (int n = 0; n < nSets; ++ n)
593 data << (*(morseDec [curNumber])) [n]. size ();
594
595 // send the Conley indices of the Morse sets
596 // and the nonzero eigenvalues of each index
597 if (static_cast<int_t> (nSets) !=
598 morseGraph. countVertices ())
599 {
600 throw "Wrong number of Morse sets encountered.";
601 }
602 for (int n = 0; n < nSets; ++ n)
603 {
604 const theConleyIndexType &index =
605 morseDec [curNumber] -> index (n);
606 data << index;
607 IndexEigenValues eigenValues (index);
608 data << eigenValues;
609 }
610 }
611
612 // send data regarding the continuation relation between the boxes
613 data << matchClasses;
614
615 // send computed max image diameter and volume
618
619 // send the map optimization data
620 std::vector<std::string> mapOptFinal;
621 for (int i = 0; i < countBoxes; ++ i)
622 {
623 std::string line = theMap [i] -> getOptInfo ();
624 if (!line. empty ())
625 mapOptFinal. push_back (line);
626 }
627 data << mapOptFinal;
628
629 // delete the allocated Morse decompositions
630 for (int i = 0; i < countBoxes; ++ i)
631 {
632 sbug << "Deleting the map for " << paramBoxes [i] << "...\n";
633 delete morseDec [i];
634 delete theCubMap1 [i];
635 delete theCubMap0 [i];
636 delete theMap [i];
637 }
638
639 // reset the environment of computations
640 // unless the work is being done locally
641 if (!local)
642 {
643 sbug << "(Resetting the pointset data.)\n";
644 parCube::PointBase::reset ();
645 spcCube::PointBase::reset ();
646 Cube::PointBase::reset ();
647 }
648
649 // add a data chunk separator
650 sout << "================================\n";
651
652 // reset waiting timer
653 waitingTime. reset ();
654 waiting = true;
655
656 // return the result
657 return mwOk;
658} /* Worker::Process */
659
660
661#endif // _CMGRAPHS_WORKER_H_
662
const int controlNumber
The control number that is used to confirm the compatibility between the coordinator and workers.
Definition: c_differ.h:79
MapDifference theMapType
Defines the type of the map to be used for the computations.
Definition: c_differ.h:51
#define PLOT_Y_COORD
Definition: c_inf_t.h:82
#define PLOT_X_COORD
Definition: c_inf_t.h:78
The class that computes and returns properties of the Conley index.
Definition: conindex.h:86
A class whose objects store, update and show coordinate ranges.
Definition: utils.h:444
Eigenvalues of the Conley index map gathered by levels.
Definition: eigenval.h:63
static int maxImgDiam
The maximal image diameter encountered so far.
Definition: mapcomp.h:117
static int maxImgVol
The maximal image volume encountered so far.
Definition: mapcomp.h:121
The worker class that processes single chunks of data which contain the definition of a selected rect...
Definition: worker.h:73
Worker & operator=(const Worker &)
The assignment operator is not allowed.
Definition: worker.h:92
bool waiting
Is the worker waiting for anything?
Definition: worker.h:105
int Process(chomp::multiwork::mwData &data)
A function for processing a piece of data by a worker.
Definition: worker.h:140
Worker(bool _local=false)
The default constructor.
Definition: worker.h:111
Worker(const Worker &)
The copy constructor is not allowed.
Definition: worker.h:89
~Worker()
Destructor part for the worker specialization.
Definition: worker.h:119
bool local
Is the work being done locally? That is, in the same process as the coordinator? If so,...
Definition: worker.h:99
chomp::homology::timeused waitingTime
Waiting time measurement between consecutive pieces.
Definition: worker.h:102
int Initialize(chomp::multiwork::mwData &data)
A function for the initialization of a worker.
Definition: worker.h:134
Computation of Morse decompositions.
theMorseDecompositionType * computeMorseDecomposition(theMapType &theMap, const theCubMapType theCubMap0, const theCubMapType theCubMap1, const double *offset, const double *width, int_t skipIndices, const std::string &cacheFileName, const std::string &pictureFileName, const std::string &cubesFilePrefix, const std::string &morseDecFileName, const std::string &graphFileName, const std::string &procFilePrefix, const std::string &mapOptFileName, bool &morseDecComputed, std::vector< int > &wrongIndices, std::vector< int > &skippedIndices, std::vector< int > &attractors, bool connOrbits, const double *leftMapParam, const double *rightMapParam, int paramCount)
Computes the Morse decomposition using all the pre- and postprocessing.
Definition: compmdec.h:997
Choice of configuration settings.
Data conversion for sending/receiving.
Data conversion for sending/receiving: std::vectors and hashed sets of any objects.
Eigenvalues of the Conley index map.
Map optimization data saving, retrieving, and sending.
Matching Morse decompositions.
void matchMorseDecompositions(const parCubes &paramBoxes, const std::vector< theMorseDecompositionType * > &morseDec, const std::vector< theCubMapType * > &theCubMap1, const std::vector< std::vector< int > > &wrongIndices, const parCoord *parLeft, const parCoord *parRight, std::vector< std::vector< parCube > > &matchClasses)
Matches Morse decompositions corresponding to parameter cubes in the entire range.
Definition: matchdec.h:382
const SpaceOffsetType spaceOffset
An imitation of an array which returns the offset of the rectangular area in the phase space which co...
Definition: p_differ.h:108
const int paramDim
The dimension of the parameter space to iterate.
Definition: p_differ.h:67
const int spaceDim
The dimension of the phase space.
Definition: p_differ.h:48
const bool ignoreIsolationForContinuation
Ignoring the isolation problem while matching Morse decompositions.
Definition: p_differ.h:208
const int paramCount
The number of all the parameters, both varying and fixed.
Definition: p_differ.h:82
const SpaceWidthType spaceWidth
An imitation of an array which returns the width of the rectangular area in the phase space which con...
Definition: p_differ.h:128
const int finalDepth
The final depth of subdivisions in the phase space.
Definition: p_differ.h:58
const short int paramSubdiv[paramDim]
The numbers of subintervals in each direction of the parameter space.
Definition: p_differ.h:71
Plotting a Morse decomposition in a PNG picture.
void plotMorseDecompositionPNG(const MorseDecType &m, const char *filename, int xCoord, int yCoord, int size=0, bool colorBar=true)
Saves all the Morse sets in the provided Morse decomposition to a PNG file.
Definition: plotmdec.h:51
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
MapComputation< theMapType, spcCube, spcCubes > theCubMapType
Combinatorial cubical multivalued map type.
Definition: typedyns.h:51
chomp::homology::tCubeFix< paramDim, parCoord > parCube
The type of a cube in the set of parameters.
Definition: typeparam.h:58
short int parCoord
The type of coordinates of cubes in the set of parameters.
Definition: typeparam.h:53
chomp::homology::tRectangle< parCoord > parRect
The type of a rectangle used to iterate sets of cubes of parameters.
Definition: typeparam.h:64
chomp::homology::hashedset< parCube > parCubes
The type of a set of cubes in the set of parameters.
Definition: typeparam.h:61
chomp::homology::tCubeBase< spcCoord > spcCube
The type of a cube in the phase space.
Definition: typespace.h:55
Utilites and helper functions.
bool internalBoundaryPoint(const intType1 *coord, const intType2 *left, const intType2 *right, const intType3 *limit, int dim)
Verifies whether the given box is located at the boundary of the small region which is either not at ...
Definition: utils.h:137
bool fileExists(const char *filename)
Returns 'true' iff the given file exists and it is allowed to read it.
Definition: utils.h:69
std::string coord2str(const intType1 *coords, const intType2 *maxCoords, int dim)
Generates an underscore-separated list of non-negative coordinates padded with zeros to the same widt...
Definition: utils.h:386
void computeParam(const intType *curCoord, double *leftMapParam, double *rightMapParam)
Computes the real coordinates of the parameter cube which corresponds to the given box.
Definition: utils.h:160