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" 62 template <
class CellT>
66 using namespace chomp::homology;
69 program_time =
"Aborted after";
76 bool addBoundariesX =
true;
77 bool addBoundariesA =
true;
78 bool addNoBoundaries =
false;
79 bool displayPi =
false;
80 bool displayIncl =
false;
81 bool displayPhi =
false;
82 bool displayD =
false;
85 const int maxWrapping = 100;
86 char *wrapping [maxWrapping];
96 arg (a,
"w", wrapping, nWrapping, maxWrapping);
98 argswitch (a,
"r", reduced,
true);
99 argswitch (a,
"bx", addBoundariesX,
false);
100 argswitch (a,
"ba", addBoundariesA,
false);
101 argswitch (a,
"b", addNoBoundaries,
true);
102 argswitch (a,
"dpi", displayPi,
true);
103 argswitch (a,
"dincl", displayIncl,
true);
104 argswitch (a,
"dphi", displayPhi,
true);
105 argswitch (a,
"dd", displayD,
true);
106 argswitch (a,
"-verify", verify,
true);
109 argstreamprepare (a);
110 int argresult = a. analyze (argc, argv);
115 sout << title <<
'\n';
120 sout <<
"Call with '--help' for help.\n";
125 if ((argresult > 0) || !Xname || (p < 0))
127 sout << helpinfo <<
'\n';
136 CellT::EmptyType::setExistence (
true);
138 #ifdef SPACE_WRAPPING 140 for (
int i = 0; i < nWrapping; ++ i)
142 setWrapping<typename CellT::WrapType>
143 (std::string (wrapping [i]));
153 chomp::homology::hashedset<CellT> H, A, B;
154 std::vector<CoefT> Q;
157 sout <<
"Carrying out computations in the ring " <<
158 CoefT::ringsymbol () <<
".\n";
168 addBoundariesX && !addNoBoundaries,
169 addBoundariesA && !addNoBoundaries);
171 sout <<
"=== Computing the minimal model ===\n";
173 pi, incl, phi, dummyCellNames, cellNames,
174 displayPi, displayIncl, displayPhi, displayD,
177 sout <<
"=== Computing the cohomology ring ===\n";
180 program_time =
"Total time used:";
184 catch (
const char *msg)
186 sout <<
"ERROR: " << msg <<
'\n';
189 catch (
const std::exception &e)
191 sout <<
"ERROR: " << e. what () <<
'\n';
196 sout <<
"ABORT: An unknown error occurred.\n";
202 #endif // _CRINGMAIN_H_ void computeCohomRing(const CellArray1 &H, const CellArray2 &A, const CellArray3 &B, const CoefArray &Q, const tLinMap< CellT, CellT, CoefT > &pi, const tLinMap< CellT, CellT, CoefT > &incl, CellNames &cellNames, bool verify)
Computes the cohomology ring, given a minimal model of a cell complex, and shows the result...
Elements of the ring Z_p.
A generic procedure for the computation of the cohomology ring structure for an algebraic minimal mod...
A generic procedure for the computation of an algebraic minimal model of a filtered cell complex stor...
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.
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 cohomRingMain(int argc, char *argv [], const char *title, const char *helpinfo)
The main procedure of a program for the computation of a cohomology ring.
void computeAlgMinModel(const tFilteredComplex< CellT > &K, bool relativeComplex, CellArray1 &H, CellArray2 &A, CellArray3 &B, CoefArray &Q, tLinMap< CellT, CellT, CoefT > &pi, tLinMap< CellT, CellT, CoefT > &incl, tLinMap< CellT, CellT, CoefT > &phi, CellNames &homCellNames, CellNames &cohomCellNames, bool displayPi, bool displayIncl, bool displayPhi, bool displayD, bool verify)
Computes the homology of a cellular complex.
An element of the ring Z_p, where p is globally set.