https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Simplifying function concepts. * mln/core/concept/function.hh: Remove all concepts except Function, Function_v2v, Function_v2b, Function_vv2v, and Function_vv2b. * mln/data/transform.spe.hh: De-activate some implementation routines and their related some dispatch routines. (todo): New. * mln/topo/is_simple_cell.hh, * mln/topo/skeleton/breadth_first_thinning.hh, * mln/topo/is_n_face.hh, * mln/world/inter_pixel/is_separator.hh, * mln/world/inter_pixel/is_pixel.hh, * mln/world/inter_pixel/dim2/is_dot.hh, * mln/world/inter_pixel/dim2/is_row_odd.hh, * mln/world/inter_pixel/dim2/is_pixel.hh, * mln/world/inter_pixel/dim2/is_edge.hh, * mln/core/site_set/p_image.hh, * mln/core/site_set/p_if.hh, * mln/core/image/dmorph/image_if.hh, * mln/core/image/dmorph/p2p_image.hh, * mln/core/image/imorph/tr_image.hh, * mln/core/image/edge_image.hh, * mln/core/image/vertex_image.hh, * mln/core/point.hh, * mln/core/dpoint.hh, * mln/metal/vec.hh, * mln/metal/mat.hh, * mln/data/transform.spe.hh, * mln/value/shell.hh, * mln/make/w_window.hh, * mln/make/edge_image.hh, * mln/make/vertex_image.hh, * mln/test/predicate.hh, * mln/pw/var.hh, * mln/fun/p2b/chess.hh, * mln/fun/p2b/big_chess.hh, * mln/fun/p2b/antilogy.hh, * mln/fun/p2b/tautology.hh, * mln/fun/p2b/has.hh, * mln/fun/meta/hue.hh, * mln/fun/meta/inty.hh, * mln/fun/meta/sat.hh, * mln/fun/meta/blue.hh, * mln/fun/meta/first.hh, * mln/fun/meta/red.hh, * mln/fun/meta/second.hh, * mln/fun/meta/lum.hh, * mln/fun/meta/green.hh, * mln/fun/v2w2v/cos.hh, * mln/fun/cast.hh, * mln/fun/ops.hh, * mln/fun/i2v/all_to.hh, * mln/fun/i2v/array.hh, * mln/fun/p2p/fold.hh, * mln/fun/p2p/mirror.hh, * mln/fun/p2p/translation.hh, * mln/fun/p2v/elifs.hh, * mln/fun/p2v/ternary.hh, * mln/fun/p2v/iota.hh, * mln/fun/internal/x2x_linear_impl.hh, * mln/fun/internal/selector.hh, * mln/fun/x2x/composed.hh, * mln/fun/x2x/translation.hh, * mln/fun/x2x/rotation.hh, * mln/fun/v2w_w2v/norm.hh, * mln/set/diff.hh, * mln/algebra/mat.hh, * mln/algebra/vec.hh, * mln/morpho/tree/filter/min.hh, * mln/morpho/tree/filter/max.hh, * mln/morpho/tree/filter/filter.hh, * mln/morpho/tree/filter/direct.hh, * mln/morpho/tree/filter/subtractive.hh, * mln/morpho/tree/propagate_if.hh, * mln/util/internal/id2element.hh, * mln/util/array.hh, * tests/arith/minus_full.cc, * tests/arith/times_full.cc, * tests/arith/plus_full.cc, * tests/arith/revert_full.cc, * tests/data/compute_full.cc, * tests/data/fill_full.cc, * tests/data/abs_full.cc, * tests/data/paste_full.cc, * tests/data/compare_full.cc, * tests/border/get_full.cc, * tests/border/find_full.cc, * tests/border/resize_sub_image.cc, * tests/border/get.cc, * tests/border/resize_image_if.cc, * tests/make/w_window.cc, * tests/test/positive.cc, * tests/morpho/watershed/superpose.cc, * tests/canvas/browsing/fwd.cc, * tests/canvas/browsing/snake_fwd.cc, * tests/canvas/browsing/snake_vert.cc, * tests/canvas/browsing/snake_generic_2d_vert.cc, * tests/canvas/browsing/snake_generic_2d_hori.cc, * tests/canvas/browsing/snake_generic_3d_vert.cc, * tests/canvas/browsing/snake_generic_3d_hori.cc, * tests/canvas/browsing/hyper_directional.cc, * tests/canvas/browsing/diagonal2d.cc, * tests/canvas/browsing/backdiagonal2d.cc, * doc/examples/trash/graph.cc, * doc/examples/graph-data.cc, * doc/examples/mln_var.cc, * doc/examples/graph-iter.cc, * doc/examples/extend.cc: Propagate update. doc/examples/extend.cc | 2 doc/examples/graph-data.cc | 2 doc/examples/graph-iter.cc | 2 doc/examples/mln_var.cc | 2 doc/examples/trash/graph.cc | 2 mln/algebra/mat.hh | 4 mln/algebra/vec.hh | 4 mln/core/concept/function.hh | 417 ++----------------------- mln/core/dpoint.hh | 4 mln/core/image/dmorph/image_if.hh | 23 - mln/core/image/dmorph/p2p_image.hh | 8 mln/core/image/edge_image.hh | 24 - mln/core/image/imorph/tr_image.hh | 2 mln/core/image/vertex_image.hh | 8 mln/core/point.hh | 4 mln/core/site_set/p_if.hh | 7 mln/core/site_set/p_image.hh | 5 mln/data/transform.spe.hh | 150 ++++---- mln/fun/cast.hh | 4 mln/fun/i2v/all_to.hh | 2 mln/fun/i2v/array.hh | 4 mln/fun/internal/selector.hh | 139 -------- mln/fun/internal/x2x_linear_impl.hh | 11 mln/fun/meta/blue.hh | 2 mln/fun/meta/first.hh | 2 mln/fun/meta/green.hh | 2 mln/fun/meta/hue.hh | 4 mln/fun/meta/inty.hh | 2 mln/fun/meta/lum.hh | 2 mln/fun/meta/red.hh | 2 mln/fun/meta/sat.hh | 4 mln/fun/meta/second.hh | 2 mln/fun/ops.hh | 45 -- mln/fun/p2b/antilogy.hh | 2 mln/fun/p2b/big_chess.hh | 2 mln/fun/p2b/chess.hh | 2 mln/fun/p2b/has.hh | 4 mln/fun/p2b/tautology.hh | 2 mln/fun/p2p/fold.hh | 2 mln/fun/p2p/mirror.hh | 2 mln/fun/p2p/translation.hh | 2 mln/fun/p2v/elifs.hh | 12 mln/fun/p2v/iota.hh | 2 mln/fun/p2v/ternary.hh | 24 - mln/fun/v2w2v/cos.hh | 2 mln/fun/v2w_w2v/norm.hh | 6 mln/fun/x2x/composed.hh | 12 mln/fun/x2x/rotation.hh | 2 mln/fun/x2x/translation.hh | 2 mln/make/edge_image.hh | 8 mln/make/vertex_image.hh | 12 mln/make/w_window.hh | 4 mln/metal/mat.hh | 4 mln/metal/vec.hh | 4 mln/morpho/tree/filter/direct.hh | 10 mln/morpho/tree/filter/filter.hh | 10 mln/morpho/tree/filter/max.hh | 10 mln/morpho/tree/filter/min.hh | 10 mln/morpho/tree/filter/subtractive.hh | 10 mln/morpho/tree/propagate_if.hh | 74 ++-- mln/pw/var.hh | 2 mln/set/diff.hh | 2 mln/test/predicate.hh | 6 mln/topo/is_n_face.hh | 2 mln/topo/is_simple_cell.hh | 2 mln/topo/skeleton/breadth_first_thinning.hh | 8 mln/util/array.hh | 4 mln/util/internal/id2element.hh | 2 mln/value/shell.hh | 8 mln/world/inter_pixel/dim2/is_dot.hh | 2 mln/world/inter_pixel/dim2/is_edge.hh | 2 mln/world/inter_pixel/dim2/is_pixel.hh | 2 mln/world/inter_pixel/dim2/is_row_odd.hh | 2 mln/world/inter_pixel/is_pixel.hh | 2 mln/world/inter_pixel/is_separator.hh | 2 tests/arith/minus_full.cc | 6 tests/arith/plus_full.cc | 6 tests/arith/revert_full.cc | 6 tests/arith/times_full.cc | 6 tests/border/find_full.cc | 6 tests/border/get.cc | 2 tests/border/get_full.cc | 2 tests/border/resize_image_if.cc | 2 tests/border/resize_sub_image.cc | 2 tests/canvas/browsing/backdiagonal2d.cc | 2 tests/canvas/browsing/diagonal2d.cc | 2 tests/canvas/browsing/fwd.cc | 2 tests/canvas/browsing/hyper_directional.cc | 2 tests/canvas/browsing/snake_fwd.cc | 2 tests/canvas/browsing/snake_generic_2d_hori.cc | 2 tests/canvas/browsing/snake_generic_2d_vert.cc | 2 tests/canvas/browsing/snake_generic_3d_hori.cc | 2 tests/canvas/browsing/snake_generic_3d_vert.cc | 2 tests/canvas/browsing/snake_vert.cc | 2 tests/data/abs_full.cc | 6 tests/data/compare_full.cc | 6 tests/data/compute_full.cc | 6 tests/data/fill_full.cc | 6 tests/data/paste_full.cc | 6 tests/make/w_window.cc | 2 tests/morpho/watershed/superpose.cc | 2 tests/test/positive.cc | 2 102 files changed, 402 insertions(+), 873 deletions(-) Index: mln/topo/is_simple_cell.hh --- mln/topo/is_simple_cell.hh (revision 3942) +++ mln/topo/is_simple_cell.hh (working copy) @@ -54,7 +54,7 @@ The functor does not actually take a cell as input, but a face that is expected to be a D-facet. */ template <typename I> - class is_simple_cell : public mln::Function_p2b< is_simple_cell<I> > + class is_simple_cell : public mln::Function_v2b< is_simple_cell<I> > { public: /// Dimension of the image (and therefore of the complex). Index: mln/topo/skeleton/breadth_first_thinning.hh --- mln/topo/skeleton/breadth_first_thinning.hh (revision 3942) +++ mln/topo/skeleton/breadth_first_thinning.hh (working copy) @@ -70,9 +70,9 @@ mln_concrete(I) breadth_first_thinning(const Image<I>& input, const Neighborhood<N>& nbh, - Function_p2b<F>& is_simple, + Function_v2b<F>& is_simple, G detach, - const Function_p2b<H>& constraint = + const Function_v2b<H>& constraint = fun::p2b::tautology()); @@ -83,9 +83,9 @@ mln_concrete(I) breadth_first_thinning(const Image<I>& input_, const Neighborhood<N>& nbh_, - Function_p2b<F>& is_simple_, + Function_v2b<F>& is_simple_, G detach, - const Function_p2b<H>& constraint_) + const Function_v2b<H>& constraint_) { const I& input = exact(input_); const N& nbh = exact(nbh_); Index: mln/topo/is_n_face.hh --- mln/topo/is_n_face.hh (revision 3942) +++ mln/topo/is_n_face.hh (working copy) @@ -47,7 +47,7 @@ /// A functor testing wheter a mln::complex_psite is an \p N -face. template <unsigned N> - struct is_n_face : public mln::Function_p2b< is_n_face<N> > + struct is_n_face : public mln::Function_v2b< is_n_face<N> > { typedef bool result; Index: mln/world/inter_pixel/is_separator.hh --- mln/world/inter_pixel/is_separator.hh (revision 3942) +++ mln/world/inter_pixel/is_separator.hh (working copy) @@ -48,7 +48,7 @@ namespace inter_pixel { - struct is_separator : public Function_p2b< is_separator > + struct is_separator : public Function_v2b< is_separator > { typedef bool result; Index: mln/world/inter_pixel/is_pixel.hh --- mln/world/inter_pixel/is_pixel.hh (revision 3942) +++ mln/world/inter_pixel/is_pixel.hh (working copy) @@ -46,7 +46,7 @@ namespace inter_pixel { - struct is_pixel : public Function_p2b< is_pixel > + struct is_pixel : public Function_v2b< is_pixel > { typedef bool result; Index: mln/world/inter_pixel/dim2/is_dot.hh --- mln/world/inter_pixel/dim2/is_dot.hh (revision 3942) +++ mln/world/inter_pixel/dim2/is_dot.hh (working copy) @@ -46,7 +46,7 @@ namespace dim2 { - struct is_dot : public Function_p2b< is_dot > + struct is_dot : public Function_v2b< is_dot > { typedef bool result; bool operator()(const point2d& p) const; Index: mln/world/inter_pixel/dim2/is_row_odd.hh --- mln/world/inter_pixel/dim2/is_row_odd.hh (revision 3942) +++ mln/world/inter_pixel/dim2/is_row_odd.hh (working copy) @@ -46,7 +46,7 @@ namespace dim2 { - struct is_row_odd : public Function_p2b< is_row_odd > + struct is_row_odd : public Function_v2b< is_row_odd > { typedef bool result; bool operator()(const point2d& p) const; Index: mln/world/inter_pixel/dim2/is_pixel.hh --- mln/world/inter_pixel/dim2/is_pixel.hh (revision 3942) +++ mln/world/inter_pixel/dim2/is_pixel.hh (working copy) @@ -46,7 +46,7 @@ namespace dim2 { - struct is_pixel : public Function_p2b< is_pixel > + struct is_pixel : public Function_v2b< is_pixel > { typedef bool result; bool operator()(const point2d& p) const; Index: mln/world/inter_pixel/dim2/is_edge.hh --- mln/world/inter_pixel/dim2/is_edge.hh (revision 3942) +++ mln/world/inter_pixel/dim2/is_edge.hh (working copy) @@ -46,7 +46,7 @@ namespace dim2 { - struct is_edge : public Function_p2b< is_edge > + struct is_edge : public Function_v2b< is_edge > { typedef bool result; bool operator()(const point2d& p) const; Index: mln/core/site_set/p_image.hh --- mln/core/site_set/p_image.hh (revision 3942) +++ mln/core/site_set/p_image.hh (working copy) @@ -29,10 +29,9 @@ #ifndef MLN_CORE_SITE_SET_P_IMAGE_HH # define MLN_CORE_SITE_SET_P_IMAGE_HH - /// \file mln/core/site_set/p_image.hh /// -/// Definition of a site set class based on an image of +/// \brief Definition of a site set class based on an image of /// Booleans. /// /// \todo Add an init method (deferred initialization). @@ -75,7 +74,7 @@ class p_image : public internal::site_set_base_< mln_psite(I), p_image<I> > { typedef mln_domain(I) S_; - typedef fun::eq_p2b_expr_< pw::value_<I>, pw::cst_<bool> > F_; + typedef fun::eq_v2b_expr_< pw::value_<I>, pw::cst_<bool> > F_; public: /// Equivalent site_set type. Index: mln/core/site_set/p_if.hh --- mln/core/site_set/p_if.hh (revision 3942) +++ mln/core/site_set/p_if.hh (working copy) @@ -31,7 +31,8 @@ /// \file mln/core/site_set/p_if.hh /// -/// Definition of the restriction of a site set w.r.t. a predicate. +/// \brief Definition of the restriction of a site set w.r.t. a +/// predicate. /// /// \todo Change s_ attribute type to S*. @@ -70,7 +71,7 @@ */ template <typename S, typename F> p_if<S, F> - operator | (const Site_Set<S>& s, const Function_p2b<F>& f); + operator | (const Site_Set<S>& s, const Function_v2b<F>& f); @@ -146,7 +147,7 @@ template <typename S, typename F> inline p_if<S, F> - operator | (const Site_Set<S>& s, const Function_p2b<F>& f) + operator | (const Site_Set<S>& s, const Function_v2b<F>& f) { p_if<S, F> tmp(exact(s), exact(f)); return tmp; Index: mln/core/image/dmorph/image_if.hh --- mln/core/image/dmorph/image_if.hh (revision 3942) +++ mln/core/image/dmorph/image_if.hh (working copy) @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008, 2009 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 @@ -31,10 +31,8 @@ /// \file mln/core/image/dmorph/image_if.hh /// -/// Definition of a image which domain is restricted by a -/// function. -/// -/// \todo Relax Function_p2b into Function_v2b. +/// \brief Definition of a image which domain is restricted by a +/// function 'site -> Boolean'. # include <mln/core/internal/image_domain_morpher.hh> # include <mln/core/site_set/p_if.hh> @@ -89,7 +87,8 @@ - /// Image which domain is restricted by a function. + /// Image which domain is restricted by a function 'site -> + /// Boolean'. /// /// \ingroup modimagedomainmorpher // @@ -121,21 +120,21 @@ // Operators. - // Image | Function_p2b. + // Image | Function_v2b. /// ima | f creates an image_if with the image ima and the function /// f. // template <typename I, typename F> image_if<I,F> - operator | (Image<I>& ima, const Function_p2b<F>& f); + operator | (Image<I>& ima, const Function_v2b<F>& f); /// ima | f creates an image_if with the image ima and the function /// f. // template <typename I, typename F> image_if<const I,F> - operator | (const Image<I>& ima, const Function_p2b<F>& f); + operator | (const Image<I>& ima, const Function_v2b<F>& f); @@ -234,7 +233,7 @@ template <typename I, typename F> inline image_if<I,F> - operator | (Image<I>& ima, const Function_p2b<F>& f) + operator | (Image<I>& ima, const Function_v2b<F>& f) { image_if<I,F> tmp(exact(ima), exact(f)); return tmp; @@ -243,7 +242,7 @@ template <typename I, typename F> inline image_if<const I, F> - operator | (const Image<I>& ima, const Function_p2b<F>& f) + operator | (const Image<I>& ima, const Function_v2b<F>& f) { image_if<const I, F> tmp(exact(ima), exact(f)); return tmp; Index: mln/core/image/dmorph/p2p_image.hh --- mln/core/image/dmorph/p2p_image.hh (revision 3942) +++ mln/core/image/dmorph/p2p_image.hh (working copy) @@ -122,12 +122,12 @@ /// FIXME: Doc! template <typename I, typename F> p2p_image<I,F> - apply_p2p(Image<I>& ima, const Function_p2p<F>& f); + apply_p2p(Image<I>& ima, const Function_v2v<F>& f); /// FIXME: Doc! template <typename I, typename F> p2p_image<const I,F> - apply_p2p(const Image<I>& ima, const Function_p2p<F>& f); + apply_p2p(const Image<I>& ima, const Function_v2v<F>& f); @@ -241,7 +241,7 @@ template <typename I, typename F> inline p2p_image<I,F> - apply_p2p(Image<I>& ima_, const Function_p2p<F>& f) + apply_p2p(Image<I>& ima_, const Function_v2v<F>& f) { mlc_is_a(mln_domain(I), Box)::check(); @@ -255,7 +255,7 @@ template <typename I, typename F> inline p2p_image<const I, F> - apply_p2p(const Image<I>& ima_, const Function_p2p<F>& f) + apply_p2p(const Image<I>& ima_, const Function_v2v<F>& f) { mlc_is_a(mln_domain(I), Box)::check(); Index: mln/core/image/imorph/tr_image.hh --- mln/core/image/imorph/tr_image.hh (revision 3942) +++ mln/core/image/imorph/tr_image.hh (working copy) @@ -226,7 +226,7 @@ inline tr_image<S,I,T> transposed_image(const Site_Set<S>& s, const Image<I>& ima, - const Function_x2x<T>& t) + const Function_v2v<T>& t) { tr_image<S,I,T> tmp(exact(s), exact(ima), exact(t)); return tmp; Index: mln/core/image/edge_image.hh --- mln/core/image/edge_image.hh (revision 3942) +++ mln/core/image/edge_image.hh (working copy) @@ -159,20 +159,20 @@ edge_image(); edge_image(const p_edges<G, site_function_t>& pe); edge_image(const Graph<G>& g, - const Function_i2v< site_function_t >& edge_sites, - const Function_i2v< fun::i2v::array<V> >& edge_values); + const Function_v2v< site_function_t >& edge_sites, + const Function_v2v< fun::i2v::array<V> >& edge_values); edge_image(const p_edges<G, site_function_t >& pe, - const Function_i2v< fun::i2v::array<V> >& edge_values); + const Function_v2v< fun::i2v::array<V> >& edge_values); template <typename FP, typename FV> edge_image(const Graph<G>& g, - const Function_i2v<FP>& edge_sites, - const Function_i2v<FV>& edge_values); + const Function_v2v<FP>& edge_sites, + const Function_v2v<FV>& edge_values); template <typename FV> edge_image(const p_edges<G,site_function_t>& pe, - const Function_i2v<FV>& edge_values); + const Function_v2v<FV>& edge_values); /// @} /// Value accessors/operators overloads. @@ -251,8 +251,8 @@ template <typename P, typename V, typename G> inline edge_image<P,V,G>::edge_image(const Graph<G>& g, - const Function_i2v< site_function_t >& edge_sites, - const Function_i2v< fun::i2v::array<V> >& edge_values) + const Function_v2v< site_function_t >& edge_sites, + const Function_v2v< fun::i2v::array<V> >& edge_values) : super_(exact(edge_values), p_edges<G,site_function_t>(g, exact(edge_sites))) { @@ -262,7 +262,7 @@ template <typename P, typename V, typename G> inline edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe, - const Function_i2v< fun::i2v::array<V> >& edge_values) + const Function_v2v< fun::i2v::array<V> >& edge_values) : super_(exact(edge_values), pe) { } @@ -272,8 +272,8 @@ template <typename FP, typename FV> inline edge_image<P,V,G>::edge_image(const Graph<G>& g, - const Function_i2v<FP>& edge_sites, - const Function_i2v<FV>& edge_values) + const Function_v2v<FP>& edge_sites, + const Function_v2v<FV>& edge_values) : super_(convert::to<fun::i2v::array<V> >(exact(edge_values)), p_edges<G,site_function_t>(g, exact(edge_sites))) { @@ -287,7 +287,7 @@ template <typename FV> inline edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe, - const Function_i2v<FV>& edge_values) + const Function_v2v<FV>& edge_values) : super_(convert::to<fun::i2v::array<V> >(exact(edge_values)), pe) { mlc_equal(mln_result(FV),V)::check(); Index: mln/core/image/vertex_image.hh --- mln/core/image/vertex_image.hh (revision 3942) +++ mln/core/image/vertex_image.hh (working copy) @@ -162,10 +162,10 @@ vertex_image(); vertex_image(const p_vertices<G, site_function_t>& pv); vertex_image(const p_vertices<G, site_function_t>& pv, - const Function_i2v< fun::i2v::array<V> >& vertex_values); + const Function_v2v< fun::i2v::array<V> >& vertex_values); template <typename FV> vertex_image(const p_vertices<G, site_function_t>& pv, - const Function_i2v<FV>& vertex_values); + const Function_v2v<FV>& vertex_values); /// @} /// Value accessors/operators overloads. @@ -246,7 +246,7 @@ template <typename P, typename V, typename G> inline vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv, - const Function_i2v< fun::i2v::array<V> >& vertex_values) + const Function_v2v< fun::i2v::array<V> >& vertex_values) : super_(exact(vertex_values), pv) { } @@ -256,7 +256,7 @@ template <typename FV> inline vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv, - const Function_i2v<FV>& vertex_values) + const Function_v2v<FV>& vertex_values) : super_(convert::to<fun::i2v::array<V> >(exact(vertex_values)), pv) { mlc_equal(mln_result(FV),V)::check(); Index: mln/core/point.hh --- mln/core/point.hh (revision 3942) +++ mln/core/point.hh (working copy) @@ -156,7 +156,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - point(const Function_i2v<F>& f); + point(const Function_v2v<F>& f); /// Set all coordinates to the value \p c. void set_all(C c); @@ -338,7 +338,7 @@ template <typename G, typename C> template <typename F> inline - point<G,C>::point(const Function_i2v<F>& f_) + point<G,C>::point(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), C)::check(); const F& f = exact(f_); Index: mln/core/concept/function.hh --- mln/core/concept/function.hh (revision 3942) +++ mln/core/concept/function.hh (working copy) @@ -31,7 +31,7 @@ /// \file mln/core/concept/function.hh /// -/// Definition of several concepts of functions. +/// \brief Definition of several concepts of functions. # include <mln/core/concept/object.hh> @@ -39,22 +39,14 @@ namespace mln { - // Fwd decls. + // Forward declarations. template <typename E> struct Function; template <typename E> struct Function_v2v; - template <typename E> struct Function_v2w2v; - template <typename E> struct Function_v2w_w2v; - template <typename E> struct Function_i2b; - template <typename E> struct Function_i2v; - template <typename E> struct Function_p2v; template <typename E> struct Function_v2b; - template <typename E> struct Function_p2b; - template <typename E> struct Function_p2p; - template <typename E> struct Function_x2x; - template <typename E> struct Function_vv2v; template <typename E> struct Function_vv2b; + /// Function category flag type. template <> struct Function<void> @@ -63,19 +55,19 @@ }; - /// Base class for implementation of function-objects. + /// \brief Base class for implementation of function-objects. /// /// The parameter \a E is the exact type. /// + /// \ingroup modfun + // template <typename E> struct Function : public Object<E> { typedef Function<void> category; - /* - ** An operator() has to be provided. Its signature depends - ** on the particular function-object one considers. - */ + /// An operator() has to be provided. Its signature depends + /// on the particular function-object one considers. protected: Function(); @@ -90,6 +82,7 @@ template <> struct Function_v2v<void> { typedef Function<void> super; }; + /// \brief Base class for implementation of function-objects from /// value to value. /// @@ -108,149 +101,6 @@ }; - /*----------------------------. - | Value <-> Value (Bijective) | - `----------------------------*/ - - // FIXME : should it also be a v2v function? - - template <> - struct Function_v2w2v<void> { typedef Function<void> super; }; - - /*! - * \brief Base class for implementation of function-objects from - * value V to value W and vice versa. - * - * The parameter \a E is the exact type. - * - * \ingroup modfun - */ - template <typename E> - struct Function_v2w2v : public Function<E> - { - typedef Function_v2w2v<void> category; - - /* - result operator() (value); - value f_1 (result); - */ - - protected: - Function_v2w2v(); - Function_v2w2v(const Function_v2w2v&); - }; - - - /*---------------------------. - | Value <-> Value (Two ways) | - `---------------------------*/ - - // FIXME : should it also be a v2v function? - - template <> - struct Function_v2w_w2v<void> { typedef Function<void> super; }; - - /*! - * \brief Base class for implementation of function-objects from - * value V to value W and from W to V thanks to the previous - * value V. - * - * The parameter \a E is the exact type. - * - * eg: f : x -> norm(x) - * f_1: (x, n) -> x' := x / norm(x) * n - * - * \ingroup modfun - */ - template <typename E> - struct Function_v2w_w2v : public Function<E> - { - typedef Function_v2w_w2v<void> category; - - /* - result operator() (value); - value f_1 (result, value); - */ - - protected: - Function_v2w_w2v(); - Function_v2w_w2v(const Function_v2w_w2v&); - }; - - - /*-----------------. - | Index -> bool. | - `-----------------*/ - - template <> - struct Function_i2b<void> { typedef Function_v2b<void> super; }; - - /// Base class for implementation of function-objects from - /// index to value. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_i2b : public Function_v2b<E> - { - typedef Function_i2b<void> category; - typedef bool result; - protected: - Function_i2b(); - Function_i2b(const Function_i2b&); - }; - - - /*-----------------. - | Index -> Value. | - `-----------------*/ - - template <> - struct Function_i2v<void> { typedef Function_v2v<void> super; }; - - /// Base class for implementation of function-objects from - /// index to value. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_i2v : public Function_v2v<E> - { - typedef Function_i2v<void> category; - protected: - Function_i2v(); - Function_i2v(const Function_i2v&); - }; - - - /*-----------------. - | Point -> Value. | - `-----------------*/ - - template <> - struct Function_p2v<void> { typedef Function_v2v<void> super; }; - - /// Base class for implementation of function-objects from point to - /// value. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_p2v : public virtual Function_v2v<E> - { - typedef Function_p2v<void> category; - protected: - Function_p2v(); - Function_p2v(const Function_p2v&); - }; - - /*----------------. | Value -> bool. | `----------------*/ @@ -258,8 +108,9 @@ template <> struct Function_v2b<void> { typedef Function_v2v<void> super; }; - /// Base class for implementation of function-objects from value to - /// bool. + + /// \brief Base class for implementation of function-objects from a + /// value to a Boolean. /// /// The parameter \a E is the exact type. /// @@ -276,112 +127,17 @@ }; - /*----------------. - | Point -> bool. | - `----------------*/ - template <> - struct Function_p2b<void> { typedef Function_p2v<void> super; }; // FIXME - - /// Base class for implementation of function-objects from point to - /// bool. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_p2b : public Function_p2v<E>, - public Function_v2b<E> - { - typedef Function_p2b<void> category; - typedef bool result; - protected: - Function_p2b(); - Function_p2b(const Function_p2b&); - }; - - - /*-----------------. - | Point -> Point. | - `-----------------*/ - - template <> - struct Function_p2p<void> { typedef Function_p2v<void> super; }; // FIXME - - /// Base class for implementation of function-objects from point to - /// point. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_p2p : public Function_p2v<E> - { - typedef Function_p2p<void> category; - protected: - Function_p2p(); - Function_p2p(const Function_p2p&); - }; - - - /*-------------------. - | Vector -> Vector. | - `-------------------*/ - - template <> - struct Function_x2x<void> { typedef Function_v2v<void> super; }; // FIXME - - /// Base class for implementation of function-objects from vector to - /// Vector. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Function_x2x : public Function_v2v<E> - { - typedef Function_x2x<void> category; - protected: - Function_x2x(); - Function_x2x(const Function_x2x&); - }; - - - /*--------------------. - | Vector <-> Vector. | - `--------------------*/ - - /// Base class for implementation of bijective function-objects from - /// vector to vector. - /// - /// The parameter \a E is the exact type. - /// - /// \ingroup modfun - // - template <typename E> - struct Bijection_x2x : public Function_x2x< E > - { - /* - typedef invert; - invert inv() const; - */ - protected: - Bijection_x2x(); - }; - - - /*------------------------. - | Value, Value -> Value. | - `------------------------*/ + /*--------------------------. + | (Value, Value) -> Value. | + `--------------------------*/ template <> struct Function_vv2v<void> { typedef Function<void> super; }; - /// Base class for implementation of function-objects from - /// a couple of values to a value. + + /// \brief Base class for implementation of function-objects from a + /// couple of values to a value. /// /// The parameter \a E is the exact type. /// @@ -396,15 +152,17 @@ Function_vv2v(const Function_vv2v&); }; - /*------------------------. - | Value, Value -> Boolean.| - `------------------------*/ + + /*--------------------------. + | (Value, Value) -> Boolean.| + `--------------------------*/ template <> struct Function_vv2b<void> { typedef Function<void> super; }; - /// Base class for implementation of function-objects from - /// a couple of values to a boolean. + + /// \brief Base class for implementation of function-objects from a + /// couple of values to a Boolean. /// /// The parameter \a E is the exact type. /// @@ -421,8 +179,11 @@ }; + # ifndef MLN_INCLUDE_ONLY + // Function. + template <typename E> inline Function<E>::Function() @@ -437,6 +198,8 @@ { } + // Function_v2v. + template <typename E> inline Function_v2v<E>::Function_v2v() @@ -450,72 +213,7 @@ { } - template <typename E> - inline - Function_v2w2v<E>::Function_v2w2v() - { - } - - template <typename E> - inline - Function_v2w2v<E>::Function_v2w2v(const Function_v2w2v<E>& rhs) - : Function<E>(rhs) - { - } - - template <typename E> - inline - Function_v2w_w2v<E>::Function_v2w_w2v() - { - } - - template <typename E> - inline - Function_v2w_w2v<E>::Function_v2w_w2v(const Function_v2w_w2v<E>& rhs) - : Function<E>(rhs) - { - } - - template <typename E> - inline - Function_i2b<E>::Function_i2b() - { - } - - template <typename E> - inline - Function_i2b<E>::Function_i2b(const Function_i2b<E>& rhs) - : Function_v2v<E>(rhs), - Function_v2b<E>(rhs) - { - } - - - template <typename E> - inline - Function_i2v<E>::Function_i2v() - { - } - - template <typename E> - inline - Function_i2v<E>::Function_i2v(const Function_i2v<E>& rhs) - : Function_v2v<E>(rhs) - { - } - - template <typename E> - inline - Function_p2v<E>::Function_p2v() - { - } - - template <typename E> - inline - Function_p2v<E>::Function_p2v(const Function_p2v<E>& rhs) - : Function_v2v<E>(rhs) - { - } + // Function_v2b. template <typename E> inline @@ -530,56 +228,7 @@ { } - template <typename E> - inline - Function_p2b<E>::Function_p2b() - { - } - - template <typename E> - inline - Function_p2b<E>::Function_p2b(const Function_p2b<E>& rhs) - : Function_v2v<E>(rhs), - Function_p2v<E>(rhs), - Function_v2b<E>(rhs) - { - } - - template <typename E> - inline - Function_p2p<E>::Function_p2p() - { - } - - template <typename E> - inline - Function_p2p<E>::Function_p2p(const Function_p2p<E>& rhs) - : Function_v2v<E>(rhs), - Function_p2v<E>(rhs) - { - } - - template <typename E> - inline - Function_x2x<E>::Function_x2x() - { - } - - template <typename E> - inline - Function_x2x<E>::Function_x2x(const Function_x2x<E>& rhs) - : Function_v2v<E>(rhs) - { - } - - template <typename E> - inline - Bijection_x2x<E>::Bijection_x2x() - { - typedef typename E::invert invert; - invert (E::*m)() const = & E::inv; - m = 0; - } + // Function_vv2v. template <typename E> inline @@ -594,6 +243,8 @@ { } + // Function_vv2b. + template <typename E> inline Function_vv2b<E>::Function_vv2b() Index: mln/core/dpoint.hh --- mln/core/dpoint.hh (revision 3942) +++ mln/core/dpoint.hh (working copy) @@ -115,7 +115,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - dpoint(const Function_i2v<F>& f); + dpoint(const Function_v2v<F>& f); /// Set all coordinates to the value \p c. void set_all(C c); @@ -238,7 +238,7 @@ template <typename G, typename C> template <typename F> inline - dpoint<G,C>::dpoint(const Function_i2v<F>& f_) + dpoint<G,C>::dpoint(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), C)::check(); const F& f = exact(f_); Index: mln/metal/vec.hh --- mln/metal/vec.hh (revision 3942) +++ mln/metal/vec.hh (working copy) @@ -206,7 +206,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - vec(const Function_i2v<F>& f); + vec(const Function_v2v<F>& f); /// Zero value. static const vec<n, T> zero; @@ -427,7 +427,7 @@ template <unsigned n, typename T> template <typename F> inline - vec<n, T>::vec(const Function_i2v<F>& f_) + vec<n, T>::vec(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); const F& f = exact(f_); Index: mln/metal/mat.hh --- mln/metal/mat.hh (revision 3942) +++ mln/metal/mat.hh (working copy) @@ -104,7 +104,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - mat(const Function_i2v<F>& f); + mat(const Function_v2v<F>& f); template <typename U> mat& operator=(const mat<n,m,U>& rhs); @@ -291,7 +291,7 @@ template <unsigned n, unsigned m, typename T> template <typename F> inline - mat<n,m,T>::mat(const Function_i2v<F>& f_) + mat<n,m,T>::mat(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); const F& f = exact(f_); Index: mln/data/transform.spe.hh --- mln/data/transform.spe.hh (revision 3942) +++ mln/data/transform.spe.hh (working copy) @@ -31,7 +31,13 @@ /// \file mln/data/transform.spe.hh /// -/// Specializations for mln::data::transform. +/// \brief Specializations for mln::data::transform. +/// +/// \todo The implementation (and thus the dispatch) involving a lut +/// has been de-activated; the patch of Z does not work anymore since +/// we do not make the difference between i2v and v2v functions. +/// Actually the patch was no acceptable solution to the lut problem +/// (for some values, we cannot compute f(v) to put into the lut...) # ifndef MLN_LEVEL_TRANSFORM_HH # error "Forbidden inclusion of *.spe.hh" @@ -96,37 +102,37 @@ } - template <typename I, typename F> - mln_ch_value(I, mln_result(F)) - transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_) - { - trace::entering("data::impl::transform_lowq_v2v"); +// template <typename I, typename F> +// mln_ch_value(I, mln_result(F)) +// transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_) +// { +// trace::entering("data::impl::transform_lowq_v2v"); - mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))), - trait::image::pw_io::read_write)::check(); +// mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))), +// trait::image::pw_io::read_write)::check(); - const I& input = exact(input_); - const F& f = exact(f_); - data::internal::transform_tests(input, f); +// const I& input = exact(input_); +// const F& f = exact(f_); +// data::internal::transform_tests(input, f); - mln_ch_value(I, mln_result(F)) output; - initialize(output, input); +// mln_ch_value(I, mln_result(F)) output; +// initialize(output, input); - value::lut_vec<mln_vset(I), mln_result(F)> - lut(input.values_eligible(), f); +// value::lut_vec<mln_vset(I), mln_result(F)> +// lut(input.values_eligible(), f); - mln_piter(I) p(input.domain()); - for_all(p) - output(p) = lut(input(p)); +// mln_piter(I) p(input.domain()); +// for_all(p) +// output(p) = lut(input(p)); - trace::exiting("data::impl::transform_lowq_v2v"); - return output; - } +// trace::exiting("data::impl::transform_lowq_v2v"); +// return output; +// } template <typename I, typename F> mln_ch_value(I, mln_result(F)) - transform_lowq_i2v(const Image<I>& input_, const Function_i2v<F>& f_) + transform_lowq_i2v(const Image<I>& input_, const Function_v2v<F>& f_) { trace::entering("data::impl::transform_lowq"); @@ -149,37 +155,37 @@ } - template <typename I, typename F> - mln_ch_value(I, mln_result(F)) - transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_) - { - trace::entering("data::impl::transform_taken_v2v"); +// template <typename I, typename F> +// mln_ch_value(I, mln_result(F)) +// transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_) +// { +// trace::entering("data::impl::transform_taken_v2v"); - mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))), - trait::image::pw_io::read_write)::check(); +// mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))), +// trait::image::pw_io::read_write)::check(); - const I& input = exact(input_); - const F& f = exact(f_); - data::internal::transform_tests(input, f); +// const I& input = exact(input_); +// const F& f = exact(f_); +// data::internal::transform_tests(input, f); - mln_ch_value(I, mln_result(F)) output; - initialize(output, input); +// mln_ch_value(I, mln_result(F)) output; +// initialize(output, input); - value::lut_vec<mln_vset(I), mln_result(F)> - lut(input.taken_values(), f); +// value::lut_vec<mln_vset(I), mln_result(F)> +// lut(input.taken_values(), f); - mln_piter(I) p(input.domain()); - for_all(p) - output(p) = lut(input(p)); +// mln_piter(I) p(input.domain()); +// for_all(p) +// output(p) = lut(input(p)); - trace::exiting("data::impl::transform_taken_v2v"); - return output; - } +// trace::exiting("data::impl::transform_taken_v2v"); +// return output; +// } template <typename I, typename F> mln_ch_value(I, mln_result(F)) - transform_taken_i2v(const Image<I>& input_, const Function_i2v<F>& f_) + transform_taken_i2v(const Image<I>& input_, const Function_v2v<F>& f_) { trace::entering("data::impl::transform_taken_i2v"); @@ -333,42 +339,42 @@ return data::impl::generic::transform(input, f); } - template <typename I, typename F> - inline - mln_ch_value(I, mln_result(F)) - transform_dispatch(trait::image::vw_set::uni, - trait::image::quant::low, - const Image<I>& input, const Function_v2v<F>& f) - { - return data::impl::transform_taken_v2v(input, f); - } +// template <typename I, typename F> +// inline +// mln_ch_value(I, mln_result(F)) +// transform_dispatch(trait::image::vw_set::uni, +// trait::image::quant::low, +// const Image<I>& input, const Function_v2v<F>& f) +// { +// return data::impl::transform_taken_v2v(input, f); +// } template <typename I, typename F> inline mln_ch_value(I, mln_result(F)) transform_dispatch(trait::image::vw_set::uni, trait::image::quant::low, - const Image<I>& input, const Function_i2v<F>& f) + const Image<I>& input, const Function_v2v<F>& f) { return data::impl::transform_taken_i2v(input, f); } - template <typename I, typename F> - inline - mln_ch_value(I, mln_result(F)) - transform_dispatch(trait::image::vw_set::any, - trait::image::quant::low, - const Image<I>& input, const Function_v2v<F>& f) - { - return data::impl::transform_lowq_v2v(input, f); - } +// template <typename I, typename F> +// inline +// mln_ch_value(I, mln_result(F)) +// transform_dispatch(trait::image::vw_set::any, +// trait::image::quant::low, +// const Image<I>& input, const Function_v2v<F>& f) +// { +// return data::impl::transform_lowq_v2v(input, f); +// } template <typename I, typename F> inline mln_ch_value(I, mln_result(F)) transform_dispatch(trait::image::vw_set::any, trait::image::quant::low, - const Image<I>& input, const Function_i2v<F>& f) + const Image<I>& input, const Function_v2v<F>& f) { return data::impl::transform_lowq_i2v(input, f); } @@ -393,15 +399,15 @@ return data::impl::transform_fast_lowq(input, f); } - template <typename I, typename F> - inline - mln_ch_value(I, mln_result(F)) - transform_dispatch(trait::image::quant::low, - trait::image::value_access::direct, - const Image<I>& input, const Function_i2v<F>& f) - { - return data::impl::transform_fast(input, f); - } +// template <typename I, typename F> +// inline +// mln_ch_value(I, mln_result(F)) +// transform_dispatch(trait::image::quant::low, +// trait::image::value_access::direct, +// const Image<I>& input, const Function_v2v<F>& f) +// { +// return data::impl::transform_fast(input, f); +// } template <typename I, typename F> inline Index: mln/value/shell.hh --- mln/value/shell.hh (revision 3942) +++ mln/value/shell.hh (working copy) @@ -54,7 +54,7 @@ template <typename F, typename I> - struct shell_<F, I, Function_v2w2v<void> > + struct shell_<F, I, Function_v2v<void> > { const mln_value(I)& set_(I& ima, const mln_site(I)& s, mln_result(F) v); @@ -62,7 +62,7 @@ template <typename F, typename I> - struct shell_<F, I, Function_v2w_w2v<void> > + struct shell_<F, I, Function_v2v<void> > { const mln_value(I)& set_(I& ima, const mln_site(I)& s, mln_result(F) v); @@ -150,7 +150,7 @@ template <typename F, typename I> const mln_value(I)& - shell_<F, I, Function_v2w2v<void> >::set_(I& ima, + shell_<F, I, Function_v2v<void> >::set_(I& ima, const mln_site(I)& s, mln_result(F) v) { @@ -161,7 +161,7 @@ template <typename F, typename I> const mln_value(I)& - shell_<F, I, Function_v2w_w2v<void> >::set_(I& ima, + shell_<F, I, Function_v2v<void> >::set_(I& ima, const mln_site(I)& s, mln_result(F) v) { Index: mln/make/w_window.hh --- mln/make/w_window.hh (revision 3942) +++ mln/make/w_window.hh (working copy) @@ -54,7 +54,7 @@ */ template <typename W, typename F> mln::w_window<mln_dpsite(W), mln_result(F)> - w_window(const Window<W>& win, const Function_p2v<F>& wei); + w_window(const Window<W>& win, const Function_v2v<F>& wei); # ifndef MLN_INCLUDE_ONLY @@ -62,7 +62,7 @@ template <typename W, typename F> inline mln::w_window<mln_dpsite(W), mln_result(F)> - w_window(const Window<W>& win_, const Function_p2v<F>& wei_) + w_window(const Window<W>& win_, const Function_v2v<F>& wei_) { trace::entering("make::w_window"); Index: mln/make/edge_image.hh --- mln/make/edge_image.hh (revision 3942) +++ mln/make/edge_image.hh (working copy) @@ -69,8 +69,8 @@ template <typename FP, typename FV, typename G> mln::edge_image<mln_result(FP),mln_result(FV),G> edge_image(const Graph<G>& g_, - const Function_i2v<FP>& fp, - const Function_i2v<FV>& fv); + const Function_v2v<FP>& fp, + const Function_v2v<FV>& fv); @@ -129,8 +129,8 @@ template <typename FP, typename FV, typename G> mln::edge_image<mln_result(FP),mln_result(FV),G> edge_image(const Graph<G>& g_, - const Function_i2v<FP>& fp, - const Function_i2v<FV>& fv) + const Function_v2v<FP>& fp, + const Function_v2v<FV>& fv) { trace::entering("make::edge_image"); const G& g = exact(g_); Index: mln/make/vertex_image.hh --- mln/make/vertex_image.hh (revision 3942) +++ mln/make/vertex_image.hh (working copy) @@ -53,7 +53,7 @@ // template <typename G, typename FV> mln::vertex_image<void,mln_result(FV),G> - vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv); + vertex_image(const Graph<G>& g, const Function_v2v<FV>& fv); /// Construct a vertex image @@ -67,8 +67,8 @@ template <typename FP, typename FV, typename G> mln::vertex_image<mln_result(FP),mln_result(FV),G> vertex_image(const Graph<G>& g_, - const Function_i2v<FP>& fp, - const Function_i2v<FV>& fv); + const Function_v2v<FP>& fp, + const Function_v2v<FV>& fv); @@ -76,7 +76,7 @@ template <typename G, typename FV> mln::vertex_image<void,mln_result(FV),G> - vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv) + vertex_image(const Graph<G>& g, const Function_v2v<FV>& fv) { trace::entering("make::vertex_image"); mln_precondition(exact(g).is_valid()); @@ -93,8 +93,8 @@ template <typename FP, typename FV, typename G> mln::vertex_image<mln_result(FP),mln_result(FV),G> vertex_image(const Graph<G>& g_, - const Function_i2v<FP>& fp, - const Function_i2v<FV>& fv) + const Function_v2v<FP>& fp, + const Function_v2v<FV>& fv) { trace::entering("make::vertex_image"); const G& g = exact(g_); Index: mln/test/predicate.hh --- mln/test/predicate.hh (revision 3942) +++ mln/test/predicate.hh (working copy) @@ -71,7 +71,7 @@ /// \param[in] f The predicate. // template <typename S, typename F> - bool predicate(const Site_Set<S>& pset, const Function_p2b<F>& f); + bool predicate(const Site_Set<S>& pset, const Function_v2b<F>& f); # ifndef MLN_INCLUDE_ONLY @@ -112,7 +112,7 @@ template <typename S, typename F> inline void predicate_tests(const Site_Set<S>& pset, - const Function_p2b<F>& f) + const Function_v2b<F>& f) { mln_precondition(exact(pset).is_valid()); (void) pset; @@ -241,7 +241,7 @@ template <typename S, typename F> inline - bool predicate(const Site_Set<S>& pset, const Function_p2b<F>& f) + bool predicate(const Site_Set<S>& pset, const Function_v2b<F>& f) { trace::entering("test::predicate"); Index: mln/pw/var.hh --- mln/pw/var.hh (revision 3942) +++ mln/pw/var.hh (working copy) @@ -45,7 +45,7 @@ { template <typename V> - struct var_ : public Function_p2v< var_<V> > + struct var_ : public Function_v2v< var_<V> > { typedef V result; Index: mln/fun/p2b/chess.hh --- mln/fun/p2b/chess.hh (revision 3942) +++ mln/fun/p2b/chess.hh (working copy) @@ -48,7 +48,7 @@ // FIXME: Doc! - struct chess : public Function_p2b< chess > + struct chess : public Function_v2b< chess > { typedef bool result; bool operator()(const point2d& p) const; Index: mln/fun/p2b/big_chess.hh --- mln/fun/p2b/big_chess.hh (revision 3942) +++ mln/fun/p2b/big_chess.hh (working copy) @@ -48,7 +48,7 @@ // FIXME: Doc! template <typename B> - struct big_chess : public Function_p2b< big_chess<B> > + struct big_chess : public Function_v2b< big_chess<B> > { typedef bool result; typedef mln_psite(B) P; Index: mln/fun/p2b/antilogy.hh --- mln/fun/p2b/antilogy.hh (revision 3942) +++ mln/fun/p2b/antilogy.hh (working copy) @@ -49,7 +49,7 @@ /// /// A simpler name would be `false', but this is not a valid C++ /// identifier, as \c false is a keyword of the language. - struct antilogy : public Function_p2b< antilogy > + struct antilogy : public Function_v2b< antilogy > { typedef bool result; Index: mln/fun/p2b/tautology.hh --- mln/fun/p2b/tautology.hh (revision 3942) +++ mln/fun/p2b/tautology.hh (working copy) @@ -49,7 +49,7 @@ /// /// A simpler name would be `true', but this is not a valid C++ /// identifier, as \c true is a keyword of the language. - struct tautology : public Function_p2b< tautology > + struct tautology : public Function_v2b< tautology > { typedef bool result; Index: mln/fun/p2b/has.hh --- mln/fun/p2b/has.hh (revision 3942) +++ mln/fun/p2b/has.hh (working copy) @@ -54,7 +54,7 @@ template <typename I> struct has - : public Function_p2b< has<I> >, + : public Function_v2b< has<I> >, private mlc_is_a(I, Image)::check_t { /// Result associated type. @@ -79,7 +79,7 @@ private: mlc_const(I) ima_; - typedef Function_p2b< has<I> > super_; + typedef Function_v2b< has<I> > super_; }; Index: mln/fun/meta/hue.hh --- mln/fun/meta/hue.hh (revision 3942) +++ mln/fun/meta/hue.hh (working copy) @@ -53,7 +53,7 @@ template <class H, class S, class I> struct function< meta::hue< value::hsi_<H, S, I> > > - : public Function_v2w_w2v<function< meta::hue < value::hsi_<H, S, I> > > > + : public Function_v2v<function< meta::hue < value::hsi_<H, S, I> > > > { typedef value::hsi_<H, S, I> value; @@ -66,7 +66,7 @@ template <class H, class S, class L> struct function< meta::hue< value::hsl_<H, S, L> > > - : public Function_v2w_w2v<function< meta::hue < value::hsl_<H, S, L> > > > + : public Function_v2v<function< meta::hue < value::hsl_<H, S, L> > > > { typedef value::hsl_<H, S, L> value; Index: mln/fun/meta/inty.hh --- mln/fun/meta/inty.hh (revision 3942) +++ mln/fun/meta/inty.hh (working copy) @@ -53,7 +53,7 @@ template <class H, class S, class I> struct function< meta::inty< value::hsi_<H, S, I> > > - : public Function_v2w_w2v<function< meta::inty < value::hsi_<H, S, I> > > > + : public Function_v2v<function< meta::inty < value::hsi_<H, S, I> > > > { typedef value::hsi_<H, S, I> value; Index: mln/fun/meta/sat.hh --- mln/fun/meta/sat.hh (revision 3942) +++ mln/fun/meta/sat.hh (working copy) @@ -54,7 +54,7 @@ template <class H, class S, class I> struct function< meta::sat< value::hsi_<H, S, I> > > - : public Function_v2w_w2v<function< meta::sat < value::hsi_<H, S, I> > > > + : public Function_v2v<function< meta::sat < value::hsi_<H, S, I> > > > { typedef value::hsi_<H, S, I> value; @@ -68,7 +68,7 @@ template <class H, class S, class L> struct function< meta::sat< value::hsl_<H, S, L> > > - : public Function_v2w_w2v<function< meta::sat < value::hsl_<H, S, L> > > > + : public Function_v2v<function< meta::sat < value::hsl_<H, S, L> > > > { typedef value::hsl_<H, S, L> value; Index: mln/fun/meta/blue.hh --- mln/fun/meta/blue.hh (revision 3942) +++ mln/fun/meta/blue.hh (working copy) @@ -52,7 +52,7 @@ template <unsigned n> struct function< meta::blue< value::rgb<n> > > - : public Function_v2w_w2v<function< meta::blue < value::rgb<n> > > > + : public Function_v2v<function< meta::blue < value::rgb<n> > > > { typedef value::rgb<n> value; Index: mln/fun/meta/first.hh --- mln/fun/meta/first.hh (revision 3942) +++ mln/fun/meta/first.hh (working copy) @@ -53,7 +53,7 @@ template <typename T, typename U> struct function< meta::first< util::couple<T,U> > > - : public Function_v2w_w2v<function< meta::first < util::couple<T,U> > > > + : public Function_v2v<function< meta::first < util::couple<T,U> > > > { typedef util::couple<T,U> value; Index: mln/fun/meta/red.hh --- mln/fun/meta/red.hh (revision 3942) +++ mln/fun/meta/red.hh (working copy) @@ -53,7 +53,7 @@ template <unsigned n> struct function< meta::red< value::rgb<n> > > - : public Function_v2w_w2v<function< meta::red < value::rgb<n> > > > + : public Function_v2v<function< meta::red < value::rgb<n> > > > { typedef value::rgb<n> value; Index: mln/fun/meta/second.hh --- mln/fun/meta/second.hh (revision 3942) +++ mln/fun/meta/second.hh (working copy) @@ -53,7 +53,7 @@ template <typename T, typename U> struct function< meta::second< util::couple<T,U> > > - : public Function_v2w_w2v<function< meta::second < util::couple<T,U> > > > + : public Function_v2v<function< meta::second < util::couple<T,U> > > > { typedef util::couple<T,U> value; Index: mln/fun/meta/lum.hh --- mln/fun/meta/lum.hh (revision 3942) +++ mln/fun/meta/lum.hh (working copy) @@ -53,7 +53,7 @@ template <class H, class S, class I> struct function< meta::lum< value::hsl_<H, S, I> > > - : public Function_v2w_w2v<function< meta::lum < value::hsl_<H, S, I> > > > + : public Function_v2v<function< meta::lum < value::hsl_<H, S, I> > > > { typedef value::hsl_<H, S, I> value; Index: mln/fun/meta/green.hh --- mln/fun/meta/green.hh (revision 3942) +++ mln/fun/meta/green.hh (working copy) @@ -52,7 +52,7 @@ template <unsigned n> struct function< meta::green< value::rgb<n> > > - : public Function_v2w_w2v<function< meta::green < value::rgb<n> > > > + : public Function_v2v<function< meta::green < value::rgb<n> > > > { typedef value::rgb<n> value; Index: mln/fun/v2w2v/cos.hh --- mln/fun/v2w2v/cos.hh (revision 3942) +++ mln/fun/v2w2v/cos.hh (working copy) @@ -58,7 +58,7 @@ * \see mln::math::cos. */ template <typename V> - struct cos : public Function_v2w2v< cos<V> > + struct cos : public Function_v2v< cos<V> > { typedef V result; V operator()(const V& v) const; Index: mln/fun/cast.hh --- mln/fun/cast.hh (revision 3942) +++ mln/fun/cast.hh (working copy) @@ -44,7 +44,7 @@ // FIXME: Doc! template <typename V, typename F> - struct cast_p2v_expr_ : public Function_p2v< cast_p2v_expr_<V,F> > + struct cast_p2v_expr_ : public Function_v2v< cast_p2v_expr_<V,F> > { typedef V result; @@ -69,7 +69,7 @@ template <typename V, typename F> inline cast_p2v_expr_<V, F> - cast(const Function_p2v<F>& f) + cast(const Function_v2v<F>& f) { cast_p2v_expr_<V, F> tmp(exact(f)); return tmp; Index: mln/fun/ops.hh --- mln/fun/ops.hh (revision 3942) +++ mln/fun/ops.hh (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// 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 @@ -28,10 +29,9 @@ #ifndef MLN_FUN_OPS_HH # define MLN_FUN_OPS_HH -/*! \file mln/fun/ops.hh - * - * \brief FIXME. - */ +/// \file mln/fun/ops.hh +/// +/// \brief FIXME. # include <mln/core/concept/function.hh> # include <mln/fun/internal/selector.hh> @@ -152,32 +152,6 @@ namespace mln { - // -> p2v - - mln_decl_binary_expr_(p2v, p2b, eq, ==); - mln_decl_binary_expr_(p2v, p2b, neq, !=); - - mln_decl_binary_expr_(p2v, p2b, less, <); - mln_decl_binary_expr_(p2v, p2b, leq , <=); - mln_decl_binary_expr_(p2v, p2b, geq, >=); - mln_decl_binary_expr_(p2v, p2b, greater, >); - - mln_decl_binary_expr_(p2b, p2b, and_, &&); - mln_decl_binary_expr_(p2b, p2b, or_, ||); - mln_decl_binary_expr_(p2b, p2b, xor_, ^); - - mln_decl_unary_expr_(p2b, p2b, not_, !); - - mln_decl_binary_expr_(p2v, p2v, plus, +); - mln_decl_binary_expr_(p2v, p2v, minus, -); - mln_decl_binary_expr_(p2v, p2v, times, *); - mln_decl_binary_expr_(p2v, p2v, div, /); - mln_decl_binary_expr_(p2v, p2v, mod, %); - - mln_decl_unary_expr_(p2v, p2v, uplus, +); - mln_decl_unary_expr_(p2v, p2v, uminus, -); - - // -> v2b mln_decl_binary_expr_(v2v, v2b, eq, ==); mln_decl_binary_expr_(v2v, v2b, neq, !=); @@ -193,6 +167,15 @@ mln_decl_unary_expr_(v2b, v2b, not_, !); + mln_decl_binary_expr_(v2v, v2v, plus, +); + mln_decl_binary_expr_(v2v, v2v, minus, -); + mln_decl_binary_expr_(v2v, v2v, times, *); + mln_decl_binary_expr_(v2v, v2v, div, /); + mln_decl_binary_expr_(v2v, v2v, mod, %); + + mln_decl_unary_expr_(v2v, v2v, uplus, +); + mln_decl_unary_expr_(v2v, v2v, uminus, -); + } // end of namespace mln Index: mln/fun/i2v/all_to.hh --- mln/fun/i2v/all_to.hh (revision 3942) +++ mln/fun/i2v/all_to.hh (working copy) @@ -46,7 +46,7 @@ { template <typename T> - struct all_to : public Function_i2v< all_to<T> > + struct all_to : public Function_v2v< all_to<T> > { typedef T result; all_to(T t); Index: mln/fun/i2v/array.hh --- mln/fun/i2v/array.hh (revision 3942) +++ mln/fun/i2v/array.hh (working copy) @@ -97,13 +97,13 @@ template <typename T, bool B = false > struct array_selector_ - : public Function_i2v< i2v::array<T> > + : public Function_v2v< i2v::array<T> > { }; template <typename T> struct array_selector_<T,true> - : public Function_i2b< i2v::array<T> > + : public Function_v2b< i2v::array<T> > { }; Index: mln/fun/p2p/fold.hh --- mln/fun/p2p/fold.hh (revision 3942) +++ mln/fun/p2p/fold.hh (working copy) @@ -57,7 +57,7 @@ int dir_0 = -1, int dir_1 = -1, int dir_2 = -1 > - struct fold : Function_p2p< fold<P,dir_0,dir_1,dir_2> > + struct fold : Function_v2v< fold<P,dir_0,dir_1,dir_2> > { fold(); fold(const box<P>& b); Index: mln/fun/p2p/mirror.hh --- mln/fun/p2p/mirror.hh (revision 3942) +++ mln/fun/p2p/mirror.hh (working copy) @@ -45,7 +45,7 @@ { template <typename B> - struct mirror : public Function_p2p< mirror<B> > + struct mirror : public Function_v2v< mirror<B> > { typedef mln_psite(B) result; Index: mln/fun/p2p/translation.hh --- mln/fun/p2p/translation.hh (revision 3942) +++ mln/fun/p2p/translation.hh (working copy) @@ -47,7 +47,7 @@ { template <typename P> - struct translation_t : public Function_p2p< translation_t<P> > + struct translation_t : public Function_v2v< translation_t<P> > { typedef P result; Index: mln/fun/p2v/elifs.hh --- mln/fun/p2v/elifs.hh (revision 3942) +++ mln/fun/p2v/elifs.hh (working copy) @@ -50,9 +50,9 @@ typename O> ternary_<T1, N1, ternary_<T2, N2, O> > - elifs(const Function_p2b<T1>& f_if_1, const Function_p2v<N1>& f_then_1, - const Function_p2b<T2>& f_if_2, const Function_p2v<N2>& f_then_2, - const Function_p2v<O>& f_otherwise); + elifs(const Function_v2b<T1>& f_if_1, const Function_v2v<N1>& f_then_1, + const Function_v2b<T2>& f_if_2, const Function_v2v<N2>& f_then_2, + const Function_v2v<O>& f_otherwise); # ifndef MLN_INCLUDE_ONLY @@ -63,9 +63,9 @@ inline ternary_<T1, N1, ternary_<T2, N2, O> > - elifs(const Function_p2b<T1>& f_if_1, const Function_p2v<N1>& f_then_1, - const Function_p2b<T2>& f_if_2, const Function_p2v<N2>& f_then_2, - const Function_p2v<O>& f_otherwise) + elifs(const Function_v2b<T1>& f_if_1, const Function_v2v<N1>& f_then_1, + const Function_v2b<T2>& f_if_2, const Function_v2v<N2>& f_then_2, + const Function_v2v<O>& f_otherwise) { typedef ternary_<T2, N2, O> T2_N2_O; T2_N2_O f_otherwise_1(f_if_2, f_then_2, f_otherwise); Index: mln/fun/p2v/ternary.hh --- mln/fun/p2v/ternary.hh (revision 3942) +++ mln/fun/p2v/ternary.hh (working copy) @@ -51,9 +51,9 @@ { typedef mln_result(T) result; - ternary_(const Function_p2b<P>& f_pred, - const Function_p2v<T>& f_true, - const Function_p2v<F>& f_false); + ternary_(const Function_v2b<P>& f_pred, + const Function_v2v<T>& f_true, + const Function_v2v<F>& f_false); template <typename Pt> result operator()(const Pt& p) const; @@ -67,18 +67,18 @@ template <typename P, typename T, typename F> ternary_<P, T, F> - ternary(const Function_p2b<P>& f_pred, - const Function_p2v<T>& f_true, - const Function_p2v<F>& f_false); + ternary(const Function_v2b<P>& f_pred, + const Function_v2v<T>& f_true, + const Function_v2v<F>& f_false); # ifndef MLN_INCLUDE_ONLY template <typename P, typename T, typename F> inline - ternary_<P,T,F>::ternary_(const Function_p2b<P>& f_pred, - const Function_p2v<T>& f_true, - const Function_p2v<F>& f_false) + ternary_<P,T,F>::ternary_(const Function_v2b<P>& f_pred, + const Function_v2v<T>& f_true, + const Function_v2v<F>& f_false) : f_pred_(exact(f_pred)), f_true_(exact(f_true)), f_false_(exact(f_false)) @@ -98,9 +98,9 @@ template <typename P, typename T, typename F> inline ternary_<P, T, F> - ternary(const Function_p2b<P>& f_pred, - const Function_p2v<T>& f_true, - const Function_p2v<F>& f_false) + ternary(const Function_v2b<P>& f_pred, + const Function_v2v<T>& f_true, + const Function_v2v<F>& f_false) { ternary_<P, T, F> tmp(exact(f_pred), exact(f_true), Index: mln/fun/p2v/iota.hh --- mln/fun/p2v/iota.hh (revision 3942) +++ mln/fun/p2v/iota.hh (working copy) @@ -45,7 +45,7 @@ namespace p2v { - struct iota : public Function_p2v< iota > + struct iota : public Function_v2v< iota > { typedef unsigned result; Index: mln/fun/internal/x2x_linear_impl.hh --- mln/fun/internal/x2x_linear_impl.hh (revision 3942) +++ mln/fun/internal/x2x_linear_impl.hh (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 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 @@ -28,10 +29,10 @@ #ifndef MLN_FUN_INTERNAL_X2X_LINEAR_IMPL_HH # define MLN_FUN_INTERNAL_X2X_LINEAR_IMPL_HH -/*! \file mln/fun/internal/x2x_linear_impl.hh - * - * \brief Implementation class for every linear Function_x2x. - */ +/// \file mln/fun/internal/x2x_linear_impl.hh +/// +/// \brief Implementation class for every linear function from vector +/// to vector in an homogeneous coordinates system. # include <mln/core/concept/function.hh> # include <mln/algebra/h_mat.hh> Index: mln/fun/internal/selector.hh --- mln/fun/internal/selector.hh (revision 3942) +++ mln/fun/internal/selector.hh (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// 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 @@ -28,18 +29,13 @@ #ifndef MLN_FUN_INTERNAL_SELECTOR_HH # define MLN_FUN_INTERNAL_SELECTOR_HH -/*! \file mln/fun/internal/selector.hh - * - * \brief FIXME. - */ +/// \file mln/fun/internal/selector.hh +/// +/// \brief Select a concept (either Function_v2v or Function_v2b) +/// depending on the result type. # include <mln/core/concept/function.hh> -# include <mln/core/concept/site.hh> -# include <mln/core/concept/pseudo_site.hh> # include <mln/metal/unqualif.hh> -# include <mln/metal/if.hh> -# include <mln/metal/is_a.hh> -# include <mln/algebra/vec.hh> namespace mln @@ -51,119 +47,17 @@ namespace internal { - // Function_v2v - // | - // + ---------------------- Function_v2b - // | | - // + -- Function_i2v | - // | | - // + -- Function_x2x | - // | | - // + -- Function_p2v | - // | | - // + -- Function_p2b -- + - // | - // + -- Function_p2p - - enum - { - b_, - i_, - p_, - v_, - x_ - }; - - template <int arg, int res, typename E> struct helper_selector_; - - // b2* => v2v type, except for v2b - template <typename E> - struct helper_selector_< b_, b_, E > { typedef Function_v2b<E> ret; }; - template <typename E> - struct helper_selector_< b_, i_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< b_, p_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< b_, v_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< b_, x_, E > { typedef Function_v2v<E> ret; }; - - // i2* => i2v type - template <typename E> - struct helper_selector_< i_, b_, E > { typedef Function_i2v<E> ret; }; - template <typename E> - struct helper_selector_< i_, i_, E > { typedef Function_i2v<E> ret; }; - template <typename E> - struct helper_selector_< i_, p_, E > { typedef Function_i2v<E> ret; }; - template <typename E> - struct helper_selector_< i_, v_, E > { typedef Function_i2v<E> ret; }; - template <typename E> - struct helper_selector_< i_, x_, E > { typedef Function_i2v<E> ret; }; - - // p2* - template <typename E> - struct helper_selector_< p_, b_, E > { typedef Function_p2b<E> ret; }; - template <typename E> - struct helper_selector_< p_, i_, E > { typedef Function_p2v<E> ret; }; // no p2i type => p2v - template <typename E> - struct helper_selector_< p_, p_, E > { typedef Function_p2p<E> ret; }; - template <typename E> - struct helper_selector_< p_, v_, E > { typedef Function_p2v<E> ret; }; - template <typename E> - struct helper_selector_< p_, x_, E > { typedef Function_p2v<E> ret; }; - - // v2* => v2v type, except for v2b - template <typename E> - struct helper_selector_< v_, b_, E > { typedef Function_v2b<E> ret; }; - template <typename E> - struct helper_selector_< v_, i_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< v_, p_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< v_, v_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< v_, x_, E > { typedef Function_v2v<E> ret; }; - - // x2* => v2v type - template <typename E> - struct helper_selector_< x_, b_, E > { typedef Function_v2b<E> ret; }; - template <typename E> - struct helper_selector_< x_, i_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< x_, p_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< x_, v_, E > { typedef Function_v2v<E> ret; }; - template <typename E> - struct helper_selector_< x_, x_, E > { typedef Function_v2v<E> ret; }; - - // tag_ - - template <typename T> struct tag_; - - template <> - struct tag_< bool > - { - enum { value = b_ }; - }; - - template <> - struct tag_< unsigned > - { - enum { value = i_ }; - }; - template <unsigned n, typename T> - struct tag_< algebra::vec<n,T> > + template <typename A, typename R, typename E> + struct helper_selector_ { - enum { value = x_ }; + typedef Function_v2v<E> ret; }; - template <typename T> - struct tag_ + template <typename A, typename E> + struct helper_selector_< A, bool, E > { - enum { value = (mlc_is_a(T, Site)::value || mlc_is_a(T, Pseudo_Site)::value) - ? p_ - : v_ }; + typedef Function_v2b<E> ret; }; @@ -172,20 +66,15 @@ { typedef mlc_unqualif(R_) R; typedef mlc_unqualif(A_) A; - enum { arg = tag_<A>::value, - res = tag_<R>::value }; - typedef typename helper_selector_<arg, res, E>::ret ret; + typedef typename helper_selector_<R, A, E>::ret ret; private: selector_(); }; template <typename R_, typename E> - struct selector_p2_ + struct selector_p2_ : selector_< R_, void, E > { - typedef mlc_unqualif(R_) R; - enum { res = tag_<R>::value }; - typedef typename helper_selector_<p_, res, E>::ret ret; private: selector_p2_(); }; Index: mln/fun/x2x/composed.hh --- mln/fun/x2x/composed.hh (revision 3942) +++ mln/fun/x2x/composed.hh (working copy) @@ -64,7 +64,7 @@ template <typename T2, typename T1, typename E> struct helper_composed_<T2,T1,E,true> : public fun::internal::x2x_linear_impl_<mln_result(T2), E >, - public Bijection_x2x<E> + public Function_v2v<E> { typedef fun::internal::x2x_linear_impl_<typename T2::result, E > super_; @@ -102,7 +102,7 @@ template <typename T2, typename T1, typename E> struct helper_composed_<T2,T1,E,false> : public fun::internal::x2x_linear_impl_<mln_result(T2), E >, - public Function_x2x<E> + public Function_v2v<E> { typedef fun::internal::x2x_linear_impl_<typename T2::result, E > super_; @@ -138,8 +138,8 @@ template <typename T2, typename T1> struct composed : public internal::helper_composed_<T2,T1,composed<T2,T1>, - mlc_is(T2, Bijection_x2x<T2>)::value && - mlc_is(T1, Bijection_x2x<T1>)::value>, + mlc_is(T2, Function_v2v<T2>)::value && + mlc_is(T1, Function_v2v<T1>)::value>, private metal::and_< metal::bool_<(T2::dim == T1::dim)>, metal::is<mln_argument(T2), mln_result(T1)> >::check_t @@ -150,8 +150,8 @@ /// Constructor with the two transformation to be composed. composed(const T2& f, const T1& g) : internal::helper_composed_<T2,T1,composed<T2,T1>, - mlc_is(T2, Bijection_x2x<T2>)::value && - mlc_is(T1, Bijection_x2x<T1>)::value>(f, g) + mlc_is(T2, Function_v2v<T2>)::value && + mlc_is(T1, Function_v2v<T1>)::value>(f, g) {} }; Index: mln/fun/x2x/translation.hh --- mln/fun/x2x/translation.hh (revision 3942) +++ mln/fun/x2x/translation.hh (working copy) @@ -51,7 +51,7 @@ template <unsigned n, typename C> struct translation : fun::internal::x2x_linear_impl_< algebra::vec<n,C>, translation<n,C> > - , public Bijection_x2x< translation<n,C> > + , public Function_v2v< translation<n,C> > { typedef fun::internal::x2x_linear_impl_< algebra::vec<n,C>, translation<n,C> > super_; Index: mln/fun/x2x/rotation.hh --- mln/fun/x2x/rotation.hh (revision 3942) +++ mln/fun/x2x/rotation.hh (working copy) @@ -137,7 +137,7 @@ template <unsigned n, typename C> struct rotation : fun::internal::x2x_linear_impl_< algebra::vec<n,C>, rotation<n,C> > - , public Bijection_x2x< rotation<n,C> > + , public Function_v2v< rotation<n,C> > { typedef fun::internal::x2x_linear_impl_< algebra::vec<n,C>, rotation<n,C> > super_; Index: mln/fun/v2w_w2v/norm.hh --- mln/fun/v2w_w2v/norm.hh (revision 3942) +++ mln/fun/v2w_w2v/norm.hh (working copy) @@ -56,7 +56,7 @@ /// /// \see mln::norm::l1. template <typename V, typename R> - struct l1_norm : public Function_v2w_w2v< l1_norm<V, R> > + struct l1_norm : public Function_v2v< l1_norm<V, R> > { typedef R result; R operator()(const V& v) const; @@ -69,7 +69,7 @@ /// /// \see mln::norm::l2. template <typename V, typename R> - struct l2_norm : public Function_v2w_w2v< l2_norm<V, R> > + struct l2_norm : public Function_v2v< l2_norm<V, R> > { typedef R result; R operator()(const V& v) const; @@ -82,7 +82,7 @@ /// /// \see mln::norm::linfty. template <typename V, typename R> - struct linfty_norm : public Function_v2w_w2v< linfty_norm<V, R> > + struct linfty_norm : public Function_v2v< linfty_norm<V, R> > { typedef R result; R operator()(const V& v) const; Index: mln/set/diff.hh --- mln/set/diff.hh (revision 3942) +++ mln/set/diff.hh (working copy) @@ -34,7 +34,7 @@ /// Set theoretic difference (non-symmetrical) of a couple of /// sets. /// -/// \todo Add a diff(Site_Set& in_place, Function_p2b). +/// \todo Add a diff(Site_Set& in_place, Function_v2b). # include <algorithm> # include <iterator> Index: mln/algebra/mat.hh --- mln/algebra/mat.hh (revision 3942) +++ mln/algebra/mat.hh (working copy) @@ -107,7 +107,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - mat(const Function_i2v<F>& f); + mat(const Function_v2v<F>& f); template <typename U> mat& operator=(const mat<n,m,U>& rhs); @@ -480,7 +480,7 @@ template <unsigned n, unsigned m, typename T> template <typename F> inline - mat<n,m,T>::mat(const Function_i2v<F>& f_) + mat<n,m,T>::mat(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); const F& f = exact(f_); Index: mln/algebra/vec.hh --- mln/algebra/vec.hh (revision 3942) +++ mln/algebra/vec.hh (working copy) @@ -241,7 +241,7 @@ /// Constructor; coordinates are set by function \p f. template <typename F> - vec(const Function_i2v<F>& f); + vec(const Function_v2v<F>& f); /// Zero value. static const vec<n, T> zero; @@ -553,7 +553,7 @@ template <unsigned n, typename T> template <typename F> inline - vec<n, T>::vec(const Function_i2v<F>& f_) + vec<n, T>::vec(const Function_v2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); const F& f = exact(f_); Index: mln/morpho/tree/filter/min.hh --- mln/morpho/tree/filter/min.hh (revision 3942) +++ mln/morpho/tree/filter/min.hh (working copy) @@ -55,23 +55,23 @@ ** @param[out] f_ Image to filter. ** @param[in] pred_ Filtering criterion. */ - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - min(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_); + min(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_); # ifndef MLN_INCLUDE_ONLY - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - min(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_) + min(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_) { F& f = exact(f_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); trace::entering("mln::morpho::tree::filter::min"); Index: mln/morpho/tree/filter/max.hh --- mln/morpho/tree/filter/max.hh (revision 3942) +++ mln/morpho/tree/filter/max.hh (working copy) @@ -54,23 +54,23 @@ ** @param[out] f_ Image to filter. ** @param[in] pred_ Filtering criterion. */ - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - max(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_); + max(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_); # ifndef MLN_INCLUDE_ONLY - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - max(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_) + max(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_) { F& f = exact(f_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); trace::entering("mln::morpho::tree::filter::max"); Index: mln/morpho/tree/filter/filter.hh --- mln/morpho/tree/filter/filter.hh (revision 3942) +++ mln/morpho/tree/filter/filter.hh (working copy) @@ -55,21 +55,21 @@ ** @param pred_ Predicate. ** @param v Value to propagate. */ - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - filter(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_, const mln_value(F)& v); + filter(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_, const mln_value(F)& v); # ifndef MLN_INCLUDE_ONLY - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - filter(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_, const mln_value(F)& v) + filter(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_, const mln_value(F)& v) { F& f = exact(f_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); trace::entering("mln::morpho::tree::filter::filter"); Index: mln/morpho/tree/filter/direct.hh --- mln/morpho/tree/filter/direct.hh (revision 3942) +++ mln/morpho/tree/filter/direct.hh (working copy) @@ -53,23 +53,23 @@ ** @param[out] f_ Image to filter. ** @param[in] pred_ Filtering criterion. */ - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - direct(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_); + direct(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_); # ifndef MLN_INCLUDE_ONLY - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - direct(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_) + direct(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_) { F& f = exact(f_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); trace::entering("mln::morpho::tree::filter::direct"); Index: mln/morpho/tree/filter/subtractive.hh --- mln/morpho/tree/filter/subtractive.hh (revision 3942) +++ mln/morpho/tree/filter/subtractive.hh (working copy) @@ -57,23 +57,23 @@ ** @param[out] f_ Image to filter. ** @param[in] pred_ Filtering criterion. */ - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - subtractive(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_); + subtractive(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_); # ifndef MLN_INCLUDE_ONLY - template <typename T, typename F, typename P2B> + template <typename T, typename F, typename P> inline void - subtractive(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_) + subtractive(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_) { F& f = exact(f_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); trace::entering("mln::morpho::tree::filter::subtractive"); Index: mln/morpho/tree/propagate_if.hh --- mln/morpho/tree/propagate_if.hh (revision 3942) +++ mln/morpho/tree/propagate_if.hh (working copy) @@ -46,8 +46,8 @@ namespace morpho { namespace tree { - template <typename WP> - struct way_of_propagation : Object< WP > { protected: way_of_propagation() {}; }; + template <typename W> + struct way_of_propagation : Object< W > { protected: way_of_propagation() {}; }; struct desc_propagation : way_of_propagation <desc_propagation> {}; struct asc_propagation : way_of_propagation <asc_propagation> {}; @@ -63,22 +63,22 @@ ** @param v Value to be propagated. (By default \p v is the value ** at the node being propagated). */ - template <typename T, typename A, typename P2B, typename WP> + template <typename T, typename A, typename P, typename W> inline void propagate_if(const T& tree, Image<A>& a_, - const way_of_propagation<WP>&, - const Function_p2b<P2B>& pred, + const way_of_propagation<W>&, + const Function_v2b<P>& pred, const mln_value(A)& v); - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> inline void propagate_if(const T& tree, Image<A>& a_, const desc_propagation&, - const Function_p2b<P2B>& pred); + const Function_v2b<P>& pred); /** ** Propagate nodes having the value v in the way @@ -92,21 +92,21 @@ ** @param v_prop Value to propagate (By default it is the value ** at the node being propagated). */ - template <typename T, typename A, typename WP> + template <typename T, typename A, typename W> inline void propagate_if_value(const T& tree, Image<A>& a_, - const way_of_propagation<WP>&, + const way_of_propagation<W>&, const mln_value(A)& v, const mln_value(A)& v_prop); - template <typename T, typename A, typename WP> + template <typename T, typename A, typename W> inline void propagate_if_value(const T& tree, Image<A>& a_, - const way_of_propagation<WP>&, + const way_of_propagation<W>&, const mln_value(A)& v); @@ -116,11 +116,11 @@ namespace internal { - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> bool check_propagate_if(const T& t, const A& a, const asc_propagation& prop, - const P2B& pred, + const P& pred, const mln_value(A)& v) { (void) prop; @@ -131,11 +131,11 @@ return true; } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> bool check_propagate_if(const T& t, const A& a, const desc_propagation& prop, - const P2B& pred, + const P& pred, const mln_value(A)& v) { (void) prop; @@ -146,11 +146,11 @@ return true; } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> bool check_propagate_if(const T& t, const A& a, const desc_propagation& prop, - const P2B& pred) + const P& pred) { (void) prop; mln_node_piter(T) n(t); @@ -160,13 +160,13 @@ return true; } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> inline void propagate_if(const T& tree, A& a, const desc_propagation& prop, - const P2B& pred, + const P& pred, const mln_value(A)& v) { (void) prop; @@ -190,13 +190,13 @@ mln_postcondition(check_propagate_if(tree, a, prop, pred, v)); } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> inline void propagate_if(const T& tree, A& a, const desc_propagation& prop, - const P2B& pred) + const P& pred) { (void) prop; @@ -220,13 +220,13 @@ } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> inline void propagate_if(const T& tree, A& a, const asc_propagation& prop, - const P2B& pred, + const P& pred, const mln_value(A)& v) { (void) prop; @@ -256,62 +256,62 @@ /* Facades */ - template <typename T, typename A, typename WP> + template <typename T, typename A, typename W> inline void propagate_if_value(const T& tree, Image<A>& a_, - const way_of_propagation<WP>& prop_, + const way_of_propagation<W>& prop_, const mln_value(A)& v, const mln_value(A)& v_prop) { A& a = exact(a_); - const WP& prop = exact(prop_); + const W& prop = exact(prop_); internal::propagate_if(tree, a, prop, pw::value(a) == pw::cst(v), v_prop); } - template <typename T, typename A, typename WP> + template <typename T, typename A, typename W> inline void propagate_if_value(const T& tree, Image<A>& a_, - const way_of_propagation<WP>& prop_, + const way_of_propagation<W>& prop_, const mln_value(A)& v) { A& a = exact(a_); - const WP& prop = exact(prop_); + const W& prop = exact(prop_); internal::propagate_if(tree, a, prop, pw::value(a) == pw::cst(v), v); } - template <typename T, typename A, typename P2B, typename WP> + template <typename T, typename A, typename P, typename W> inline void propagate_if(const T& tree, Image<A>& a_, - const way_of_propagation<WP>& prop_, - const Function_p2b<P2B>& pred_, + const way_of_propagation<W>& prop_, + const Function_v2b<P>& pred_, const mln_value(A)& v) { A& a = exact(a_); - const WP& prop = exact(prop_); - const P2B& pred = exact(pred_); + const W& prop = exact(prop_); + const P& pred = exact(pred_); internal::propagate_if(tree, a, prop, pred, v); } - template <typename T, typename A, typename P2B> + template <typename T, typename A, typename P> inline void propagate_if(const T& tree, Image<A>& a_, const desc_propagation& prop, - const Function_p2b<P2B>& pred_) + const Function_v2b<P>& pred_) { A& a = exact(a_); - const P2B& pred = exact(pred_); + const P& pred = exact(pred_); internal::propagate_if(tree, a, prop, pred); } Index: mln/util/internal/id2element.hh --- mln/util/internal/id2element.hh (revision 3942) +++ mln/util/internal/id2element.hh (working copy) @@ -46,7 +46,7 @@ { template <typename G, typename Elt> - struct id2element : Function_i2v< id2element<G,Elt> > + struct id2element : Function_v2v< id2element<G,Elt> > { typedef Elt result; Index: mln/util/array.hh --- mln/util/array.hh (revision 3942) +++ mln/util/array.hh (working copy) @@ -93,7 +93,7 @@ /// \ingroup modutil // template <typename T> - class array : public Function_i2v< mln::util::array<T> > + class array : public Function_v2v< mln::util::array<T> > { public: @@ -101,7 +101,7 @@ typedef T element; /// Returned value types. - /// Related to the Function_i2v concept. + /// Related to the Function_v2v concept. /// @{ typedef T result; typedef typename std::vector<T>::reference mutable_result; Index: tests/arith/minus_full.cc --- tests/arith/minus_full.cc (revision 3942) +++ tests/arith/minus_full.cc (working copy) @@ -55,7 +55,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -68,7 +68,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -81,7 +81,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/arith/times_full.cc --- tests/arith/times_full.cc (revision 3942) +++ tests/arith/times_full.cc (working copy) @@ -50,7 +50,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -63,7 +63,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -76,7 +76,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/arith/plus_full.cc --- tests/arith/plus_full.cc (revision 3942) +++ tests/arith/plus_full.cc (working copy) @@ -49,7 +49,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -62,7 +62,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -75,7 +75,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/arith/revert_full.cc --- tests/arith/revert_full.cc (revision 3942) +++ tests/arith/revert_full.cc (working copy) @@ -50,7 +50,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -63,7 +63,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -76,7 +76,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/data/compute_full.cc --- tests/data/compute_full.cc (revision 3942) +++ tests/data/compute_full.cc (working copy) @@ -51,7 +51,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -64,7 +64,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -77,7 +77,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/data/fill_full.cc --- tests/data/fill_full.cc (revision 3942) +++ tests/data/fill_full.cc (working copy) @@ -62,7 +62,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -75,7 +75,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -88,7 +88,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/data/abs_full.cc --- tests/data/abs_full.cc (revision 3942) +++ tests/data/abs_full.cc (working copy) @@ -53,7 +53,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -66,7 +66,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -79,7 +79,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/data/paste_full.cc --- tests/data/paste_full.cc (revision 3942) +++ tests/data/paste_full.cc (working copy) @@ -56,7 +56,7 @@ -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -69,7 +69,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -82,7 +82,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/data/compare_full.cc --- tests/data/compare_full.cc (revision 3942) +++ tests/data/compare_full.cc (working copy) @@ -46,7 +46,7 @@ #include <mln/arith/minus.hh> -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -59,7 +59,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -72,7 +72,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/border/get_full.cc --- tests/border/get_full.cc (revision 3942) +++ tests/border/get_full.cc (working copy) @@ -41,7 +41,7 @@ #include <mln/value/rgb8.hh> -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) Index: tests/border/find_full.cc --- tests/border/find_full.cc (revision 3942) +++ tests/border/find_full.cc (working copy) @@ -48,7 +48,7 @@ #include <mln/core/routine/duplicate.hh> -struct f_box1d_t : mln::Function_p2b< f_box1d_t > +struct f_box1d_t : mln::Function_v2b< f_box1d_t > { f_box1d_t(const mln::box1d& b) : b_(b) @@ -61,7 +61,7 @@ } }; -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) @@ -74,7 +74,7 @@ } }; -struct f_box3d_t : mln::Function_p2b< f_box3d_t > +struct f_box3d_t : mln::Function_v2b< f_box3d_t > { f_box3d_t(const mln::box3d& b) : b_(b) Index: tests/border/resize_sub_image.cc --- tests/border/resize_sub_image.cc (revision 3942) +++ tests/border/resize_sub_image.cc (working copy) @@ -39,7 +39,7 @@ #include <mln/literal/origin.hh> #include <mln/border/resize.hh> -struct my_box2d : mln::Function_p2b< my_box2d > +struct my_box2d : mln::Function_v2b< my_box2d > { my_box2d(const mln::box2d& b) : b_(b) Index: tests/border/get.cc --- tests/border/get.cc (revision 3942) +++ tests/border/get.cc (working copy) @@ -39,7 +39,7 @@ #include <mln/literal/origin.hh> -struct f_box2d_t : mln::Function_p2b< f_box2d_t > +struct f_box2d_t : mln::Function_v2b< f_box2d_t > { f_box2d_t(const mln::box2d& b) : b_(b) Index: tests/border/resize_image_if.cc --- tests/border/resize_image_if.cc (revision 3942) +++ tests/border/resize_image_if.cc (working copy) @@ -39,7 +39,7 @@ #include <mln/literal/origin.hh> #include <mln/border/resize.hh> -struct my_box2d : mln::Function_p2b< my_box2d > +struct my_box2d : mln::Function_v2b< my_box2d > { my_box2d(const mln::box2d& b) : b_(b) Index: tests/make/w_window.cc --- tests/make/w_window.cc (revision 3942) +++ tests/make/w_window.cc (working copy) @@ -37,7 +37,7 @@ #include <mln/core/alias/w_window2d_int.hh> -struct test : mln::Function_p2v<test> +struct test : mln::Function_v2v<test> { typedef int result; int operator()(const mln::point2d& p) const Index: tests/test/positive.cc --- tests/test/positive.cc (revision 3942) +++ tests/test/positive.cc (working copy) @@ -38,7 +38,7 @@ // both test routines can be called with a p2b function template <typename F> -void test_p2v(const mln::Function_p2v<F>&) +void test_p2v(const mln::Function_v2v<F>&) { } Index: tests/morpho/watershed/superpose.cc --- tests/morpho/watershed/superpose.cc (revision 3942) +++ tests/morpho/watershed/superpose.cc (working copy) @@ -49,7 +49,7 @@ namespace mln { - struct ref_data : Function_p2v<ref_data> + struct ref_data : Function_v2v<ref_data> { typedef value::rgb8 result; Index: tests/canvas/browsing/fwd.cc --- tests/canvas/browsing/fwd.cc (revision 3942) +++ tests/canvas/browsing/fwd.cc (working copy) @@ -66,7 +66,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_fwd.cc --- tests/canvas/browsing/snake_fwd.cc (revision 3942) +++ tests/canvas/browsing/snake_fwd.cc (working copy) @@ -69,7 +69,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_vert.cc --- tests/canvas/browsing/snake_vert.cc (revision 3942) +++ tests/canvas/browsing/snake_vert.cc (working copy) @@ -70,7 +70,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_generic_2d_vert.cc --- tests/canvas/browsing/snake_generic_2d_vert.cc (revision 3942) +++ tests/canvas/browsing/snake_generic_2d_vert.cc (working copy) @@ -81,7 +81,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_generic_2d_hori.cc --- tests/canvas/browsing/snake_generic_2d_hori.cc (revision 3942) +++ tests/canvas/browsing/snake_generic_2d_hori.cc (working copy) @@ -81,7 +81,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_generic_3d_vert.cc --- tests/canvas/browsing/snake_generic_3d_vert.cc (revision 3942) +++ tests/canvas/browsing/snake_generic_3d_vert.cc (working copy) @@ -88,7 +88,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/snake_generic_3d_hori.cc --- tests/canvas/browsing/snake_generic_3d_hori.cc (revision 3942) +++ tests/canvas/browsing/snake_generic_3d_hori.cc (working copy) @@ -88,7 +88,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/hyper_directional.cc --- tests/canvas/browsing/hyper_directional.cc (revision 3942) +++ tests/canvas/browsing/hyper_directional.cc (working copy) @@ -74,7 +74,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_, int dir = 0) { Index: tests/canvas/browsing/diagonal2d.cc --- tests/canvas/browsing/diagonal2d.cc (revision 3942) +++ tests/canvas/browsing/diagonal2d.cc (working copy) @@ -73,7 +73,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: tests/canvas/browsing/backdiagonal2d.cc --- tests/canvas/browsing/backdiagonal2d.cc (revision 3942) +++ tests/canvas/browsing/backdiagonal2d.cc (working copy) @@ -72,7 +72,7 @@ template <typename I, typename F, typename B> void my_test(Image<I>& ima_, - const Function_p2v<F>& f_, + const Function_v2v<F>& f_, const Browsing<B>& browse_) { I& ima = exact(ima_); Index: doc/examples/trash/graph.cc --- doc/examples/trash/graph.cc (revision 3942) +++ doc/examples/trash/graph.cc (working copy) @@ -36,7 +36,7 @@ template <typename P> -struct lg_vertex_values : public mln::Function_p2v< lg_vertex_values<P> > +struct lg_vertex_values : public mln::Function_v2v< lg_vertex_values<P> > { typedef float result; Index: doc/examples/graph-data.cc --- doc/examples/graph-data.cc (revision 3942) +++ doc/examples/graph-data.cc (working copy) @@ -12,7 +12,7 @@ // \{ template <typename S> -struct viota_t : public mln::Function_p2v< viota_t<S> > +struct viota_t : public mln::Function_v2v< viota_t<S> > { typedef unsigned result; Index: doc/examples/mln_var.cc --- doc/examples/mln_var.cc (revision 3942) +++ doc/examples/mln_var.cc (working copy) @@ -4,7 +4,7 @@ #include <mln/pw/all.hh> #include <mln/core/var.hh> -struct my_values_t : mln::Function_p2v<my_values_t> +struct my_values_t : mln::Function_v2v<my_values_t> { typedef int result; Index: doc/examples/graph-iter.cc --- doc/examples/graph-iter.cc (revision 3942) +++ doc/examples/graph-iter.cc (working copy) @@ -5,7 +5,7 @@ #include <doc/tools/sample_utils.hh> -struct viota_t : public mln::Function_p2v< viota_t > +struct viota_t : public mln::Function_v2v< viota_t > { typedef unsigned result; Index: doc/examples/extend.cc --- doc/examples/extend.cc (revision 3942) +++ doc/examples/extend.cc (working copy) @@ -39,7 +39,7 @@ namespace mln { - struct my_ext : public Function_p2v<my_ext> + struct my_ext : public Function_v2v<my_ext> { typedef value::rgb8 result;