29 #ifndef _AWDIAG2DMAIN_H_ 30 #define _AWDIAG2DMAIN_H_ 38 #include "chomp/system/config.h" 39 #include "chomp/system/textfile.h" 40 #include "chomp/system/timeused.h" 41 #include "chomp/system/arg.h" 42 #include "chomp/struct/hashsets.h" 61 template <
class CellT>
65 using namespace chomp::homology;
68 program_time =
"Aborted after";
74 bool addBoundariesX =
true;
75 bool addBoundariesA =
true;
76 bool addNoBoundaries =
false;
77 bool displayDiag =
false;
79 int algorithmVersion = 2;
81 const int maxWrapping = 100;
82 char *wrapping [maxWrapping];
90 arg (a,
"a", algorithmVersion);
92 arg (a,
"w", wrapping, nWrapping, maxWrapping);
94 argswitch (a,
"r", reduced,
true);
95 argswitch (a,
"bx", addBoundariesX,
false);
96 argswitch (a,
"ba", addBoundariesA,
false);
97 argswitch (a,
"b", addNoBoundaries,
true);
98 argswitch (a,
"ddiag", displayDiag,
true);
99 argswitch (a,
"-verify", verify,
true);
102 argstreamprepare (a);
103 int argresult = a. analyze (argc, argv);
108 sout << title <<
'\n';
113 sout <<
"Call with '--help' for help.\n";
118 if ((argresult > 0) || !Xname)
120 sout << helpinfo <<
'\n';
129 CellT::EmptyType::setExistence (
true);
131 #ifdef SPACE_WRAPPING 133 for (
int i = 0; i < nWrapping; ++ i)
135 setWrapping<typename CellT::WrapType>
136 (std::string (wrapping [i]));
144 addBoundariesX && !addNoBoundaries,
145 addBoundariesA && !addNoBoundaries);
146 bool relativeComplex = !L. empty ();
149 chomp::homology::hashedset<CellT> H;
155 bool displayPi =
false;
156 bool displayIncl =
false;
157 bool displayPhi =
false;
158 bool displayRepr =
false;
160 cellNames, displayPi, displayIncl, displayPhi,
161 displayRepr, verify, algorithmVersion);
167 program_time =
"Total time used:";
171 catch (
const char *msg)
173 sout <<
"ERROR: " << msg <<
'\n';
176 catch (
const std::exception &e)
178 sout <<
"ERROR: " << e. what () <<
'\n';
183 sout <<
"ABORT: An unknown error occurred.\n";
189 #endif // _AWDIAG2D_H_ const char * helpinfo
Brief help information on the program's usage.
A class whose instances can be used to generate names of cells with subsequent numbers, in each dimension separately.
A generic procedure for the Alexander-Whithey diagonal computation for 2-dimensional homology generat...
Tools for coordinate wrapping, a.k.a.
void computeAWdiagonal2d(const chomp::homology::hashedset< CellT > &H, const LinMap &pi, const LinMap &incl, CellNames &cellNames, bool displayDiag, bool verify, const CellRestrT &restr)
Computes the Alexander-Whithey diagonal for 2-dimensional homology generators.
void readFilteredComplexes(const char *Xname, const char *Aname, tFilteredComplex< CellT > &K, tFilteredComplex< CellT > &L, bool addBoundariesX, bool addBoundariesA)
Reads a filtered cell complex or a pair of filtered cell complexes from text files.
A class for naming cells for nice text data output.
const char * title
The title of the program and licensing information.
void computeAlgTopModel(const tFilteredComplex< CellT > &K, bool relativeComplex, chomp::homology::hashedset< CellT > &H, LinMap &pi, LinMap &incl, LinMap &phi, CellNames &cellNames, bool displayPi, bool displayIncl, bool displayPhi, bool displayRepr, bool verify, int algorithmVersion)
Computes an AT model and the homology of a cellular complex.
A combinatorial linear map.
int awdiag2dMain(int argc, char *argv [], const char *title, const char *helpinfo)
The main procedure of a program for the computation of the Alexander-Whitney diagonal.
A generic procedure for the computation of chain contraction of a filtered cell complex stored in a f...