30 #ifndef _CHAINCON_ATMODEL1_H_ 31 #define _CHAINCON_ATMODEL1_H_ 39 #include "chomp/system/config.h" 40 #include "chomp/system/textfile.h" 41 #include "chomp/system/timeused.h" 42 #include "chomp/struct/hashsets.h" 59 template <
class CellT,
class CellArray1,
class CellArray2,
class CellRestrT>
64 const CellRestrT &restr)
66 using chomp::homology::sout;
67 using chomp::homology::scon;
68 using chomp::homology::sbug;
75 sbug <<
"[AT Model Algorithm 1.]\n";
76 sout <<
"Computing an algebraic topological model...\n";
79 chomp::homology::timeused compTime;
83 chomp::homology::hashedset<CellT> homGener;
86 int_t KSize = K. size ();
87 for (int_t i = 0; i < KSize; ++ i)
91 scon << i <<
" out of " << KSize <<
", " <<
92 (i * 100 / KSize) <<
"% done.\r";
95 const CellT &c = K [i];
128 sout <<
"Debug: c = " << c <<
".\n";
129 sout <<
"Debug: bd_c = " <<
131 sout <<
"Debug: ch = " << ch <<
".\n";
132 sout <<
"Debug: bd_ch = " << bd_ch <<
".\n";
133 throw "Empty boundary in the homology algorithm.";
137 const CellT &u = d. getCell (0);
140 for (int_t j = 0; j < i; ++ j)
143 const CellT &cj = K [j];
150 int_t pos = cjh. position (u);
162 homGener.
remove (u);
167 int_t genSize = homGener. size ();
168 for (int_t i = 0; i < genSize; ++ i)
169 H. push_back (homGener [i]);
172 sout <<
"AT model computed in " << compTime <<
".\n";
178 #endif // _CHAINCON_ATMODEL1_H_ A combinatorial chain, that is, a chain with Z_2 coefficients.
tCombChain< CellT > boundary(const tCombChain< CellT > &c, const CellRestrT &restr)
Returns the boundary of a given chain (takes boundary cells restricted by the given object...
A combinatorial linear map (for coefficients in Z_2).
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"...
A combinatorial linear map.