39 #include "chomp/system/config.h" 40 #include "chomp/system/textfile.h" 41 #include "chomp/system/timeused.h" 42 #include "chomp/system/arg.h" 43 #include "chomp/struct/hashsets.h" 63 template <
class CellT>
67 using namespace chomp::homology;
70 program_time =
"Aborted after";
77 bool addBoundariesX =
true;
78 bool addBoundariesA =
true;
79 bool addNoBoundaries =
false;
80 bool displayPi =
false;
81 bool displayIncl =
false;
82 bool displayPhi =
false;
83 bool displayRepr =
false;
85 int algorithmVersion = 2;
87 const int maxWrapping = 100;
88 char *wrapping [maxWrapping];
97 arg (a,
"a", algorithmVersion);
99 arg (a,
"w", wrapping, nWrapping, maxWrapping);
101 argswitch (a,
"r", reduced,
true);
102 argswitch (a,
"bx", addBoundariesX,
false);
103 argswitch (a,
"ba", addBoundariesA,
false);
104 argswitch (a,
"b", addNoBoundaries,
true);
105 argswitch (a,
"dpi", displayPi,
true);
106 argswitch (a,
"dincl", displayIncl,
true);
107 argswitch (a,
"dphi", displayPhi,
true);
108 argswitch (a,
"drepr", displayRepr,
true);
109 argswitch (a,
"-verify", verify,
true);
112 argstreamprepare (a);
113 int argresult = a. analyze (argc, argv);
118 sout << title <<
'\n';
123 sout <<
"Call with '--help' for help.\n";
128 if ((argresult > 0) || !Xname || (p < 0))
130 sout << helpinfo <<
'\n';
139 CellT::EmptyType::setExistence (
true);
141 #ifdef SPACE_WRAPPING 143 for (
int i = 0; i < nWrapping; ++ i)
145 setWrapping<typename CellT::WrapType>
146 (std::string (wrapping [i]));
151 chomp::homology::hashedset<CellT> H;
157 addBoundariesX && !addNoBoundaries,
158 addBoundariesA && !addNoBoundaries);
159 bool relativeComplex = !L. empty ();
166 sout <<
"Carrying out computations " 167 "in a combinatorial way (ring Z_2).\n";
170 H, pi, incl, phi, cellNames,
171 displayPi, displayIncl, displayPhi,
172 displayRepr, verify, algorithmVersion);
179 sout <<
"Carrying out computations in the ring " <<
180 CoefT::ringsymbol () <<
".\n";
183 H, pi, incl, phi, cellNames,
184 displayPi, displayIncl, displayPhi,
185 displayRepr, verify, algorithmVersion);
188 program_time =
"Total time used:";
192 catch (
const char *msg)
194 sout <<
"ERROR: " << msg <<
'\n';
197 catch (
const std::exception &e)
199 sout <<
"ERROR: " << e. what () <<
'\n';
204 sout <<
"ABORT: An unknown error occurred.\n";
210 #endif // _ATMODMAIN_H_ Elements of the ring Z_p.
A linear map for coefficients in an arbitrary commutative ring.
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 combinatorial linear map (for coefficients in Z_2).
Tools for coordinate wrapping, a.k.a.
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.
int atModelMain(int argc, char *argv [], const char *title, const char *helpinfo)
The main procedure for a program for the computation of a homology gradient vector field...
An element of the ring Z_p, where p is globally set.
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.
A generic procedure for the computation of chain contraction of a filtered cell complex stored in a f...