29 #ifndef _CHAINCON_EZ_AW_H_ 30 #define _CHAINCON_EZ_AW_H_ 38 #include "chomp/system/config.h" 51 template <
class ArrayT,
class SimCellT>
52 inline void AW_cells (ArrayT &sb,
const SimCellT &s,
bool left)
57 for (
int i = s. dim () - 1; i >= 0; -- i)
58 sb [i] = SimCellT (sb [i + 1], i + 1);
63 for (
int i = 0; i <= s. dim (); ++ i)
66 for (
int j = i - 1; j >= 0; -- j)
67 sb [i] = SimCellT (sb [i], j);
75 template <
class SimCellT>
76 inline void EZ_AW (
const SimCellT &s1,
const SimCellT &s2,
80 if (dim != s2. dim ())
81 throw "Different dimensions in the AW operator.";
83 std::vector<SimCellT> s1b (dim + 1);
85 std::vector<SimCellT> s2b (dim + 1);
88 for (
int n = 0; n <= dim; ++ n)
90 if (!s1b [n]. degenerate () && !s2b [n]. degenerate ())
91 t. add (s1b [n], s2b [n]);
98 template <
class SimCellT,
class CoefT>
99 inline void EZ_AW (
const SimCellT &s1,
const SimCellT &s2,
102 int dim = s1. dim ();
103 if (dim != s2. dim ())
104 throw "Different dimensions in the AW operator.";
106 std::vector<SimCellT> s1b (dim + 1);
108 std::vector<SimCellT> s2b (dim + 1);
112 for (
int n = 0; n <= dim; ++ n)
114 if (!s1b [n]. degenerate () && !s2b [n]. degenerate ())
115 t. add (s1b [n], s2b [n], coef);
125 template <
class ProdCellT>
126 inline void EZ_AW (
const ProdCellT &s,
129 EZ_AW (s. getLeft (), s. getRight (), t);
135 template <
class SimCellT,
class ProdCellT,
class CoefT>
136 inline void EZ_AW (
const ProdCellT &s,
139 EZ_AW (s. getLeft (), s. getRight (), t);
149 template <
class SimCellT,
class ProdCellT>
153 for (int_t n = 0; n < s. size (); ++ n)
156 EZ_AW (s. getCell (n), result);
165 template <
class SimCellT,
class ProdCellT,
class CoefT>
169 for (int_t n = 0; n < s. size (); ++ n)
172 EZ_AW (s. getCell (n), result);
173 result *= s. getCoef (n);
181 #endif // _CHAINCON_EZ_AW_H_ A chain with coefficients in an arbitrary ring.
A tensor of chains with coefficients in an arbitrary commutative ring.
Combinatorial tensor of cells.
A combinatorial tensor (for coefficients in Z_2).
void EZ_AW(const SimCellT &s1, const SimCellT &s2, tCombTensor< SimCellT, SimCellT > &t)
Computes the Alexander-Whitney operator on a product of simplicial cells.
void AW_cells(ArrayT &sb, const SimCellT &s, bool left)
Computes the compositions of face operators on the given simplicial cell to get the appropriate cells...