27 #ifndef MLN_CORE_SITE_SET_P_IMAGE_HH
28 # define MLN_CORE_SITE_SET_P_IMAGE_HH
38 # include <mln/core/site_set/p_if.hh>
39 # include <mln/fun/ops.hh>
40 # include <mln/pw/value.hh>
41 # include <mln/pw/cst.hh>
42 # include <mln/data/fill_with_value.hh>
50 template <
typename I>
class p_image;
57 struct site_set_< p_image<I> >
59 typedef trait::site_set::nsites::known
nsites;
60 typedef trait::site_set::bbox::unknown
bbox;
61 typedef trait::site_set::contents::free
contents;
62 typedef trait::site_set::arity::unique
arity;
75 typedef mln_domain(I) S_;
126 bool has(const psite&) const;
146 void remove(const psite& p);
150 void toggle(const psite& p);
173 # ifndef MLN_INCLUDE_ONLY
175 template <
typename I>
183 template <
typename I>
190 template <
typename I>
194 mln_precondition(ima.is_valid());
199 template <
typename I>
205 return ima_.domain().has(p) && ima_(p) ==
true;
208 template <
typename I>
213 return ima_.is_valid();
216 template <
typename I>
224 template <
typename I>
230 mln_precondition(ima_.domain().has(p));
237 template <
typename I>
243 mln_precondition(ima_.domain().has(p));
244 if (ima_(p) ==
false)
247 mln_assertion(nsites_ > 0);
251 template <
typename I>
257 mln_precondition(ima_.domain().has(p));
262 mln_assertion(nsites_ > 0);
273 template <
typename I>
279 return sizeof(*this);
283 template <
typename I>
294 template <
typename I>
303 # endif // ! MLN_INCLUDE_ONLY
308 #endif // ! MLN_CORE_SITE_SET_P_IMAGE_HH