26 #ifndef MLN_CORE_BOX_RUNSTART_PITER_HH
27 # define MLN_CORE_BOX_RUNSTART_PITER_HH
33 # include <mln/core/internal/site_iterator_base.hh>
34 # include <mln/core/site_set/box.hh>
37 #define mln_box_runstart_piter(I) typename mln::box_runstart_piter<mln_psite(I)>
38 #define mln_box_runstart_piter_(I) mln::box_runstart_piter<mln_psite_(I)>
50 public internal::site_set_iterator_base< box<P>,
51 box_runstart_piter<P> >
54 typedef internal::site_set_iterator_base< box<P>,
self_ > super_;
58 enum { dim = super_::dim };
67 void init_(
const box<P>& b);
72 bool is_valid_()
const;
92 # ifndef MLN_INCLUDE_ONLY
103 template <
typename P>
110 template <
typename P>
115 this->change_target(b);
119 template <
typename P>
122 box_runstart_piter<P>::is_valid_()
const
124 return p_[0] !=
static_cast<mln_coord(P)
>(s_->pmax()[0] + 1);
127 template <
typename P>
130 box_runstart_piter<P>::invalidate_()
132 p_[0] =
static_cast<mln_coord(P)
>(s_->pmax()[0] + 1);
135 template <
typename P>
138 box_runstart_piter<P>::start_()
143 template <
typename P>
146 box_runstart_piter<P>::next_()
151 for (
int c = dim - 2; c >= 0; --c)
153 if (p_[c] != s_->pmax()[c])
159 p_[c] = s_->pmin()[c];
162 if (p_ == s_->pmin())
166 template <
typename P>
171 return s_->len(dim - 1);
175 # endif // ! MLN_INCLUDE_ONLY
180 #endif // ! MLN_CORE_BOX_RUNSTART_PITER_HH