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;
135 unsigned size()
const;
147 unsigned delta()
const;
150 const D&
dp(
unsigned i)
const;
153 bool has(
const D&
dp)
const;
159 template <
typename W>
167 const mln_coord(D)& dcol);
170 const mln_coord(D)& drow,
171 const mln_coord(D)& dcol);
184 void print(std::ostream& ostr)
const;
190 unsigned delta_(
int i)
const;
200 template <
typename D>
205 # ifndef MLN_INCLUDE_ONLY
209 template <
typename D>
217 template <
typename D>
222 window<D> cpy = *
this;
227 template <
typename D>
235 template <
typename D>
241 const unsigned n = size();
242 for (
unsigned i = 0; i < n; ++i)
243 tmp.insert(- this->dp(i));
247 template <
typename D>
252 return dps_.is_empty();
255 template <
typename D>
263 template <
typename D>
269 const unsigned n = size();
270 for (
unsigned i = 0; i < n; ++i)
272 unsigned dd = delta_(
dp(i));
279 template <
typename D>
282 window<D>::delta_(
int i)
const
287 template <
typename D>
290 window<D>::delta_(
const Gdpoint<D>& dp)
const
295 template <
typename D>
300 return dps_.nelements();
303 template <
typename D>
308 mln_precondition(i < size());
312 template <
typename D>
320 template <
typename D>
322 const std::vector<D>&
325 return dps_.std_vector();
328 template <
typename D>
337 template <
typename D>
338 template <
typename W>
344 const unsigned n = win.size();
345 for (
unsigned i = 0; i < n; ++i)
346 dps_.insert(win.dp(i));
350 template <
typename D>
355 mlc_bool(D::dim == 1)::check();
360 template <
typename D>
364 const mln_coord(D)& dcol)
366 mlc_bool(D::dim == 2)::check();
371 template <
typename D>
375 const mln_coord(D)& drow,
376 const mln_coord(D)& dcol)
378 mlc_bool(D::dim == 3)::check();
379 D dp(dsli, drow, dcol);
383 template <
typename D>
391 template <
typename D>
402 template <
typename D>
406 return lhs.dps_hook_() == rhs.dps_hook_();
409 # endif // ! MLN_INCLUDE_ONLY
414 # include <mln/core/dpsites_piter.hh>
417 #endif // ! MLN_CORE_WINDOW_HH