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> > >
72 :
public internal::site_set_base_< mln_result(F), p_vertices<G,F> >
76 typedef internal::site_set_base_< mln_result(F), self_ > super_;
111 template <
typename F2>
116 template <
typename F2>
126 typedef p_vertices_psite<G,F>
psite;
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>
228 typedef util::internal::id2element<G,util::vertex<G> > F_REF;
229 mlc_equal(F, F_REF)::check();
231 mln_precondition(exact(g).
is_valid());
233 f_ = util::internal::id2element< G, util::vertex<G> >(g);
236 template <
typename G,
typename F>
240 mln_precondition(exact(g).
is_valid());
245 template <
typename G,
typename F>
246 template <
typename F2>
250 mln_precondition(exact(g).
is_valid());
251 mlc_converts_to(F2,F)::check();
254 convert::from_to(f, f_);
257 template <
typename G,
typename F>
258 template <
typename F2>
263 mlc_converts_to(F2,F)::check();
266 convert::from_to(other.
function(), f_);
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>
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>
397 template <
typename G,
typename F>
404 # endif // ! MLN_INCLUDE_ONLY
409 #endif // ! MLN_CORE_SITE_SET_P_VERTICES_HH