28 #ifndef _CHAINCON_CRING_H_ 29 #define _CHAINCON_CRING_H_ 38 #include "chomp/system/config.h" 39 #include "chomp/struct/hashsets.h" 40 #include "chomp/struct/multitab.h" 58 template <
class CellT,
class CoefT>
59 inline void cring (
const std::vector<std::vector<CellT> > &cohomRepresentants,
67 int maxDim = cohomRepresentants. size ();
68 for (
int dim = 0; dim < maxDim; ++ dim)
71 int size = cohomRepresentants [dim]. size ();
72 for (
int i = 0; i < size; ++ i)
75 const CellT &cell = cohomRepresentants [dim] [i];
89 int_t awdiagSize = awdiag. size ();
95 for (
int dim1 = 0; dim1 <= dim; ++ dim1)
97 int dim2 = dim - dim1;
98 int size1 = cohomRepresentants [dim1]. size ();
99 int size2 = cohomRepresentants [dim2]. size ();
100 for (
int i1 = 0; i1 < size1; ++ i1)
103 cohomRepresentants [dim1] [i1];
104 for (
int i2 = 0; i2 < size2; ++ i2)
107 cohomRepresentants [dim2] [i2];
108 for (int_t j = 0; j < awdiagSize; ++ j)
110 if (!(awdiag. left (j) == cell1))
112 if (!(awdiag. right (j) == cell2))
114 CoefT coef (awdiag. coef (j));
117 int_t n = cellPairs. add
118 (CellPair (cell1, cell2));
119 cupProducts [n]. add (cell, coef);
180 #endif // _CHAINCON_CRING_H_ A pair of elements of two (possibly different) types.
void cring(const std::vector< std::vector< CellT > > &cohomRepresentants, const tLinMap< CellT, CellT, CoefT > &pi, const tLinMap< CellT, CellT, CoefT > &incl, chomp::homology::hashedset< tPair< CellT, CellT > > &cellPairs, chomp::homology::multitable< tChain< CellT, CoefT > > &cupProducts)
Computes the cohomology ring, given a minimal model and cohomology representants. ...
A linear map for coefficients in an arbitrary commutative ring.
A chain with coefficients in an arbitrary ring.
A chain with coefficients in an arbitrary commutative ring.
void AWdiagonal(const tCombChain< CellT > &ch, tCombTensor< CellT, CellT > &t)
Computes the Alexander-Whitney diagonal of a chain, using the procedure defined for individual cells...
Alexander-Whitney diagonal of a chain.