
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Fixes. * mln/core/internal/piter_adaptor.hh, * mln/core/line_piter.hh, * mln/core/vec_p_piter.hh: Import dim for g++-4.1. * mln/level/paste.hh (paste_): Rename as... (paste_pw_, paste_fast_): ...these. (paste_): New with dynamic disjunction. core/internal/piter_adaptor.hh | 4 ++++ core/line_piter.hh | 2 ++ core/vec_p_piter.hh | 12 ++++++++++++ level/paste.hh | 21 +++++++++++++++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) Index: mln/core/internal/piter_adaptor.hh --- mln/core/internal/piter_adaptor.hh (revision 1127) +++ mln/core/internal/piter_adaptor.hh (working copy) @@ -51,8 +51,12 @@ template <typename Pi, typename E> class piter_adaptor_ : public internal::point_iterator_base_< mln_psite(Pi), E > { + typedef internal::point_iterator_base_< mln_psite(Pi), E > super_; public: + // Make dim definition from super class available. + enum { dim = super_::dim }; + /// Constructor from a point iterator \p piter. piter_adaptor_(const Pi& piter); Index: mln/core/line_piter.hh --- mln/core/line_piter.hh (revision 1127) +++ mln/core/line_piter.hh (working copy) @@ -31,6 +31,8 @@ /*! \file mln/core/line_piter.hh * * \brief Definition of iterators on points by lines. + * + * \todo Rename as box_line_piter. */ # include <mln/core/internal/point_iterator_base.hh> Index: mln/core/vec_p_piter.hh --- mln/core/vec_p_piter.hh (revision 1127) +++ mln/core/vec_p_piter.hh (working copy) @@ -45,6 +45,12 @@ template <typename P> struct vec_p_fwd_piter_ : public internal::point_iterator_base_< P, vec_p_fwd_piter_<P> > { + typedef vec_p_fwd_piter_<P> self_; + typedef internal::point_iterator_base_< P, self_ > super_; + public: + + // Make definitions from super class available. + enum { dim = super_::dim }; /// Coordinate associated type. template <typename S> @@ -85,6 +91,12 @@ template <typename P> struct vec_p_bkd_piter_ : public internal::point_iterator_base_< P, vec_p_bkd_piter_<P> > { + typedef vec_p_bkd_piter_<P> self_; + typedef internal::point_iterator_base_< P, self_ > super_; + public: + + // Make definitions from super class available. + enum { dim = super_::dim }; /// Coordinate associated type. template <typename S> Index: mln/level/paste.hh --- mln/level/paste.hh (revision 1127) +++ mln/level/paste.hh (working copy) @@ -70,7 +70,7 @@ { template <typename I, typename J> - void paste_(const Image<I>& data_, Image<J>& destination_) + void paste_pw_(const Image<I>& data_, Image<J>& destination_) { const I& data = exact(data_); J& destination = exact(destination_); @@ -81,7 +81,7 @@ } template <typename I, typename J> - void paste_(const Fast_Image<I>& data_, Fast_Image<J>& destination_) + void paste_fast_(const Fast_Image<I>& data_, Fast_Image<J>& destination_) { const I& data = exact(data_); J& destination = exact(destination_); @@ -96,6 +96,23 @@ n); } + // Disjunction. + + template <typename I, typename J> + void paste_(const Image<I>& data, Image<J>& destination) + { + paste_pw_(data, destination); + } + + template <typename I, typename J> + void paste_(const Fast_Image<I>& data, Fast_Image<J>& destination) + { + if (sizeof(mln_value(I)) = sizeof(mln_value(J))) + paste_fast_(data, destination); + else + paste_pw_(data, destination); + } + } // end of namespace mln::level::impl