27 #ifndef MLN_TOPO_IS_SIMPLE_CELL_HH
28 # define MLN_TOPO_IS_SIMPLE_CELL_HH
33 # include <mln/core/concept/function.hh>
34 # include <mln/core/concept/image.hh>
36 # include <mln/core/site_set/p_set.hh>
38 # include <mln/topo/is_facet.hh>
39 # include <mln/make/attachment.hh>
71 template <
typename I,
typename N,
typename NL,
typename NH>
105 # ifndef MLN_INCLUDE_ONLY
107 template <
typename I,
typename N,
typename NL,
typename NH>
112 mlc_equal(mln_value(I),
bool)::check();
115 template <
typename I,
typename N,
typename NL,
typename NH>
120 mlc_equal(mln_value(I),
bool)::check();
123 template <
typename I,
typename N,
typename NL,
typename NH>
131 template <
typename I,
typename N,
typename NL,
typename NH>
136 mln_precondition(ima_);
139 const I& ima = *ima_;
145 if (!
is_facet(ima, p, higher_adj_nbh))
149 typedef p_set<mln_psite(I)> faces_t;
158 if (att.nsites() == 0)
169 while (att.nsites() > 1)
172 bool simple_pair_collapsed =
false;
176 mln_piter(faces_t) g(att);
180 if (static_cast<mln_psite(I)>(g).n() > 0)
183 bool g_is_facet =
true;
184 mln_niter(NH) f(higher_adj_nbh, g);
195 bool gh_is_simple_pair =
false;
196 mln_niter(NL) h(lower_adj_nbh, g);
199 bool h_strictly_in_g =
true;
202 mln_niter(NH) i(higher_adj_nbh, h);
204 if (i != g && att.has(i))
206 h_strictly_in_g =
false;
212 gh_is_simple_pair =
true;
215 mln_invariant(att.nsites() > 0);
222 if (gh_is_simple_pair)
224 simple_pair_collapsed =
true;
229 if (!simple_pair_collapsed)
236 mln_postcondition(att.nsites() == 1);
237 mln_postcondition(att[0].n() == 0);
244 # endif // MLN_INCLUDE_ONLY
250 #endif // ! MLN_TOPO_IS_SIMPLE_CELL_HH