
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Fixes. * mln/trait/ch_value.hh: Fix version with unsigned. * mln/value/stack.hh: Update. * mln/core/internal/tracked_ptr.hh: Comply with g++-2.95. * mln/core/interpolated.hh (skeleton): New. (change_value): Remove. * mln/core/image2d_b.hh (init_with): New overload. * mln/core/cast_image.hh: Fix typo. * mln/core/macros.hh (ch_value): Move include... * mln/core/concept/object.hh: ...here. * mln/core/concept/image.hh: Fix include. * mln/level/paste.hh: Fix. * mln/metal/make/vec.hh: Remove; redundant with mln/make/vec.hh. * tests/stack.cc: Update. mln/core/cast_image.hh | 2 +- mln/core/concept/image.hh | 2 +- mln/core/concept/object.hh | 1 + mln/core/image2d_b.hh | 9 +++++++++ mln/core/internal/tracked_ptr.hh | 6 +++--- mln/core/interpolated.hh | 10 +++------- mln/core/macros.hh | 3 --- mln/level/paste.hh | 2 +- mln/trait/ch_value.hh | 4 ++-- mln/value/stack.hh | 2 +- tests/stack.cc | 2 +- 11 files changed, 23 insertions(+), 20 deletions(-) Index: tests/stack.cc --- tests/stack.cc (revision 1139) +++ tests/stack.cc (working copy) @@ -46,7 +46,7 @@ image2d_b<int> ima5(b), ima1(b); point2d p = make::point2d(0, 0); - metal::vec<2, int> v = metal::make::vec(5, 1); + metal::vec<2, int> v = make::vec(5, 1); value::stack(ima5, ima1)(p) = v; mln_assertion(value::stack(ima5, ima1)(p) = v); Index: mln/trait/ch_value.hh --- mln/trait/ch_value.hh (revision 1139) +++ mln/trait/ch_value.hh (working copy) @@ -85,9 +85,9 @@ typedef M< P, V > ret; }; - template < template <class, class> class M, unsigned n, typename I, + template < template <unsigned, class> class M, unsigned n, typename I, typename V > - struct ch_value_< M< tag::unsigned_<n>, tag::image<I> >, V > // value::stack ! + struct ch_value_< M< n, tag::image<I> >, V > // For mln::value::stack_image<n,I> ! { typedef metal::vec<n, V> value; typedef mln_ch_value(I, value) ret; Index: mln/core/macros.hh --- mln/core/macros.hh (revision 1139) +++ mln/core/macros.hh (working copy) @@ -205,8 +205,5 @@ -# include <mln/trait/ch_value.hh> - - #endif // ! MLN_CORE_MACROS_HH Index: mln/core/internal/tracked_ptr.hh --- mln/core/internal/tracked_ptr.hh (revision 1139) +++ mln/core/internal/tracked_ptr.hh (working copy) @@ -50,7 +50,7 @@ operator bool() const; /// Negation (for arithmetical tests). - bool operator not() const; + bool operator !() const; /*! \brief Mimics the behavior of op-> for a pointer in the const case. ** @@ -102,10 +102,10 @@ template <typename T> /// Negation (for arithmetical tests). - bool tracked_ptr<T>::operator not() const + bool tracked_ptr<T>::operator !() const { mln_invariant(run_()); - return not bool(*this); + return ! bool(*this); } template <typename T> Index: mln/core/interpolated.hh --- mln/core/interpolated.hh (revision 1139) +++ mln/core/interpolated.hh (working copy) @@ -64,6 +64,9 @@ typedef mln::value::set<value> vset; + /// Skeleton. + typedef interpolated< tag::image<I> > skeleton; + /// Constructor. interpolated(I& ima); @@ -91,13 +94,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. - template <typename U> - struct change_value - { - typedef mln_ch_value(I, U) ret; - }; - protected: I& ima_; }; Index: mln/core/image2d_b.hh --- mln/core/image2d_b.hh (revision 1139) +++ mln/core/image2d_b.hh (working copy) @@ -140,6 +140,15 @@ void init_with(const box2d& b, unsigned bdr = border::thickness); + /// Initialize an empty image. + template <typename I> + void init_with(const Image<I>& other) + { + mln_precondition(data_ = 0); + data_ = new image2d_b_data<T>(other.domain().bbox()); // FIXME: border? + } + + /// Test if \p p is valid. bool owns_(const point2d& p) const; Index: mln/core/cast_image.hh --- mln/core/cast_image.hh (revision 1139) +++ mln/core/cast_image.hh (working copy) @@ -68,7 +68,7 @@ /// Skeleton. - typedef cast_image< tag::value<T>, tag::image<I> > skeleton; + typedef cast_image_< tag::value<T>, tag::image<I> > skeleton; /// Constructor. Index: mln/core/concept/image.hh --- mln/core/concept/image.hh (revision 1139) +++ mln/core/concept/image.hh (working copy) @@ -36,7 +36,7 @@ # include <mln/core/concept/mesh.hh> # include <mln/core/trait/all.hh> // FIXME: Move out of core! -# include <mln/trait/ch_value.hh> // FIXME: Should be in all.hh! +# include <mln/trait/concrete.hh> // FIXME: Should be in all.hh! # include <mln/metal/is_a.hh> Index: mln/core/concept/object.hh --- mln/core/concept/object.hh (revision 1139) +++ mln/core/concept/object.hh (working copy) @@ -82,6 +82,7 @@ # include <mln/core/exact.hh> # include <mln/core/ops.hh> +# include <mln/trait/ch_value.hh> #endif // ! MLN_CORE_CONCEPT_OBJECT_HH Index: mln/level/paste.hh --- mln/level/paste.hh (revision 1139) +++ mln/level/paste.hh (working copy) @@ -101,7 +101,7 @@ template <typename I, typename J> void paste_(const Image<I>& data, Image<J>& destination) { - paste_pw_(data, destination); + paste_generic_(data, destination); } template <typename I, typename J> Index: mln/value/stack.hh --- mln/value/stack.hh (revision 1139) +++ mln/value/stack.hh (working copy) @@ -102,7 +102,7 @@ /// Skeleton. - typedef stack_image< tag::unsigned_<n>, tag::image<I> > skeleton; + typedef stack_image< n, tag::image<I> > skeleton; /// Constructor.