The ChainCon Software (Release 0.03)
cringcub.cpp
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file
4 ///
5 /// A program for the computation of the cohomology ring structure
6 /// with the cup product, using algebraic minimal models
7 /// for cubical sets.
8 ///
9 /////////////////////////////////////////////////////////////////////////////
10 
11 // Copyright (C) 2009-2016 by Pawel Pilarczyk.
12 //
13 // This file is part of my research software package. This is free software:
14 // you can redistribute it and/or modify it under the terms of the GNU
15 // General Public License as published by the Free Software Foundation,
16 // either version 3 of the License, or (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this software; see the file "license.txt". If not,
25 // please, see <http://www.gnu.org/licenses/>.
26 
27 // Started on March 24, 2009. Last revision: June 10, 2015.
28 
29 
30 // include the string hashing definitions (before including "hashsets.h")
31 #include "chaincon/stringhash.h"
32 
33 // include selected header files from the CHomP library
34 #include "chomp/system/config.h"
35 #include "chomp/struct/hashsets.h"
36 
37 // include relevant local header files
38 #include "chaincon/cubcell.h"
39 #include "chaincon/emptycell.h"
40 #include "chaincon/wrapping.h"
41 #define SPACE_WRAPPING
42 #include "chaincon/awdiagcub.h"
43 #include "cringmain.h"
44 
45 
46 // --------------------------------------------------
47 // -------------------- OVERTURE --------------------
48 // --------------------------------------------------
49 
50 /// The title of the program and licensing information.
51 const char *title = "\
52 Cubical cohomology ring computation using a chain contraction.\n\
53 Version 0.03 (Sep 24, 2015). Copyright (C) 1997-2016 by Pawel Pilarczyk.\n\
54 This is free software. No warranty. Consult 'license.txt' for details.";
55 
56 /// Brief help information on the program's usage.
57 const char *helpinfo = "\
58 This program computes cohomology groups of a cubical set\n\
59 and the cup product of cohomology generators, yielding the ring structure.\n\
60 The ring of coefficients for cohomology computation can be either set to Z\n\
61 or to Z_p (the integers modulo prime number p).\n\
62 Call with:\n\
63 filename - the name of a file that contains a list of cubical cells,\n\
64 Switches and additional arguments:\n\
65 filename2 - the name of an additional file for relative (co)homology;\n\
66 -pN - selection of the coefficients: p=0 for Z, p>1 for Z_p (default: 0);\n\
67 \tnote: one should use p <= 181,\n\
68 -r - compute reduced homology (with the empty set as a cell of dim -1),\n\
69 -b - don't add boundary cells (use -bx and -ba for X and A selectively),\n\
70 -w N1,..,Nk - set space wrapping, a.k.a. periodic boundary conditions;\n\
71 \trepeat the n-tuple for each dimension n; use 0 for no wrapping,\n\
72 -dpi, -dincl, -dphi - display the computed maps: pi, incl, phi,\n\
73 -dd - display the boundary map in the minimal model (the nontrivial part),\n\
74 --verify - do additional verification of the computed maps,\n\
75 --log filename - save the output to a file (without progress indicators),\n\
76 --quiet - suppress data output to the screen (whcih can be still logged),\n\
77 --help - display this brief help information only and exit.\n\
78 For more information please consult the accompanying documentation\n\
79 or ask the program's author at http://www.PawelPilarczyk.com/.";
80 
81 
82 // --------------------------------------------------
83 // ---------------------- main ----------------------
84 // --------------------------------------------------
85 
86 /// The main procedure of the program.
87 /// Returns: 0 = Ok, -1 = Error, 1 = Help displayed, 2 = Wrong arguments.
88 int main (int argc, char *argv [])
89 {
90  return cohomRingMain<tCubCell<int_t,SettableWrapping<int_t>,
91  SettableEmptyCell> > (argc, argv, title, helpinfo);
92 } /* main */
93 
const char * title
The title of the program and licensing information.
Definition: cringcub.cpp:51
A cubical version of the Alexander-Whitney diagonal.
The main function of a program for computing the cubical cohomology ring of a cellular complex of a g...
int main(int argc, char *argv [])
The main procedure of the program.
Definition: cringcub.cpp:88
Tools for coordinate wrapping, a.k.a.
A cubical cell.
const char * helpinfo
Brief help information on the program&#39;s usage.
Definition: cringcub.cpp:57
Hashing keys for std::string.
The decision on whether the empty cell should be used as a valid cell of dimension -1...
An empty cell existence decision class with settable global flag.
Definition: emptycell.h:70