27 #ifndef MLN_WIN_MULTIPLE_HH
28 # define MLN_WIN_MULTIPLE_HH
36 # include <mln/core/window.hh>
37 # include <mln/core/internal/site_relative_iterator_base.hh>
38 # include <mln/util/array.hh>
48 template <
typename W,
typename F>
class multiple;
49 template <
typename W,
typename F>
class multiple_qiter;
57 template <
typename W,
typename F>
58 struct window_<
win::multiple<W,F> >
60 typedef trait::window::size::fixed
size;
61 typedef trait::window::support::regular
support;
62 typedef trait::window::definition::n_ary
definition;
76 template <
typename W,
typename F>
81 private metal::and_< mlc_is(mln_trait_window_size(W),
82 trait::window::size::fixed),
83 mlc_is(mln_trait_window_support(W),
84 trait::window::support::regular) >::check_t
108 const W&
window_(
unsigned i) const;
114 unsigned size() const;
116 const mln_dpsite(W)&
ith_dp_around(
unsigned i, const mln_psite(W)&
p) const;
124 unsigned delta() const;
133 template <typename W, typename F>
135 : public internal::site_relative_iterator_base<
multiple<W,F>,
143 template <
typename Pref>
150 template <
typename Pref>
154 bool is_valid_()
const;
166 mln_psite(W) compute_p_()
const;
175 # ifndef MLN_INCLUDE_ONLY
179 template <
typename W,
typename F>
186 template <
typename W,
typename F>
193 template <
typename W,
typename F>
198 return win_.is_empty();
201 template <
typename W,
typename F>
206 mln_precondition(i == win_.nelements());
208 mln_precondition(win.size() == win_[0].size());
212 template <
typename W,
typename F>
217 mln_precondition(i < win_.nelements());
221 template <
typename W,
typename F>
226 return win_.nelements();
229 template <
typename W,
typename F>
237 template <
typename W,
typename F>
242 mln_precondition(win_.nelements() >= 2);
243 unsigned s = win_[0].size();
244 for (
unsigned i = 1; i < win_.nelements(); ++i)
245 mln_precondition(win_[i].size() == s);
249 template <
typename W,
typename F>
254 mln_precondition(win_.nelements() >= 1);
255 for (
unsigned i = 0; i < win_.nelements(); ++i)
256 if (! win_[i].is_centered())
261 template <
typename W,
typename F>
266 mln_precondition(win_.nelements() >= 1);
267 for (
unsigned i = 0; i < win_.nelements(); ++i)
268 if (! win_[i].is_symmetric())
274 template <
typename W,
typename F>
279 mln_precondition(win_.nelements() >= 1);
280 for (
unsigned i = 0; i < win_.nelements(); ++i)
284 template <
typename W,
typename F>
289 mln_precondition(win_.nelements() >= 1);
290 unsigned d = win_[0].delta();
291 for (
unsigned i = 1; i < win_.nelements(); ++i)
293 unsigned d_i = win_[i].delta();
300 template <
typename W,
typename F>
305 mln_precondition(f_(p) < win_.nelements());
306 mln_precondition(i < win_[f_(p)].size());
307 return win_[f_(p)].dp(i);
313 template <
typename W,
typename F>
319 template <
typename W,
typename F>
320 template <
typename Pref>
327 template <
typename W,
typename F>
328 template <
typename Pref>
339 template <
typename W,
typename F>
345 this->super_::change_target(w);
348 template <
typename W,
typename F>
356 template <
typename W,
typename F>
364 template <
typename W,
typename F>
372 template <
typename W,
typename F>
380 template <
typename W,
typename F>
383 multiple_qiter<W,F>::compute_p_()
const
385 return *this->c_ + this->s_->ith_dp_around(i_, *this->c_);
388 # endif // ! MLN_INCLUDE_ONLY
396 #endif // ! MLN_WIN_MULTIPLE_HH