27 #ifndef MLN_CORE_STATIC_WINDOW_HH
28 # define MLN_CORE_STATIC_WINDOW_HH
46 # include <mln/core/internal/window_base.hh>
47 # include <mln/core/concept/gdpoint.hh>
49 # include <mln/metal/is_a.hh>
50 # include <mln/util/set.hh>
51 # include <mln/fun/i2v/all_to.hh>
52 # include <mln/norm/linfty.hh>
53 # include <mln/literal/zero.hh>
55 # include "apps/bench/static_array.hh"
62 template <
typename D,
unsigned n>
class static_window;
63 template <
typename V>
class dpsites_fwd_piter;
64 template <
typename V>
class dpsites_bkd_piter;
71 template <
typename D,
unsigned n>
74 typedef trait::window::size::fixed
size;
75 typedef trait::window::support::regular
support;
76 typedef trait::window::definition::unique
definition;
88 template <
typename D,
unsigned n>
135 unsigned size()
const;
147 unsigned delta()
const;
150 const D&
dp(
unsigned i)
const;
153 bool has(
const D&
dp)
const;
179 void print(std::ostream& ostr)
const;
185 unsigned delta_(
int i)
const;
195 template <
typename D,
unsigned n>
200 # ifndef MLN_INCLUDE_ONLY
204 template <
typename D,
unsigned n>
213 template <
typename D,
unsigned n>
218 static_window<D, n> cpy = *
this;
223 template <
typename D,
unsigned n>
231 template <
typename D,
unsigned n>
236 util::static_array<D, n> rev;
238 for (std::size_t i = 0; i < n; ++i)
239 rev[i] = dps_[n - 1 - i];
240 static_window<D, n> tmp(rev);
244 template <
typename D,
unsigned n>
260 template <
typename D,
unsigned n>
266 for (
unsigned i = 0; i < n; ++i)
268 unsigned dd = delta_(
dp(i));
275 template <
typename D,
unsigned n>
278 static_window<D, n>::delta_(
int i)
const
283 template <
typename D,
unsigned n>
286 static_window<D, n>::delta_(
const Gdpoint<D>& dp)
const
291 template <
typename D,
unsigned n>
299 template <
typename D,
unsigned n>
304 mln_precondition(i < n);
308 template <
typename D,
unsigned n>
371 template <
typename D,
unsigned n>
379 template <
typename D,
unsigned n>
390 template <
typename D,
unsigned n>
392 operator==(
const static_window<D, n>& lhs,
const static_window<D, n>&
rhs)
394 return lhs.dps_hook_() == rhs.dps_hook_();
397 # endif // ! MLN_INCLUDE_ONLY
402 # include <mln/core/dpsites_piter.hh>
405 #endif // ! MLN_CORE_STATIC_WINDOW_HH