33#ifndef _CMGRAPHS_MORSECACHE_H_
34#define _CMGRAPHS_MORSECACHE_H_
44#include "chomp/system/textfile.h"
45#include "chomp/cubes/pointset.h"
46#include "chomp/struct/digraph.h"
47#include "chomp/struct/multitab.h"
48#include "chomp/struct/hashsets.h"
49#include "chomp/system/timeused.h"
79 const std::vector<int> &wrongIndices,
80 const std::vector<int> &skippedIndices,
81 const std::vector<int> &attractors)
83 std::ofstream outStream (fileName, std::ios::out | std::ios::binary);
85 int nSets (morseDec. count ());
87 for (
int n = 0; n < nSets; ++ n)
89 for (
int n = 0; n < nSets; ++ n)
91 std::ostringstream str;
92 str << morseDec. index (n);
95 for (
int n = 0; n < nSets; ++ n)
97 for (
int m = 0; m < nSets; ++ m)
99 out << (morseDec. connected (n, m) ?
'\1' :
'\0');
103 out << skippedIndices;
119 std::vector<int> &wrongIndices,
120 std::vector<int> &skippedIndices,
121 std::vector<int> &attractors)
123 std::ifstream inStream (fileName, std::ios::in | std::ios::binary);
127 morseDec. setnumber (nSets);
128 for (
int n = 0; n < nSets; ++ n)
130 for (
int n = 0; n < nSets; ++ n)
134 std::istringstream str (s);
137 morseDec. setindex (n, ind);
139 for (
int n = 0; n < nSets; ++ n)
141 for (
int m = 0; m < nSets; ++ m)
146 morseDec. addconn (n, m);
150 in >> skippedIndices;
155 throw "Wrong control number while loading cached Morse dec.";
Writing and reading binary data (int, double) with bzip2 compression.
Utility procedures for writing and reading entire data structures with bzip2 compression,...
const int controlNumber
The control number that is used to confirm the compatibility between the coordinator and workers.
A simple wrapper for the bzip2 data compression to an output stream.
A simple wrapper for the bzip2 data decompression from an input stream.
The class that computes and returns properties of the Conley index.
The Morse decoposition class.
Choice of configuration settings.
Conley index computation routines.
void loadMorseDecCache(const char *fileName, theMorseDecompositionType &morseDec, std::vector< int > &wrongIndices, std::vector< int > &skippedIndices, std::vector< int > &attractors)
Loads a Morse decomposition from a binary file.
void saveMorseDecCache(const char *fileName, const theMorseDecompositionType &morseDec, const std::vector< int > &wrongIndices, const std::vector< int > &skippedIndices, const std::vector< int > &attractors)
Saves a Morse decomposition to a binary file.
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
Utilites and helper functions.