The ChainCon Software (Release 0.03)
atmodel.h
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file
4 ///
5 /// Algebraic topological model computation: An interface to all the
6 /// algorithms available in this package.
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 9, 2013.
27 
28 
29 #ifndef _CHAINCON_ATMODEL_H_
30 #define _CHAINCON_ATMODEL_H_
31 
32 
33 // include relevant local header files
34 #include "chaincon/atmodel0.h"
35 #include "chaincon/atmodel1.h"
36 #include "chaincon/atmodel2.h"
37 #include "chaincon/atmodel2r.h"
38 #include "chaincon/atmodel3.h"
39 #include "chaincon/atmodel3r.h"
40 #include "chaincon/atmodel4r.h"
41 
42 
43 // --------------------------------------------------
44 // -------------------- AT model --------------------
45 // --------------------------------------------------
46 
47 /// Computes a combinatorial algebraic topological model for a given
48 /// filtered finite cell complex "K".
49 /// This function is an interface to the various algorithms
50 /// available in this package, numbered from 0 to 3.
51 /// Cells that represent homology generators are appended to the vector "H".
52 /// The projection map "pi", the inclusion from "H" to the complex "K",
53 /// and the homology gradient vector field "phi"
54 /// are assumed to be initially zero and are constructed.
55 template <class CellT, class CellArray1, class CellArray2, class CellRestrT>
56 inline void algTopModel (const CellArray1 &K, CellArray2 &H,
59  tCombLinMap<CellT,CellT> &phi, int version,
60  const CellRestrT &restr)
61 {
62  switch (version)
63  {
64  case 0:
65  algTopModel0 (K, H, pi, incl, phi, restr);
66  break;
67  case 1:
68  algTopModel1 (K, H, pi, incl, phi, restr);
69  break;
70  case 2:
71  algTopModel2 (K, H, pi, incl, phi, restr);
72  break;
73  case 3:
74  algTopModel3 (K, H, pi, incl, phi, restr);
75  break;
76  case 4:
77  throw "Algorithm 4 not implemented "
78  "for the combinatorial setting.\n"
79  "Please, use Algorithm 2 or 3 instead, "
80  "or Algorithm 4 with Z_2.";
81  default:
82  throw "Wrong homology algorithm requested.";
83  }
84  return;
85 } /* algTopModel */
86 
87 /// Computes an algebraict topological model for a given
88 /// filtered finite cell complex "K" for coeficients in a commutative ring.
89 /// Cells that represent homology generators are appended to the vector "H".
90 /// The projection map "pi", the inclusion from "H" to the complex "K",
91 /// and the homology gradient vector field "phi"
92 /// are assumed to be initially zero and are constructed.
93 template <class CellT, class CoefT, class CellArray1, class CellArray2,
94  class CellRestrT>
95 inline void algTopModel (const CellArray1 &K, CellArray2 &H,
98  tLinMap<CellT,CellT,CoefT> &phi, int version,
99  const CellRestrT &restr)
100 {
101  switch (version)
102  {
103  case 0:
104  throw "Algorithm 0 not implemented for Z_p. "
105  "Please, use algorithm 2 or 3.";
106  case 1:
107  throw "Algorithm 1 not implemented for Z_p. "
108  "Please, use algorithm 2 or 3.";
109  case 2:
110  algTopModel2 (K, H, pi, incl, phi, restr);
111  break;
112  case 3:
113  algTopModel3 (K, H, pi, incl, phi, restr);
114  break;
115  case 4:
116  algTopModel4 (K, H, pi, incl, phi, restr);
117  break;
118  default:
119  throw "Wrong homology algorithm requested.";
120  }
121  return;
122 } /* algTopModel */
123 
124 
125 #endif // _CHAINCON_ATMODEL_H_
126 
void algTopModel0(const CellArray1 &K, CellArray2 &H, tCombLinMap< CellT, CellT > &pi, tCombLinMap< CellT, CellT > &incl, tCombLinMap< CellT, CellT > &phi, const CellRestrT &restr)
Computes an algebraic topological model for a given filtered finite cell complex "K".
Definition: atmodel0.h:60
Algebraic topological model computation: Algorithm 1, new version, but still without computing the tr...
void algTopModel(const CellArray1 &K, CellArray2 &H, tCombLinMap< CellT, CellT > &pi, tCombLinMap< CellT, CellT > &incl, tCombLinMap< CellT, CellT > &phi, int version, const CellRestrT &restr)
Computes a combinatorial algebraic topological model for a given filtered finite cell complex "K"...
Definition: atmodel.h:56
void algTopModel3(const CellArray1 &K, CellArray2 &H, tCombLinMap< CellT, CellT > &pi, tCombLinMap< CellT, CellT > &incl, tCombLinMap< CellT, CellT > &phi, const CellRestrT &restr)
Computes an algebraic topological model for the given filtered finite cell complex "K"...
Definition: atmodel3.h:102
Algebraic topological model computation: Algorithm 0, very slow; combinatorial version - for coeffici...
Algebraic topological model computation: Algorithm 2, new version, with computing the transpose of th...
Algebraic topological model computation: Algorithm 3, using the SNF; version for an arbitrary commuta...
Algebraic topological model computation: Algorithm 3, using the SNF; combinatorial version - for coef...
A linear map.
Definition: linmap.h:55
void algTopModel1(const CellArray1 &K, CellArray2 &H, tCombLinMap< CellT, CellT > &pi, tCombLinMap< CellT, CellT > &incl, tCombLinMap< CellT, CellT > &phi, const CellRestrT &restr)
Computes an algebraic topological model for the given filtered finite cell complex "K"...
Definition: atmodel1.h:60
void algTopModel4(const CellArray1 &K, CellArray2 &H, tLinMap< CellT, CellT, CoefT > &pi, tLinMap< CellT, CellT, CoefT > &incl, tLinMap< CellT, CellT, CoefT > &phi, const CellRestrT &restr)
Computes an algebraic topological model for the given filtered finite cell complex "K"...
Definition: atmodel4r.h:69
Algebraic topological model computation: Algorithm 4, using the SNF; version for an arbitrary commuta...
void algTopModel2(const CellArray1 &K, CellArray2 &H, tCombLinMap< CellT, CellT > &pi, tCombLinMap< CellT, CellT > &incl, tCombLinMap< CellT, CellT > &phi, const CellRestrT &restr)
Computes an algebraic topological model for the given filtered finite cell complex "K"...
Definition: atmodel2.h:60
Algebraic topological model computation: Algorithm 2, new version, with computing the transpose of th...
A combinatorial linear map.
Definition: comblinmap.h:56