27 #ifndef MLN_CORE_WINDOW_HH
28 # define MLN_CORE_WINDOW_HH
44 # include <mln/core/internal/window_base.hh>
45 # include <mln/core/concept/gdpoint.hh>
47 # include <mln/metal/is_a.hh>
48 # include <mln/util/set.hh>
49 # include <mln/fun/i2v/all_to.hh>
50 # include <mln/norm/linfty.hh>
51 # include <mln/literal/zero.hh>
58 template <
typename D>
class window;
59 template <
typename V>
class dpsites_fwd_piter;
60 template <
typename V>
class dpsites_bkd_piter;
68 struct window_< mln::window<D> >
70 typedef trait::window::size::fixed size;
71 typedef trait::window::support::regular support;
72 typedef trait::window::definition::unique definition;
85 class window :
public internal::window_base< D, window<D> >
133 unsigned size()
const;
145 unsigned delta()
const;
148 const D&
dp(
unsigned i)
const;
151 bool has(
const D&
dp)
const;
157 template <
typename W>
165 const mln_coord(D)& dcol);
168 const mln_coord(D)& drow,
169 const mln_coord(D)& dcol);
180 void print(std::ostream& ostr)
const;
186 unsigned delta_(
int i)
const;
196 template <
typename D>
201 # ifndef MLN_INCLUDE_ONLY
205 template <
typename D>
213 template <
typename D>
223 template <
typename D>
231 template <
typename D>
237 const unsigned n = size();
238 for (
unsigned i = 0; i < n; ++i)
239 tmp.
insert(- this->dp(i));
243 template <
typename D>
248 return dps_.is_empty();
251 template <
typename D>
259 template <
typename D>
265 const unsigned n = size();
266 for (
unsigned i = 0; i < n; ++i)
268 unsigned dd = delta_(dp(i));
275 template <
typename D>
283 template <
typename D>
286 window<D>::delta_(
const Gdpoint<D>& dp)
const
291 template <
typename D>
296 return dps_.nelements();
299 template <
typename D>
304 mln_precondition(i < size());
308 template <
typename D>
316 template <
typename D>
318 const std::vector<D>&
321 return dps_.std_vector();
324 template <
typename D>
333 template <
typename D>
334 template <
typename W>
339 const W& win = exact(win_);
340 const unsigned n = win.size();
341 for (
unsigned i = 0; i < n; ++i)
342 dps_.insert(win.dp(i));
346 template <
typename D>
351 mlc_bool(D::dim == 1)::check();
356 template <
typename D>
360 const mln_coord(D)& dcol)
362 mlc_bool(D::dim == 2)::check();
367 template <
typename D>
371 const mln_coord(D)& drow,
372 const mln_coord(D)& dcol)
374 mlc_bool(D::dim == 3)::check();
375 D dp(dsli, drow, dcol);
379 template <
typename D>
382 window<D>::dps_hook_()
const
387 template <
typename D>
398 template <
typename D>
402 return lhs.dps_hook_() == rhs.dps_hook_();
405 # endif // ! MLN_INCLUDE_ONLY
410 # include <mln/core/dpsites_piter.hh>
413 #endif // ! MLN_CORE_WINDOW_HH