The Conley-Morse Graphs Software
procexit.h
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////////////////////
2///
3/// @file procexit.h
4///
5/// A plug-in for post-processing of Morse decompositions
6/// which saves the real exit sets of all the Morse sets.
7/// This is a replacement for "procmdec.h".
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 October 26, 2010. Last revision: October 26, 2010.
30
31
32#ifndef _CMGRAPHS_PROCEXIT_H_
33#define _CMGRAPHS_PROCEXIT_H_
34
35// include some standard C++ header files
36#include <sstream>
37#include <fstream>
38#include <string>
39
40// include selected header files from the CHomP library
41#include "chomp/system/textfile.h"
42#include "chomp/struct/digraph.h"
43#include "chomp/struct/flatmatr.h"
44#include "chomp/struct/multitab.h"
45
46// include local header files
47#include "config.h"
48#include "typedefs.h"
49#include "conindex.h"
50#include "morsedec.h"
51#include "typedyns.h"
52#include "utils.h"
53
54
55namespace custom {
56
57/// Post-processing of Morse decompositions by means of cycle decomposition.
58namespace procMorseDecExit {
59
60
61// --------------------------------------------------
62// ------- post-process a Morse decomposition -------
63// --------------------------------------------------
64
65/// Post-processes a Morse decomposition by computing a decomposition
66/// of each Morse set into cycle sets and analyzing this decomposition.
67template <class CubSetType, class MorseDecType, class GraphType,
68 class CubMapType>
69inline void processMorseDec (const MorseDecType &morseDec,
70 const CubSetType &allCubes, const GraphType &g,
71 const CubMapType &theCubMap, const CubMapType &,
72 const std::string &cubesFilePrefix,
73 const std::string &procFilePrefix)
74{
75 using namespace chomp::homology;
76
77 sout << "Computing and saving exit sets of the Morse sets.\n";
78
79 // analyze each Morse set
80 int nSets = morseDec. count ();
81 for (int n = 0; n < nSets; ++ n)
82 {
83 const CubSetType &morseCubes = morseDec [n];
84 int_t morseCount = morseCubes. size ();
85
86 // restrict the analysis to the given Morse set
87 sbug << "Morse set no. " << n << ": " <<
88 morseCount << " cubes. Exit set: ";
89
90 // compute and save the real exit set for the Morse set
91 SetOfCubes img;
92 for (int i = 0; i < morseCount; ++ i)
93 theCubMap (morseCubes [i], &img, 0, 0, false);
94 img. remove (morseCubes);
95 sbug << img. size () << " cubes.\n";
96
97 // prepare a file name for this Morse set
98 std::ostringstream exitFileName;
99 exitFileName << cubesFilePrefix << n << "e.cub";
100
101 // save the exit set to a file
102 std::ofstream f (exitFileName. str (). c_str ());
103 f << "; The exit set for the corresponding Morse set (" <<
104 img. size () << " cubes).\n";
105 f << img;
106 f. close ();
107 }
108
109 return;
110} /* processMorseDec */
111
112
113} // namespace procMorseDecExit
114} // namespace custom
115
116
117#endif // _CMGRAPHS_PROCEXIT_H_
118
Choice of configuration settings.
Conley index computation routines.
Morse decompositions.
void processMorseDec(const MorseDecType &morseDec, const CubSetType &allCubes, const GraphType &g, const CubMapType &theCubMap, const CubMapType &, const std::string &cubesFilePrefix, const std::string &procFilePrefix)
Post-processes a Morse decomposition by computing a decomposition of each Morse set into cycle sets a...
Definition: procexit.h:69
Customizable settings that are supposed to be modified and/or chosen by the user of the software.
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
Utilites and helper functions.