27 #ifndef MLN_TRANSFORM_INTERNAL_CLOSEST_POINT_FUNCTOR_HH
28 # define MLN_TRANSFORM_INTERNAL_CLOSEST_POINT_FUNCTOR_HH
34 # include <mln/core/site_set/p_array.hh>
35 # include <mln/core/macros.hh>
36 # include <mln/data/fill.hh>
37 # include <mln/trait/ch_value.hh>
56 typedef mln_value(I)
V;
57 typedef mln_psite(I)
P;
69 void process(const P&, const P&);
72 void init_(const I& input);
86 typedef mln_value(I) V;
87 typedef mln_psite(I) P;
89 closest_point_functor_with_sites();
91 mln_ch_value(I,P) cp_ima;
98 void process(const P&, const P&);
101 void init_(const I& input);
105 void process_(
unsigned p,
unsigned n);
109 # ifndef MLN_INCLUDE_ONLY
111 template <
typename I>
114 const p_array<mln_psite(I)>& pset)
119 template <
typename I>
127 mln_piter(
p_array<mln_psite(I)>) p(pset_);
129 cp_ima(p) = p.index();
132 template <typename I>
137 return input_p ==
true;
140 template <
typename I>
147 template <
typename I>
152 return input_n ==
false;
155 template <
typename I>
159 cp_ima(n) = cp_ima(p);
164 template <
typename I>
172 template <
typename I>
177 return input_p ==
true;
180 template <
typename I>
186 template <
typename I>
191 return input_n ==
false;
194 template <
typename I>
199 cp_ima.element(n) = cp_ima.element(p);
208 template <
typename I>
214 template <
typename I>
223 template <
typename I>
228 return input_p ==
true;
231 template <
typename I>
239 template <
typename I>
244 return input_n ==
false;
247 template <
typename I>
252 cp_ima(n) = cp_ima(p);
257 template <
typename I>
265 template <
typename I>
270 return input_p ==
true;
273 template <
typename I>
277 cp_ima.element(p) = cp_ima.point_at_offset(p);
280 template <
typename I>
285 return input_n ==
false;
288 template <
typename I>
293 cp_ima.element(n) = cp_ima.element(p);
296 # endif // ! MLN_INCLUDE_ONLY
305 #endif // ! MLN_TRANSFORM_INTERNAL_CLOSEST_POINT_FUNCTOR_HH