30 #ifndef _CHAINCON_ATMODEL2_H_ 31 #define _CHAINCON_ATMODEL2_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;
76 sbug <<
"[AT Model Algorithm 2.]\n";
77 sout <<
"Computing an algebraic topological model...\n";
80 chomp::homology::timeused compTime;
84 chomp::homology::hashedset<CellT> homGener;
90 int_t KSize = K. size ();
91 for (int_t i = 0; i < KSize; ++ i)
95 scon << i <<
" out of " << KSize <<
", " <<
96 (i * 100 / KSize) <<
"% done.\r";
99 const CellT &c = K [i];
106 ch += phi (
boundary (cChain, restr));
135 int_t dsize = d. size ();
140 sout <<
"Debug: c = " << c <<
".\n";
141 sout <<
"Debug: bd_c = " <<
143 sout <<
"Debug: ch = " << ch <<
".\n";
144 sout <<
"Debug: bd_ch = " << bd_ch <<
".\n";
145 throw "Empty boundary in the homology algorithm.";
149 const CellT &u = d. getCell (0);
159 int_t size = piTu. size ();
160 for (int_t j = 0; j < size; ++ j)
163 const CellT &cj = piTu. getCell (j);
178 for (int_t k = 0; k < dsize; ++ k)
181 const CellT &dk (d. getCell (k));
200 homGener.
remove (u);
206 int_t genSize = homGener. size ();
207 for (int_t i = 0; i < genSize; ++ i)
208 H. push_back (homGener [i]);
211 sout <<
"AT model computed in " << compTime <<
".\n";
217 #endif // _CHAINCON_ATMODEL2_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 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"...
A combinatorial linear map.