The ChainCon Software (Release 0.03)
awdiag2dcub.cpp
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file
4 ///
5 /// A program for the computation of the Alexander-Whitney diagonal
6 /// for cubical complexes, using Serre's formula.
7 ///
8 /////////////////////////////////////////////////////////////////////////////
9 
10 // Copyright (C) 2009-2016 by Pawel Pilarczyk.
11 //
12 // This file is part of my research software package. This is free software:
13 // you can redistribute it and/or modify it under the terms of the GNU
14 // General Public License as published by the Free Software Foundation,
15 // either version 3 of the License, or (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this software; see the file "license.txt". If not,
24 // please, see <http://www.gnu.org/licenses/>.
25 
26 // Started on March 24, 2009. Last revision: January 6, 2013.
27 
28 
29 // include the hashing definitions (before including "hashsets.h")
30 #include "chaincon/stringhash.h"
31 #include "chaincon/pair.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 #include "chaincon/awdiagcub.h"
42 #define SPACE_WRAPPING
43 #include "awdiag2dmain.h"
44 
45 
46 // --------------------------------------------------
47 // -------------------- OVERTURE --------------------
48 // --------------------------------------------------
49 
50 /// The title of the program and licensing information.
51 const char *title = "\
52 Alexander-Whitney diagonal for cubical complexes (Serre's formula).\n\
53 Version 0.02 (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 the Alexander-Whitney diagonal for 2-dimensional\n\
59 homology generators, and represents the result in terms of 1-dimensional\n\
60 homology genrators. In other words, this program decomposes cavities\n\
61 into products of cycles.\n\
62 The ring of coefficients is set to Z_2, the integers modulo 2.\n\
63 Call with:\n\
64 filename - the name of a file that contains a list of cubical cells,\n\
65 Switches and additional arguments:\n\
66 filename2 - the name of an additional file for relative homology;\n\
67 -ddiag - display the A-W diagonal of each 2D homology generator,\n\
68 -aN - homology algorithm: 0 = old (very slow), 1 = new without additional\n\
69 \toptimization (relatively fast), 2 = new (default), 3 = using the SNF.\n\
70 -r - compute reduced homology (with the empty set as a cell of dim -1),\n\
71 -b - don't add boundary cells (use -bx and -ba for X and A selectively),\n\
72 -w N1,..,Nk - set space wrapping, a.k.a. periodic boundary conditions;\n\
73 \trepeat the n-tuple for each dimension n; use 0 for no wrapping,\n\
74 --verify - do additional verification of the computed A-W diagonal,\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 awdiag2dMain<tCubCell<int_t,SettableWrapping<int_t>,
91  SettableEmptyCell> > (argc, argv, title, helpinfo);
92 } /* main */
93 
A cubical version of the Alexander-Whitney diagonal.
const char * title
The title of the program and licensing information.
Definition: awdiag2dcub.cpp:51
int main(int argc, char *argv [])
The main procedure of the program.
Definition: awdiag2dcub.cpp:88
const char * helpinfo
Brief help information on the program&#39;s usage.
Definition: awdiag2dcub.cpp:57
Tools for coordinate wrapping, a.k.a.
A cubical cell.
Hashing keys for std::string.
The main procedure of a generic program for the computation of the Alexander-Whitney diagonal...
The decision on whether the empty cell should be used as a valid cell of dimension -1...
A pair of elements.
An empty cell existence decision class with settable global flag.
Definition: emptycell.h:70