
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Several fixes. * mln/fun/internal/selector.hh (helper_selector_): Fix parameters order. * mln/fun/internal/selector.hh (selector_p2_): Rename as... (selector_from_result_): ...this. * mln/pw/cst.hh, * mln/pw/value.hh, * mln/fun/p2v/ternary.hh: Update. * tests/morpho/tree/compute_parent.cc: Layout. * mln/value/shell.hh (set_): Fix double definition. This is due to function concepts simplification. The fix is to de-activate one version of set_; this is a hack and the shell_ is now downgraded. * tests/core/site_set/p_bgraph.cc: Move... * trash/p_bgraph.cc: ...here. Fix missing trashing. * tests/core/site_set/Makefile.am: Update. mln/fun/internal/selector.hh | 9 +++---- mln/fun/p2v/ternary.hh | 2 - mln/pw/cst.hh | 2 - mln/pw/value.hh | 6 ++-- mln/value/shell.hh | 44 ++++++++++++++---------------------- tests/core/site_set/Makefile.am | 2 - tests/morpho/tree/compute_parent.cc | 4 ++- 7 files changed, 30 insertions(+), 39 deletions(-) Property changes on: trash/p_bgraph.cc ___________________________________________________________________ Added: svn:mergeinfo Index: mln/value/shell.hh --- mln/value/shell.hh (revision 3944) +++ mln/value/shell.hh (working copy) @@ -33,15 +33,14 @@ # include <mln/core/concept/function.hh> # include <mln/core/concept/image.hh> + namespace mln { // Forward declaration. - namespace value - { - template <typename F, typename I> - struct shell; - } // end of namespace mln::value + namespace value { + template <typename F, typename I> struct shell; + } namespace value { @@ -60,14 +59,6 @@ set_(I& ima, const mln_site(I)& s, mln_result(F) v); }; - - template <typename F, typename I> - struct shell_<F, I, Function_v2v<void> > - { - const mln_value(I)& - set_(I& ima, const mln_site(I)& s, mln_result(F) v); - }; - } // end of namespace mln::value::impl @@ -112,11 +103,13 @@ # ifndef MLN_INCLUDE_ONLY - // Ctor - + // Constructor. template <typename F, typename I> shell<F,I>::shell(Image<I>& ima, const mln_site(I)& s) - : ima_(exact(ima)), s_(s), v_(F()(exact(ima)(s))) + : + ima_(exact(ima)), + s_(s), + v_(F()(exact(ima)(s))) { } @@ -158,16 +151,15 @@ return ima(s); } - - template <typename F, typename I> - const mln_value(I)& - shell_<F, I, Function_v2v<void> >::set_(I& ima, - const mln_site(I)& s, - mln_result(F) v) - { - ima(s) = F().f_1(v, ima(s)); - return ima(s); - } +// template <typename F, typename I> +// const mln_value(I)& +// shell_<F, I, Function_v2v<void> >::set_(I& ima, +// const mln_site(I)& s, +// mln_result(F) v) +// { +// ima(s) = F().f_1(v, ima(s)); +// return ima(s); +// } } // end of namespace mln::value::impl Index: mln/pw/cst.hh --- mln/pw/cst.hh (revision 3944) +++ mln/pw/cst.hh (working copy) @@ -80,7 +80,7 @@ template <typename T> struct cst_ - : fun::internal::selector_p2_<T, cst_<T> >::ret + : fun::internal::selector_from_result_<T, cst_<T> >::ret { typedef T result; Index: mln/pw/value.hh --- mln/pw/value.hh (revision 3944) +++ mln/pw/value.hh (working copy) @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -49,7 +49,7 @@ template <typename I> struct value_ - : fun::internal::selector_p2_< mln_value(I), value_<I> >::ret + : fun::internal::selector_from_result_< mln_value(I), value_<I> >::ret { typedef mln_value(I) result; Index: mln/fun/p2v/ternary.hh --- mln/fun/p2v/ternary.hh (revision 3944) +++ mln/fun/p2v/ternary.hh (working copy) @@ -47,7 +47,7 @@ template <typename P, typename T, typename F> struct ternary_ - : fun::internal::selector_p2_<mln_result(T), ternary_<P,T,F> >::ret + : fun::internal::selector_from_result_<mln_result(T), ternary_<P,T,F> >::ret { typedef mln_result(T) result; Index: mln/fun/internal/selector.hh --- mln/fun/internal/selector.hh (revision 3944) +++ mln/fun/internal/selector.hh (working copy) @@ -48,14 +48,14 @@ { - template <typename A, typename R, typename E> + template <typename R, typename A, typename E> struct helper_selector_ { typedef Function_v2v<E> ret; }; template <typename A, typename E> - struct helper_selector_< A, bool, E > + struct helper_selector_< bool, A, E > { typedef Function_v2b<E> ret; }; @@ -71,12 +71,11 @@ selector_(); }; - template <typename R_, typename E> - struct selector_p2_ : selector_< R_, void, E > + struct selector_from_result_ : selector_< R_, void, E > { private: - selector_p2_(); + selector_from_result_(); }; } // end of namespace mln::fun::internal Index: tests/core/site_set/Makefile.am --- tests/core/site_set/Makefile.am (revision 3944) +++ tests/core/site_set/Makefile.am (working copy) @@ -5,7 +5,6 @@ check_PROGRAMS = \ operators \ p_array \ -## p_bgraph \ p_complex \ p_edges \ p_image \ @@ -20,7 +19,6 @@ operators_SOURCES = operators.cc p_array_SOURCES = p_array.cc -##p_bgraph_SOURCES = p_bgraph.cc p_complex_SOURCES = p_complex.cc p_image_SOURCES = p_image.cc p_priority_queue_SOURCES = p_priority_queue.cc Index: tests/morpho/tree/compute_parent.cc --- tests/morpho/tree/compute_parent.cc (revision 3944) +++ tests/morpho/tree/compute_parent.cc (working copy) @@ -28,8 +28,9 @@ /// \file tests/morpho/tree/compute_parent.cc /// -/// Tests on mln::morpho::tree::compute_parent. +/// \brief Tests on mln::morpho::tree::compute_parent. +#include <mln/core/var.hh> #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> #include <mln/core/image/dmorph/image_if.hh> @@ -42,6 +43,7 @@ #include <mln/morpho/tree/compute_parent.hh> + static mln::image2d<mln::point2d> ref1() { using namespace mln;