27 #ifndef MLN_CORE_SITE_SET_P_VERTICES_HH
28 # define MLN_CORE_SITE_SET_P_VERTICES_HH
34 # include <mln/core/concept/function.hh>
35 # include <mln/core/internal/site_set_base.hh>
36 # include <mln/core/site_set/p_graph_piter.hh>
37 # include <mln/core/site_set/p_vertices_psite.hh>
38 # include <mln/util/graph.hh>
39 # include <mln/util/internal/id2element.hh>
47 template <
typename G,
typename F>
class p_vertices;
53 template <
typename G,
typename F>
54 struct site_set_< p_vertices<G,F> >
56 typedef trait::site_set::nsites::known
nsites;
58 typedef trait::site_set::bbox::unknown
bbox;
59 typedef trait::site_set::contents::fixed
contents;
60 typedef trait::site_set::arity::unique
arity;
70 template <
typename G,
typename F = util::
internal::
id2element<G,util::vertex<G> > >
111 template <
typename F2>
116 template <
typename F2>
156 bool has(const psite&
p) const;
159 template <typename G2>
160 bool has(const util::
vertex<G2>& v) const;
171 mln_result(F) operator()(const psite&
p) const;
172 mln_result(F) operator()(const util::
vertex<G>&
p) const;
173 mln_result(F) operator()(
unsigned id_v) const;
179 const G&
graph() const;
194 template <typename G, typename F>
210 template <typename G, typename F>
216 # ifndef MLN_INCLUDE_ONLY
218 template <
typename G,
typename F>
224 template <
typename G,
typename F>
229 mlc_equal(F, F_REF)::check();
236 template <
typename G,
typename F>
245 template <
typename G,
typename F>
246 template <
typename F2>
251 mlc_converts_to(F2,F)::check();
257 template <
typename G,
typename F>
258 template <
typename F2>
262 mln_precondition(other.is_valid());
263 mlc_converts_to(F2,F)::check();
269 template <
typename G,
typename F>
277 template <
typename G,
typename F>
282 return this->g_.v_nmax();
285 template <
typename G,
typename F>
290 return g_.is_valid();
293 template <
typename G,
typename F>
301 template <
typename G,
typename F>
310 template <
typename G,
typename F>
311 template <
typename G2>
319 v.graph().is_subgraph_of(g_) &&
336 template <
typename G,
typename F>
346 template <
typename G,
typename F>
349 p_vertices<G,F>::operator()(const psite& p)
const
351 mln_precondition(g_.has(p.v()));
352 return (*
this)(p.v().id());
355 template <
typename G,
typename F>
360 mln_precondition(g_.has_v(v));
361 return (*
this)(v.id());
364 template <
typename G,
typename F>
367 p_vertices<G,F>::operator()(
unsigned id_v)
const
369 mln_precondition(g_.has_v(id_v));
373 template <
typename G,
typename F>
382 template <
typename G,
typename F>
390 template <
typename G,
typename F>
392 operator==(
const p_vertices<G,F>& lhs,
const p_vertices<G,F>& rhs)
394 return (lhs.graph()) == (rhs.graph());
397 template <
typename G,
typename F>
399 operator<=(const p_vertices<G,F>& lhs,
const p_vertices<G,F>&
rhs)
404 # endif // ! MLN_INCLUDE_ONLY
409 #endif // ! MLN_CORE_SITE_SET_P_VERTICES_HH