
* mln/fun/i2v/all_to.hh, * mln/fun/i2v/array.hh, * mln/fun/i2v/value_at_index.hh, * mln/fun/stat/mahalanobis.hh, * mln/fun/v2i/index_of_value.hh, * tests/fun/i2v/all_to.cc, * tests/fun/i2v/array.cc, * tests/fun/i2v/value_at_index.cc, * tests/fun/stat/mahalanobis.cc, * tests/fun/v2i/index_of_value.cc: Move... * mln/fun/v2v/all_to.hh, * mln/fun/v2v/array.hh, * mln/fun/v2v/index_of_value.hh, * mln/fun/v2v/mahalanobis.hh, * mln/fun/v2v/value_at_index.hh, * tests/fun/v2v/all_to.cc, * tests/fun/v2v/array.cc, * tests/fun/v2v/index_of_value.cc, * tests/fun/v2v/mahalanobis.cc, * tests/fun/v2v/value_at_index.cc, * tests/fun/x2x/composed.cc, * tests/fun/x2x/translation.cc: ... here. * mln/fun/stat/all.hh, * mln/fun/i2v/essential.hh, * mln/fun/i2v/all.hh, * mln/fun/v2i/all.hh, * tests/fun/i2v/Makefile.am, * tests/fun/stat/Makefile.am, * tests/fun/v2i/Makefile.am: Remove. * tests/fun/Makefile.am: Remove deprecated subdirs. * tests/fun/v2v/Makefile.am: Add new targets. * apps/papers/levillain.09.ismm/classif-graph.cc, * doc/examples/graph-data.cc, * doc/examples/split/graph-data-4.cc.raw, * doc/examples/trash/graph.cc, * doc/examples/trash/mk_graph.cc, * doc/examples/trash/tuto_bis.cc, * headers.mk, * mln/accu/label_used.hh, * mln/accu/stat/var.hh, * mln/algebra/vec.hh, * mln/core/image/edge_image.hh, * mln/core/image/image1d.hh, * mln/core/image/image2d.hh, * mln/core/image/image3d.hh, * mln/core/image/vertex_image.hh, * mln/core/internal/labeled_image_base.hh, * mln/core/routine/init.hxx, * mln/core/site_set/p_array.hh, * mln/core/window.hh, * mln/data/transform.spe.hh, * mln/fun/all.hh, * mln/fun/essential.hh, * mln/fun/x2x/translation.hh, * mln/histo/point_from_value.hh, * mln/labeling/colorize.hh, * mln/labeling/mean_values.hh, * mln/labeling/pack.hh, * mln/labeling/relabel.hh, * mln/make/edge_image.hh, * mln/make/p_edges_with_mass_centers.hh, * mln/make/p_vertices_with_mass_centers.hh, * mln/make/relabelfun.hh, * mln/make/voronoi.hh, * mln/metal/vec.hh, * mln/morpho/line_gradient.hh, * mln/trait/ch_function_value.hh, * mln/util/array.hh, * mln/value/lut_vec.hh, * mln/win/ball.hh, * tests/algebra/h_mat.cc, * tests/algebra/mat.cc, * tests/algebra/vec2.cc, * tests/core/image/edge_image.cc, * tests/core/image/graph_image.cc, * tests/core/image/imorph/labeled_image.cc, * tests/core/image/line_graph_image.cc, * tests/core/image/vertex_and_edge_image.cc, * tests/core/image/vertex_image.cc, * tests/core/other/graph_elt_neighborhood.cc, * tests/core/other/graph_elt_window.cc, * tests/core/other/point_set_compatibility.cc, * tests/core/site_set/p_vertices.cc, * tests/draw/graph.cc, * tests/graph/labeling.cc, * tests/make/p_edges_with_mass_centers.cc, * tests/make/p_vertices_with_mass_centers.cc, * tests/morpho/artificial_line_graph_image_wst.cc, * tests/morpho/closing/area_on_vertices.cc, * tests/morpho/graph_image_morpho.cc, * tests/morpho/graph_image_wst.cc, * tests/morpho/lena_line_graph_image_wst1.cc, * tests/morpho/lena_line_graph_image_wst2.cc, * tests/morpho/line_graph_image_morpho.cc, * tests/morpho/line_graph_image_wst.cc, * tests/morpho/opening/area_on_vertices.cc, * tests/pw/image.cc, * tests/unit_test/unit-tests.mk, * tools/area_flooding.cc: Rename fun::i2v, fun::stat and fun::v2i namespaces to v2v. --- milena/ChangeLog | 110 ++++++++++++++++++++ .../apps/papers/levillain.09.ismm/classif-graph.cc | 4 +- milena/doc/examples/graph-data.cc | 4 +- milena/doc/examples/split/graph-data-4.cc.raw | 2 +- milena/doc/examples/trash/graph.cc | 6 +- milena/doc/examples/trash/mk_graph.cc | 8 +- milena/doc/examples/trash/tuto_bis.cc | 4 +- milena/headers.mk | 14 +-- milena/mln/accu/label_used.hh | 10 +- milena/mln/accu/stat/var.hh | 2 +- milena/mln/algebra/vec.hh | 2 +- milena/mln/core/image/edge_image.hh | 46 ++++---- milena/mln/core/image/image1d.hh | 2 +- milena/mln/core/image/image2d.hh | 2 +- milena/mln/core/image/image3d.hh | 2 +- milena/mln/core/image/vertex_image.hh | 40 ++++---- milena/mln/core/internal/labeled_image_base.hh | 12 +- milena/mln/core/routine/init.hxx | 10 +- milena/mln/core/site_set/p_array.hh | 2 +- milena/mln/core/window.hh | 2 +- milena/mln/data/transform.spe.hh | 12 +- milena/mln/fun/all.hh | 4 - milena/mln/fun/essential.hh | 2 +- milena/mln/fun/i2v/all.hh | 56 ---------- milena/mln/fun/i2v/essential.hh | 36 ------- milena/mln/fun/stat/all.hh | 52 --------- milena/mln/fun/v2i/all.hh | 55 ---------- milena/mln/fun/{i2v => v2v}/all_to.hh | 29 +++-- milena/mln/fun/{i2v => v2v}/array.hh | 58 ++++++----- milena/mln/fun/{v2i => v2v}/index_of_value.hh | 17 ++- milena/mln/fun/{stat => v2v}/mahalanobis.hh | 51 +++++----- milena/mln/fun/{i2v => v2v}/value_at_index.hh | 18 ++- milena/mln/fun/x2x/translation.hh | 2 +- milena/mln/histo/point_from_value.hh | 17 ++-- milena/mln/labeling/colorize.hh | 4 +- milena/mln/labeling/mean_values.hh | 2 +- milena/mln/labeling/pack.hh | 16 ++-- milena/mln/labeling/relabel.hh | 4 +- milena/mln/make/edge_image.hh | 4 +- milena/mln/make/p_edges_with_mass_centers.hh | 8 +- milena/mln/make/p_vertices_with_mass_centers.hh | 8 +- milena/mln/make/relabelfun.hh | 36 +++--- milena/mln/make/voronoi.hh | 8 +- milena/mln/metal/vec.hh | 2 +- milena/mln/morpho/line_gradient.hh | 8 +- milena/mln/trait/ch_function_value.hh | 6 +- milena/mln/util/array.hh | 18 ++-- milena/mln/value/lut_vec.hh | 12 +- milena/mln/win/ball.hh | 2 +- milena/tests/algebra/h_mat.cc | 2 +- milena/tests/algebra/mat.cc | 2 +- milena/tests/algebra/vec2.cc | 2 +- milena/tests/core/image/edge_image.cc | 6 +- milena/tests/core/image/graph_image.cc | 6 +- milena/tests/core/image/imorph/labeled_image.cc | 2 +- milena/tests/core/image/line_graph_image.cc | 6 +- milena/tests/core/image/vertex_and_edge_image.cc | 8 +- milena/tests/core/image/vertex_image.cc | 6 +- milena/tests/core/other/graph_elt_neighborhood.cc | 4 +- milena/tests/core/other/graph_elt_window.cc | 4 +- milena/tests/core/other/point_set_compatibility.cc | 4 +- milena/tests/core/site_set/p_vertices.cc | 4 +- milena/tests/draw/graph.cc | 4 +- milena/tests/fun/Makefile.am | 3 +- milena/tests/fun/i2v/Makefile.am | 26 ----- milena/tests/fun/stat/Makefile.am | 23 ---- milena/tests/fun/v2i/Makefile.am | 23 ---- milena/tests/fun/v2v/Makefile.am | 5 + milena/tests/fun/{i2v => v2v}/all_to.cc | 4 +- milena/tests/fun/{i2v => v2v}/array.cc | 4 +- milena/tests/fun/{v2i => v2v}/index_of_value.cc | 8 +- milena/tests/fun/{stat => v2v}/mahalanobis.cc | 6 +- milena/tests/fun/{i2v => v2v}/value_at_index.cc | 8 +- milena/tests/fun/x2x/composed.cc | 2 +- milena/tests/fun/x2x/translation.cc | 2 +- milena/tests/graph/labeling.cc | 4 +- milena/tests/make/p_edges_with_mass_centers.cc | 2 +- milena/tests/make/p_vertices_with_mass_centers.cc | 2 +- .../morpho/artificial_line_graph_image_wst.cc | 2 +- milena/tests/morpho/closing/area_on_vertices.cc | 4 +- milena/tests/morpho/graph_image_morpho.cc | 6 +- milena/tests/morpho/graph_image_wst.cc | 6 +- milena/tests/morpho/lena_line_graph_image_wst1.cc | 6 +- milena/tests/morpho/lena_line_graph_image_wst2.cc | 2 +- milena/tests/morpho/line_graph_image_morpho.cc | 6 +- milena/tests/morpho/line_graph_image_wst.cc | 6 +- milena/tests/morpho/opening/area_on_vertices.cc | 4 +- milena/tests/pw/image.cc | 6 +- milena/tests/unit_test/unit-tests.mk | 14 +-- milena/tools/area_flooding.cc | 4 +- 90 files changed, 468 insertions(+), 611 deletions(-) delete mode 100644 milena/mln/fun/i2v/all.hh delete mode 100644 milena/mln/fun/i2v/essential.hh delete mode 100644 milena/mln/fun/stat/all.hh delete mode 100644 milena/mln/fun/v2i/all.hh rename milena/mln/fun/{i2v => v2v}/all_to.hh (79%) rename milena/mln/fun/{i2v => v2v}/array.hh (84%) rename milena/mln/fun/{v2i => v2v}/index_of_value.hh (87%) rename milena/mln/fun/{stat => v2v}/mahalanobis.hh (65%) rename milena/mln/fun/{i2v => v2v}/value_at_index.hh (85%) delete mode 100644 milena/tests/fun/i2v/Makefile.am delete mode 100644 milena/tests/fun/stat/Makefile.am delete mode 100644 milena/tests/fun/v2i/Makefile.am rename milena/tests/fun/{i2v => v2v}/all_to.cc (95%) rename milena/tests/fun/{i2v => v2v}/array.cc (96%) rename milena/tests/fun/{v2i => v2v}/index_of_value.cc (89%) rename milena/tests/fun/{stat => v2v}/mahalanobis.cc (94%) rename milena/tests/fun/{i2v => v2v}/value_at_index.cc (89%) diff --git a/milena/ChangeLog b/milena/ChangeLog index 4b7d2c5..7bf24e1 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,113 @@ +2013-04-25 Guillaume Lazzara <z@lrde.epita.fr> + + Move fun::i2v, fun::stat and fun::v2i in fun::v2v. + + * mln/fun/i2v/all_to.hh, + * mln/fun/i2v/array.hh, + * mln/fun/i2v/value_at_index.hh, + * mln/fun/stat/mahalanobis.hh, + * mln/fun/v2i/index_of_value.hh, + * tests/fun/i2v/all_to.cc, + * tests/fun/i2v/array.cc, + * tests/fun/i2v/value_at_index.cc, + * tests/fun/stat/mahalanobis.cc, + * tests/fun/v2i/index_of_value.cc: Move... + + * mln/fun/v2v/all_to.hh, + * mln/fun/v2v/array.hh, + * mln/fun/v2v/index_of_value.hh, + * mln/fun/v2v/mahalanobis.hh, + * mln/fun/v2v/value_at_index.hh, + * tests/fun/v2v/all_to.cc, + * tests/fun/v2v/array.cc, + * tests/fun/v2v/index_of_value.cc, + * tests/fun/v2v/mahalanobis.cc, + * tests/fun/v2v/value_at_index.cc, + * tests/fun/x2x/composed.cc, + * tests/fun/x2x/translation.cc: ... here. + + * mln/fun/stat/all.hh, + * mln/fun/i2v/essential.hh, + * mln/fun/i2v/all.hh, + * mln/fun/v2i/all.hh, + * tests/fun/i2v/Makefile.am, + * tests/fun/stat/Makefile.am, + * tests/fun/v2i/Makefile.am: Remove. + + * tests/fun/Makefile.am: Remove deprecated subdirs. + + * tests/fun/v2v/Makefile.am: Add new targets. + + * apps/papers/levillain.09.ismm/classif-graph.cc, + * doc/examples/graph-data.cc, + * doc/examples/split/graph-data-4.cc.raw, + * doc/examples/trash/graph.cc, + * doc/examples/trash/mk_graph.cc, + * doc/examples/trash/tuto_bis.cc, + * headers.mk, + * mln/accu/label_used.hh, + * mln/accu/stat/var.hh, + * mln/algebra/vec.hh, + * mln/core/image/edge_image.hh, + * mln/core/image/image1d.hh, + * mln/core/image/image2d.hh, + * mln/core/image/image3d.hh, + * mln/core/image/vertex_image.hh, + * mln/core/internal/labeled_image_base.hh, + * mln/core/routine/init.hxx, + * mln/core/site_set/p_array.hh, + * mln/core/window.hh, + * mln/data/transform.spe.hh, + * mln/fun/all.hh, + * mln/fun/essential.hh, + * mln/fun/x2x/translation.hh, + * mln/histo/point_from_value.hh, + * mln/labeling/colorize.hh, + * mln/labeling/mean_values.hh, + * mln/labeling/pack.hh, + * mln/labeling/relabel.hh, + * mln/make/edge_image.hh, + * mln/make/p_edges_with_mass_centers.hh, + * mln/make/p_vertices_with_mass_centers.hh, + * mln/make/relabelfun.hh, + * mln/make/voronoi.hh, + * mln/metal/vec.hh, + * mln/morpho/line_gradient.hh, + * mln/trait/ch_function_value.hh, + * mln/util/array.hh, + * mln/value/lut_vec.hh, + * mln/win/ball.hh, + * tests/algebra/h_mat.cc, + * tests/algebra/mat.cc, + * tests/algebra/vec2.cc, + * tests/core/image/edge_image.cc, + * tests/core/image/graph_image.cc, + * tests/core/image/imorph/labeled_image.cc, + * tests/core/image/line_graph_image.cc, + * tests/core/image/vertex_and_edge_image.cc, + * tests/core/image/vertex_image.cc, + * tests/core/other/graph_elt_neighborhood.cc, + * tests/core/other/graph_elt_window.cc, + * tests/core/other/point_set_compatibility.cc, + * tests/core/site_set/p_vertices.cc, + * tests/draw/graph.cc, + * tests/graph/labeling.cc, + * tests/make/p_edges_with_mass_centers.cc, + * tests/make/p_vertices_with_mass_centers.cc, + * tests/morpho/artificial_line_graph_image_wst.cc, + * tests/morpho/closing/area_on_vertices.cc, + * tests/morpho/graph_image_morpho.cc, + * tests/morpho/graph_image_wst.cc, + * tests/morpho/lena_line_graph_image_wst1.cc, + * tests/morpho/lena_line_graph_image_wst2.cc, + * tests/morpho/line_graph_image_morpho.cc, + * tests/morpho/line_graph_image_wst.cc, + * tests/morpho/opening/area_on_vertices.cc, + * tests/pw/image.cc, + * tests/unit_test/unit-tests.mk, + * tools/area_flooding.cc: Rename fun::i2v, fun::stat and fun::v2i + namespaces to v2v. + 2013-04-19 Guillaume Lazzara <z@lrde.epita.fr> * mln/core/concept/function.hh: Document function interface for diff --git a/milena/apps/papers/levillain.09.ismm/classif-graph.cc b/milena/apps/papers/levillain.09.ismm/classif-graph.cc index 277bda8..0226f37 100644 --- a/milena/apps/papers/levillain.09.ismm/classif-graph.cc +++ b/milena/apps/papers/levillain.09.ismm/classif-graph.cc @@ -138,7 +138,7 @@ make_graph_image(const mln::image2d<bool>& seeds) // Sites associated to edges. typedef util::site_pair<point2d> site_t; - typedef fun::i2v::array<site_t> fsite_t; + typedef fun::v2v::array<site_t> fsite_t; fsite_t sites; { @@ -175,7 +175,7 @@ make_graph_image(const mln::image2d<bool>& seeds) Currently this is not possible. Hence the ``adhead of time'' creation of these values . */ // Values. - typedef fun::i2v::array<int_u8> dist_values_t; + typedef fun::v2v::array<int_u8> dist_values_t; dist_values_t dist_values(sites.size()); for (unsigned i = 0; i < dist_values.size(); ++i) dist_values(i) = 0; diff --git a/milena/doc/examples/graph-data.cc b/milena/doc/examples/graph-data.cc index 263c2d7..d17951d 100644 --- a/milena/doc/examples/graph-data.cc +++ b/milena/doc/examples/graph-data.cc @@ -3,7 +3,7 @@ #include <mln/core/concept/function.hh> #include <mln/core/var.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> #include <mln/pw/all.hh> @@ -54,7 +54,7 @@ int main() // \} // \{ - typedef fun::i2v::array<point2d> F; + typedef fun::v2v::array<point2d> F; F f(5); // We need to map 5 vertices. f(0) = point2d(0, 0); f(1) = point2d(2, 2); diff --git a/milena/doc/examples/split/graph-data-4.cc.raw b/milena/doc/examples/split/graph-data-4.cc.raw index 77949ae..39651b0 100644 --- a/milena/doc/examples/split/graph-data-4.cc.raw +++ b/milena/doc/examples/split/graph-data-4.cc.raw @@ -1,4 +1,4 @@ - typedef fun::i2v::array<point2d> F; + typedef fun::v2v::array<point2d> F; F f(5); // We need to map 5 vertices. f(0) = point2d(0, 0); f(1) = point2d(2, 2); diff --git a/milena/doc/examples/trash/graph.cc b/milena/doc/examples/trash/graph.cc index d712e69..294a215 100644 --- a/milena/doc/examples/trash/graph.cc +++ b/milena/doc/examples/trash/graph.cc @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) // Compute the component centers and use them as vertex. //FIXME: Add fun::vertex2p - typedef fun::i2v::array<point2d> fv2p_t; + typedef fun::v2v::array<point2d> fv2p_t; util::array<point2d> centers = labeling::compute(accu::center<point2d>(), iz, nlabels); fv2p_t fv2p = convert::to<fv2p_t>(centers); @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) LG lg(g); // Find lines (sites) associated to edges in g. - typedef fun::i2v::array<p_line2d> i2e_t; + typedef fun::v2v::array<p_line2d> i2e_t; util::array<p_line2d> lines; mln_edge_iter_(G) e(g); for_all(e) @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) // // literal::olive: cos(angle) < max_cos and cos(angle) > - max_cos // literal::red: cos(angle) > max_cos or cos(angle) < - max_cos - typedef fun::i2v::array<value::rgb8> lgcolor_t; + typedef fun::v2v::array<value::rgb8> lgcolor_t; lgcolor_t ecolor(pvlg.nsites()); mln_piter_(lg_ima_t) p(lg_ima.domain()); for_all (p) diff --git a/milena/doc/examples/trash/mk_graph.cc b/milena/doc/examples/trash/mk_graph.cc index a294dd0..59fc2c2 100644 --- a/milena/doc/examples/trash/mk_graph.cc +++ b/milena/doc/examples/trash/mk_graph.cc @@ -71,13 +71,13 @@ int main(int argc, char *argv[]) util::graph g = make::graph(iz, nlabels); // Use the center of each bbox component as vertex in the graph. - typedef fun::i2v::array<point2d> i2v_t; + typedef fun::v2v::array<point2d> v2v_t; util::array<point2d> centers = labeling::compute(accu::center<point2d>(), iz, nlabels); - i2v_t f = convert::to<i2v_t>(centers); - p_vertices<util::graph, i2v_t> pv(g, f); + v2v_t f = convert::to<v2v_t>(centers); + p_vertices<util::graph, v2v_t> pv(g, f); // Find lines (sites) associated to edges. - typedef fun::i2v::array<p_line2d> i2e_t; + typedef fun::v2v::array<p_line2d> i2e_t; util::array<p_line2d> lines; mln_edge_iter_(util::graph) e(g); for_all(e) diff --git a/milena/doc/examples/trash/tuto_bis.cc b/milena/doc/examples/trash/tuto_bis.cc index 893e7e3..3165980 100644 --- a/milena/doc/examples/trash/tuto_bis.cc +++ b/milena/doc/examples/trash/tuto_bis.cc @@ -15,7 +15,7 @@ # include <mln/accu/stat/min_max.hh> # include <mln/accu/stat/mean.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> # include <mln/fun/p2v/iota.hh> # include <mln/data/paste.hh> @@ -257,7 +257,7 @@ int main() // NOW WE WANT TO MODIFY THE INPUT IMAGE TO FLATTEN REGIONS... - fun::i2v::array<int> m(nbasins + 1); + fun::v2v::array<int> m(nbasins + 1); accu::compute<accu::meta::stat::mean>(cell, label, m); for (unsigned i = 1; i <= nbasins; ++i) std::cout << "mean value of basin #" << i << " is " << m(i) << std::endl; diff --git a/milena/headers.mk b/milena/headers.mk index 95778bd..c6191f5 100644 --- a/milena/headers.mk +++ b/milena/headers.mk @@ -516,11 +516,6 @@ mln/fun/component/green.hh \ mln/fun/component/red.hh \ mln/fun/component/rgb.hh \ mln/fun/essential.hh \ -mln/fun/i2v/all.hh \ -mln/fun/i2v/all_to.hh \ -mln/fun/i2v/array.hh \ -mln/fun/i2v/essential.hh \ -mln/fun/i2v/value_at_index.hh \ mln/fun/internal/ch_function_value_impl.hh \ mln/fun/internal/resolve.hh \ mln/fun/internal/selector.hh \ @@ -547,8 +542,6 @@ mln/fun/p2v/iota.hh \ mln/fun/p2v/ternary.hh \ mln/fun/param.hh \ mln/fun/spe/unary.hh \ -mln/fun/stat/all.hh \ -mln/fun/stat/mahalanobis.hh \ mln/fun/unary.hh \ mln/fun/v2b/all.hh \ mln/fun/v2b/always_false.hh \ @@ -557,10 +550,10 @@ mln/fun/v2b/essential.hh \ mln/fun/v2b/lnot.hh \ mln/fun/v2b/threshold_ge.hh \ mln/fun/v2b/threshold_le.hh \ -mln/fun/v2i/all.hh \ -mln/fun/v2i/index_of_value.hh \ mln/fun/v2v/abs.hh \ mln/fun/v2v/all.hh \ +mln/fun/v2v/all_to.hh \ +mln/fun/v2v/array.hh \ mln/fun/v2v/cast.hh \ mln/fun/v2v/ch_function_value.hh \ mln/fun/v2v/component.hh \ @@ -571,7 +564,9 @@ mln/fun/v2v/essential.hh \ mln/fun/v2v/hsl_to_rgb.hh \ mln/fun/v2v/id.hh \ mln/fun/v2v/inc.hh \ +mln/fun/v2v/index_of_value.hh \ mln/fun/v2v/linear.hh \ +mln/fun/v2v/mahalanobis.hh \ mln/fun/v2v/norm.hh \ mln/fun/v2v/projection.hh \ mln/fun/v2v/qt_rgb_to_int_u.hh \ @@ -582,6 +577,7 @@ mln/fun/v2v/rgb_to_luma.hh \ mln/fun/v2v/round.hh \ mln/fun/v2v/round_sat.hh \ mln/fun/v2v/saturate.hh \ +mln/fun/v2v/value_at_index.hh \ mln/fun/v2v/wrap.hh \ mln/fun/v2w2v/all.hh \ mln/fun/v2w2v/cos.hh \ diff --git a/milena/mln/accu/label_used.hh b/milena/mln/accu/label_used.hh index 69121b1..3bca28c 100644 --- a/milena/mln/accu/label_used.hh +++ b/milena/mln/accu/label_used.hh @@ -35,7 +35,7 @@ # include <mln/core/concept/meta_accumulator.hh> # include <mln/math/max.hh> # include <mln/value/next.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> namespace mln @@ -50,7 +50,7 @@ namespace mln /// \ingroup modaccuvalues // template <typename L> - struct label_used : public mln::accu::internal::base< const fun::i2v::array<bool>& , label_used<L> > + struct label_used : public mln::accu::internal::base< const fun::v2v::array<bool>& , label_used<L> > { typedef L argument; @@ -66,7 +66,7 @@ namespace mln /// \} /// Get the value of the accumulator. - const fun::i2v::array<bool>& to_result() const; + const fun::v2v::array<bool>& to_result() const; /// Check whether this accu is able to return a result. /// Always true here. @@ -74,7 +74,7 @@ namespace mln protected: /// True if a label is used. - fun::i2v::array<bool> label_used_; + fun::v2v::array<bool> label_used_; }; @@ -138,7 +138,7 @@ namespace mln template <typename L> inline - const fun::i2v::array<bool>& + const fun::v2v::array<bool>& label_used<L>::to_result() const { return label_used_; diff --git a/milena/mln/accu/stat/var.hh b/milena/mln/accu/stat/var.hh index 81522c1..d39f760 100644 --- a/milena/mln/accu/stat/var.hh +++ b/milena/mln/accu/stat/var.hh @@ -35,7 +35,7 @@ # include <mln/accu/internal/base.hh> # include <mln/algebra/vec.hh> # include <mln/algebra/mat.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> # include <mln/util/pix.hh> diff --git a/milena/mln/algebra/vec.hh b/milena/mln/algebra/vec.hh index b02bf24..d988cf4 100644 --- a/milena/mln/algebra/vec.hh +++ b/milena/mln/algebra/vec.hh @@ -41,7 +41,7 @@ # include <mln/norm/l2.hh> # include <mln/trait/all.hh> # include <mln/trait/value_.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> # include <mln/debug/format.hh> # include <mln/value/ops.hh> diff --git a/milena/mln/core/image/edge_image.hh b/milena/mln/core/image/edge_image.hh index 9cadce5..ac5bb83 100644 --- a/milena/mln/core/image/edge_image.hh +++ b/milena/mln/core/image/edge_image.hh @@ -36,7 +36,7 @@ # include <mln/core/image/graph_elt_window.hh> # include <mln/core/image/graph_elt_neighborhood.hh> # include <mln/pw/internal/image_base.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> @@ -54,8 +54,8 @@ namespace mln template <typename P, typename V, typename G> struct image_< edge_image<P,V,G> > - : pw_image_<fun::i2v::array<V>, - p_edges<util::graph, fun::i2v::array<P> >, + : pw_image_<fun::v2v::array<V>, + p_edges<util::graph, fun::v2v::array<P> >, edge_image<P,V,G> > { }; @@ -75,10 +75,10 @@ namespace mln { typedef typename edge_image<P,V,G>::site_function_t site_function_t; - data(const fun::i2v::array<V>& edge_values, + data(const fun::v2v::array<V>& edge_values, const p_edges<G,site_function_t>& pe); - fun::i2v::array<V> f_; + fun::v2v::array<V> f_; p_edges<G,site_function_t> domain_; }; @@ -87,12 +87,12 @@ namespace mln - /// Construct a edge image from a fun::i2v::array and a p_edges. - /// image = fun::i2v::array | p_edges. + /// Construct a edge image from a fun::v2v::array and a p_edges. + /// image = fun::v2v::array | p_edges. template <typename V, typename G, typename P> edge_image<P,V,G> - operator | (const fun::i2v::array<V>& edge_values, - const p_edges<G,fun::i2v::array<P> >& pe); + operator | (const fun::v2v::array<V>& edge_values, + const p_edges<G,fun::v2v::array<P> >& pe); // Vertex_image_fsite_selector @@ -103,7 +103,7 @@ namespace mln template <typename P, typename G> struct efsite_selector { - typedef fun::i2v::array<P> site_function_t; + typedef fun::v2v::array<P> site_function_t; }; @@ -124,11 +124,11 @@ namespace mln // template <typename P, typename V, typename G = util::graph> class edge_image - : public pw::internal::image_base<fun::i2v::array<V>, + : public pw::internal::image_base<fun::v2v::array<V>, p_edges<G, typename internal::efsite_selector<P,G>::site_function_t >, edge_image<P,V,G> > { - typedef pw::internal::image_base<fun::i2v::array<V>, + typedef pw::internal::image_base<fun::v2v::array<V>, p_edges<G, typename internal::efsite_selector<P,G>::site_function_t >, edge_image<P,V,G> > super_; @@ -168,10 +168,10 @@ namespace mln edge_image(const p_edges<G, site_function_t>& pe); edge_image(const Graph<G>& g, const Function_v2v< site_function_t >& edge_sites, - const Function_v2v< fun::i2v::array<V> >& edge_values); + const Function_v2v< fun::v2v::array<V> >& edge_values); edge_image(const p_edges<G, site_function_t >& pe, - const Function_v2v< fun::i2v::array<V> >& edge_values); + const Function_v2v< fun::v2v::array<V> >& edge_values); template <typename FP, typename FV> edge_image(const Graph<G>& g, @@ -208,7 +208,7 @@ namespace mln template <typename P, typename V, typename G, typename J> void init_(tag::image_t, edge_image<P,V,G>& target, const Image<J>& model) { - fun::i2v::array<V> f; + fun::v2v::array<V> f; init_(tag::function, f, exact(model)); p_edges<G, typename edge_image<P,V,G>::site_function_t> s; init_(tag::domain, s, exact(model)); @@ -220,8 +220,8 @@ namespace mln template <typename V, typename G, typename P> inline edge_image<P,V,G> - operator | (const fun::i2v::array<V>& edge_values, - const p_edges<G,fun::i2v::array<P> >& pe) + operator | (const fun::v2v::array<V>& edge_values, + const p_edges<G,fun::v2v::array<P> >& pe) { edge_image<P,V,G> tmp(edge_values, pe); return tmp; @@ -236,7 +236,7 @@ namespace mln template <typename P, typename V, typename G> inline - data< mln::edge_image<P,V,G> >::data(const fun::i2v::array<V>& f, + data< mln::edge_image<P,V,G> >::data(const fun::v2v::array<V>& f, const p_edges<G,site_function_t>& ps) : f_(exact(f)), domain_(ps) @@ -258,7 +258,7 @@ namespace mln template <typename P, typename V, typename G> inline edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe) - : super_(fun::i2v::array<V>(pe.nsites()), pe) + : super_(fun::v2v::array<V>(pe.nsites()), pe) { } @@ -266,7 +266,7 @@ namespace mln inline edge_image<P,V,G>::edge_image(const Graph<G>& g, const Function_v2v< site_function_t >& edge_sites, - const Function_v2v< fun::i2v::array<V> >& edge_values) + const Function_v2v< fun::v2v::array<V> >& edge_values) : super_(exact(edge_values), p_edges<G,site_function_t>(g, exact(edge_sites))) { @@ -275,7 +275,7 @@ namespace mln 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_v2v< fun::i2v::array<V> >& edge_values) + const Function_v2v< fun::v2v::array<V> >& edge_values) : super_(exact(edge_values), pe) { } @@ -286,7 +286,7 @@ namespace mln edge_image<P,V,G>::edge_image(const Graph<G>& g, const Function_v2v<FP>& edge_sites, const Function_v2v<FV>& edge_values) - : super_(convert::to<fun::i2v::array<V> >(exact(edge_values)), + : super_(convert::to<fun::v2v::array<V> >(exact(edge_values)), p_edges<G,site_function_t>(g, exact(edge_sites))) { mlc_equal(mln_result(FP),P)::check(); @@ -298,7 +298,7 @@ namespace mln inline edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe, const Function_v2v<FV>& edge_values) - : super_(convert::to<fun::i2v::array<V> >(exact(edge_values)), pe) + : super_(convert::to<fun::v2v::array<V> >(exact(edge_values)), pe) { mlc_equal(mln_result(FV),V)::check(); } diff --git a/milena/mln/core/image/image1d.hh b/milena/mln/core/image/image1d.hh index ce73205..b5ed229 100644 --- a/milena/mln/core/image/image1d.hh +++ b/milena/mln/core/image/image1d.hh @@ -39,7 +39,7 @@ # include <mln/border/thickness.hh> # include <mln/value/set.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> // FIXME: diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh index 490c261..fee7b34 100644 --- a/milena/mln/core/image/image2d.hh +++ b/milena/mln/core/image/image2d.hh @@ -39,7 +39,7 @@ # include <mln/border/thickness.hh> # include <mln/value/set.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> // # include <mln/core/line_piter.hh> // FIXME diff --git a/milena/mln/core/image/image3d.hh b/milena/mln/core/image/image3d.hh index be13c35..22924c3 100644 --- a/milena/mln/core/image/image3d.hh +++ b/milena/mln/core/image/image3d.hh @@ -37,7 +37,7 @@ # include <mln/border/thickness.hh> # include <mln/value/set.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> // # include <mln/core/line_piter.hh> diff --git a/milena/mln/core/image/vertex_image.hh b/milena/mln/core/image/vertex_image.hh index 4710f17..3fc5042 100644 --- a/milena/mln/core/image/vertex_image.hh +++ b/milena/mln/core/image/vertex_image.hh @@ -37,7 +37,7 @@ # include <mln/core/image/graph_elt_mixed_neighborhood.hh> # include <mln/core/site_set/p_vertices.hh> # include <mln/pw/internal/image_base.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> # include <mln/util/internal/id2element.hh> @@ -57,8 +57,8 @@ namespace mln template <typename P, typename V, typename G> struct image_< vertex_image<P,V,G> > - : pw_image_<fun::i2v::array<V>, - p_vertices<util::graph, fun::i2v::array<P> >, + : pw_image_<fun::v2v::array<V>, + p_vertices<util::graph, fun::v2v::array<P> >, vertex_image<P,V,G> > { }; @@ -80,10 +80,10 @@ namespace mln typedef typename vertex_image<P,V,G>::site_function_t site_function_t; template <typename F> - data(const fun::i2v::array<V>& vertex_values, + data(const fun::v2v::array<V>& vertex_values, const p_vertices<G,F>& pv); - fun::i2v::array<V> f_; + fun::v2v::array<V> f_; p_vertices<G,site_function_t> domain_; }; @@ -91,12 +91,12 @@ namespace mln - /// Construct a vertex image from a fun::i2v::array and a p_vertices. - /// image = fun::i2v::array | p_vertices. + /// Construct a vertex image from a fun::v2v::array and a p_vertices. + /// image = fun::v2v::array | p_vertices. template <typename V, typename G, typename P> vertex_image<P,V,G> - operator | (const fun::i2v::array<V>& vertex_values, - const p_vertices<G,fun::i2v::array<P> >& pv); + operator | (const fun::v2v::array<V>& vertex_values, + const p_vertices<G,fun::v2v::array<P> >& pv); // Vertex_image_fsite_selector @@ -107,7 +107,7 @@ namespace mln template <typename P, typename G> struct vfsite_selector { - typedef fun::i2v::array<P> site_function_t; + typedef fun::v2v::array<P> site_function_t; }; @@ -128,11 +128,11 @@ namespace mln // template <typename P, typename V, typename G = util::graph> class vertex_image - : public pw::internal::image_base<fun::i2v::array<V>, + : public pw::internal::image_base<fun::v2v::array<V>, p_vertices<G, typename internal::vfsite_selector<P,G>::site_function_t >, vertex_image<P,V,G> > { - typedef pw::internal::image_base<fun::i2v::array<V>, + typedef pw::internal::image_base<fun::v2v::array<V>, p_vertices<G, typename internal::vfsite_selector<P,G>::site_function_t >, vertex_image<P,V,G> > super_; @@ -175,7 +175,7 @@ namespace mln vertex_image(); vertex_image(const p_vertices<G, site_function_t>& pv); vertex_image(const p_vertices<G, site_function_t>& pv, - const Function_v2v< fun::i2v::array<V> >& vertex_values); + const Function_v2v< fun::v2v::array<V> >& vertex_values); template <typename FV> vertex_image(const p_vertices<G, site_function_t>& pv, const Function_v2v<FV>& vertex_values); @@ -207,7 +207,7 @@ namespace mln template <typename P, typename V, typename G, typename J> void init_(tag::image_t, vertex_image<P,V,G>& target, const Image<J>& model) { - fun::i2v::array<V> f; + fun::v2v::array<V> f; init_(tag::function, f, exact(model)); p_vertices<G,typename vertex_image<P,V,G>::site_function_t> s; init_(tag::domain, s, exact(model)); @@ -219,8 +219,8 @@ namespace mln template <typename V, typename G, typename P> inline vertex_image<P,V,G> - operator | (const fun::i2v::array<V>& vertex_values, - const p_vertices<G, fun::i2v::array<P> >& pv) + operator | (const fun::v2v::array<V>& vertex_values, + const p_vertices<G, fun::v2v::array<P> >& pv) { vertex_image<P,V,G> tmp(pv, vertex_values); return tmp; @@ -236,7 +236,7 @@ namespace mln template <typename P, typename V, typename G> template <typename F> inline - data< mln::vertex_image<P,V,G> >::data(const fun::i2v::array<V>& f, + data< mln::vertex_image<P,V,G> >::data(const fun::v2v::array<V>& f, const p_vertices<G,F>& ps) : f_(f), domain_(ps) @@ -258,14 +258,14 @@ namespace mln template <typename P, typename V, typename G> inline vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv) - : super_(fun::i2v::array<V>(pv.nsites()), pv) + : super_(fun::v2v::array<V>(pv.nsites()), pv) { } 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_v2v< fun::i2v::array<V> >& vertex_values) + const Function_v2v< fun::v2v::array<V> >& vertex_values) : super_(exact(vertex_values), pv) { } @@ -275,7 +275,7 @@ namespace mln inline vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv, const Function_v2v<FV>& vertex_values) - : super_(convert::to<fun::i2v::array<V> >(exact(vertex_values)), pv) + : super_(convert::to<fun::v2v::array<V> >(exact(vertex_values)), pv) { mlc_equal(mln_result(FV),V)::check(); } diff --git a/milena/mln/core/internal/labeled_image_base.hh b/milena/mln/core/internal/labeled_image_base.hh index 5aa269a..5d9b784 100644 --- a/milena/mln/core/internal/labeled_image_base.hh +++ b/milena/mln/core/internal/labeled_image_base.hh @@ -164,7 +164,7 @@ namespace mln protected: /// Update bounding boxes information. - void update_data(const fun::i2v::array<mln_value(I)>& relabel_fun); + void update_data(const fun::v2v::array<mln_value(I)>& relabel_fun); template <typename F> void relabel_(const Function_v2v<F>& f); @@ -177,7 +177,7 @@ namespace mln void init_update_data_(); void prepare_update_data_(const mln_value(I)& lbl, const mln_value(I)& new_lbl); - void update_data_(const fun::i2v::array<mln_value(I)>& relabel_fun); + void update_data_(const fun::v2v::array<mln_value(I)>& relabel_fun); /// @} }; @@ -230,7 +230,7 @@ namespace mln const F& f = exact(f_); mln_value(I) new_nlabels; - fun::i2v::array<mln_value(I)> + fun::v2v::array<mln_value(I)> packed_relabel_fun = make::relabelfun(f, this->data_->nlabels_, new_nlabels); @@ -256,7 +256,7 @@ namespace mln const F& f = exact(f_); // Relabel the underlying image. - typedef fun::i2v::array<mln_value(I)> fv2v_t; + typedef fun::v2v::array<mln_value(I)> fv2v_t; fv2v_t fv2v = make::relabelfun(f, this->data_->nlabels_, this->data_->nlabels_); @@ -280,7 +280,7 @@ namespace mln template <typename I, typename E> void - labeled_image_base<I,E>::update_data(const fun::i2v::array<mln_value(I)>& relabel_fun) + labeled_image_base<I,E>::update_data(const fun::v2v::array<mln_value(I)>& relabel_fun) { util::array<accu::shape::bbox<mln_psite(I)> > new_bboxes(mln::value::next(this->data_->nlabels_)); @@ -350,7 +350,7 @@ namespace mln template <typename I, typename E> void labeled_image_base<I,E>::update_data_( - const fun::i2v::array<mln_value(I)>& relabel_fun) + const fun::v2v::array<mln_value(I)>& relabel_fun) { (void) relabel_fun; // No-Op. diff --git a/milena/mln/core/routine/init.hxx b/milena/mln/core/routine/init.hxx index 1ff8067..d1bfda4 100644 --- a/milena/mln/core/routine/init.hxx +++ b/milena/mln/core/routine/init.hxx @@ -36,7 +36,7 @@ namespace mln { // Forward declarations. - namespace fun { namespace i2v { template <typename T> class array; } } + namespace fun { namespace v2v { template <typename T> class array; } } namespace pw { namespace internal { template <typename F, typename S, typename E> class image_base; } } namespace pw { template <typename F, typename S> class image; } template <typename I, typename F> struct image_if; @@ -75,12 +75,12 @@ namespace mln void init_(tag::function_t, F& f, const image_if<I,F>& model); /// Kind: function_t - /// Type: fun::i2v::array<T1> - /// From: fun::i2v::array<T2> + /// Type: fun::v2v::array<T1> + /// From: fun::v2v::array<T2> template <typename T1, typename T2> void init_(tag::function_t, - fun::i2v::array<T1>& f, - const fun::i2v::array<T2>& model); + fun::v2v::array<T1>& f, + const fun::v2v::array<T2>& model); } // end of namespace mln diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh index db53424..8fa82f4 100644 --- a/milena/mln/core/site_set/p_array.hh +++ b/milena/mln/core/site_set/p_array.hh @@ -224,7 +224,7 @@ namespace mln bool is_valid() const; operator util::index() const; - operator int() const; // To interoperate, e.g., with fun::i2v expecting an int. + operator int() const; // To interoperate, e.g., with fun::v2v expecting an int. operator unsigned() const; // To avoid ambiguity when an unsigned is expected. /// \cond INTERNAL_API diff --git a/milena/mln/core/window.hh b/milena/mln/core/window.hh index 4300619..a03a82b 100644 --- a/milena/mln/core/window.hh +++ b/milena/mln/core/window.hh @@ -46,7 +46,7 @@ # include <mln/metal/is_a.hh> # include <mln/util/set.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> # include <mln/norm/linfty.hh> # include <mln/literal/zero.hh> diff --git a/milena/mln/data/transform.spe.hh b/milena/mln/data/transform.spe.hh index a8288ee..9460769 100644 --- a/milena/mln/data/transform.spe.hh +++ b/milena/mln/data/transform.spe.hh @@ -33,7 +33,7 @@ /// /// \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. +/// we do not make the difference between v2v 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...) @@ -129,7 +129,7 @@ namespace mln template <typename I, typename F> mln_ch_value(I, mln_result(F)) - transform_lowq_i2v(const Image<I>& input_, const Function_v2v<F>& f_) + transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_) { mln_trace("data::impl::transform_lowq"); @@ -180,9 +180,9 @@ namespace mln template <typename I, typename F> mln_ch_value(I, mln_result(F)) - transform_taken_i2v(const Image<I>& input_, const Function_v2v<F>& f_) + transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_) { - mln_trace("data::impl::transform_taken_i2v"); + mln_trace("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(); @@ -345,7 +345,7 @@ namespace mln trait::image::quant::low, const Image<I>& input, const Function_v2v<F>& f) { - return data::impl::transform_taken_i2v(input, f); + return data::impl::transform_taken_v2v(input, f); } // template <typename I, typename F> @@ -365,7 +365,7 @@ namespace mln trait::image::quant::low, const Image<I>& input, const Function_v2v<F>& f) { - return data::impl::transform_lowq_i2v(input, f); + return data::impl::transform_lowq_v2v(input, f); } template <typename I, typename F> diff --git a/milena/mln/fun/all.hh b/milena/mln/fun/all.hh index 3f1d2d3..6447dfc 100644 --- a/milena/mln/fun/all.hh +++ b/milena/mln/fun/all.hh @@ -59,14 +59,10 @@ namespace mln # include <mln/fun/n2v/all.hh> -# include <mln/fun/i2v/all.hh> - # include <mln/fun/p2b/all.hh> # include <mln/fun/p2v/all.hh> -# include <mln/fun/stat/all.hh> # include <mln/fun/v2b/all.hh> -# include <mln/fun/v2i/all.hh> # include <mln/fun/v2v/all.hh> # include <mln/fun/vv2v/all.hh> # include <mln/fun/x2p/all.hh> diff --git a/milena/mln/fun/essential.hh b/milena/mln/fun/essential.hh index 551d604..d0338a1 100644 --- a/milena/mln/fun/essential.hh +++ b/milena/mln/fun/essential.hh @@ -33,7 +33,7 @@ # include <mln/fun/c.hh> # include <mln/fun/ops.hh> -# include <mln/fun/i2v/essential.hh> +# include <mln/fun/v2v/essential.hh> # include <mln/fun/p2b/essential.hh> # include <mln/fun/p2v/essential.hh> diff --git a/milena/mln/fun/i2v/all.hh b/milena/mln/fun/i2v/all.hh deleted file mode 100644 index 54d5c66..0000000 --- a/milena/mln/fun/i2v/all.hh +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of Olena. -// -// Olena is free software: you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, version 2 of the License. -// -// Olena is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Olena. If not, see <http://www.gnu.org/licenses/>. -// -// As a special exception, you may use this file as part of a free -// software project without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to produce -// an executable, this file does not by itself cause the resulting -// executable to be covered by the GNU General Public License. This -// exception does not however invalidate any other reasons why the -// executable file might be covered by the GNU General Public License. - -#ifndef MLN_FUN_I2V_ALL_HH -# define MLN_FUN_I2V_ALL_HH - -/// \file -/// -/// \brief File that includes all integer-to-value functions. - - -namespace mln -{ - - namespace fun - { - - /// \brief Namespace of integer-to-value functions. - /// - /// \ingroup modfun - // - namespace i2v {} - - } -} - - -# include <mln/fun/i2v/all_to.hh> -# include <mln/fun/i2v/array.hh> -# include <mln/fun/i2v/value_at_index.hh> - - - -#endif // ! MLN_FUN_I2V_ALL_HH diff --git a/milena/mln/fun/i2v/essential.hh b/milena/mln/fun/i2v/essential.hh deleted file mode 100644 index b8c8b4d..0000000 --- a/milena/mln/fun/i2v/essential.hh +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of Olena. -// -// Olena is free software: you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, version 2 of the License. -// -// Olena is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Olena. If not, see <http://www.gnu.org/licenses/>. -// -// As a special exception, you may use this file as part of a free -// software project without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to produce -// an executable, this file does not by itself cause the resulting -// executable to be covered by the GNU General Public License. This -// exception does not however invalidate any other reasons why the -// executable file might be covered by the GNU General Public License. - -#ifndef MLN_FUN_I2V_ESSENTIAL_HH -# define MLN_FUN_I2V_ESSENTIAL_HH - -/*! \file - * - * \brief File that includes essential functions from index to value. - */ - -# include <mln/fun/i2v/all.hh> - -#endif // ! MLN_FUN_I2V_ESSENTIAL_HH diff --git a/milena/mln/fun/stat/all.hh b/milena/mln/fun/stat/all.hh deleted file mode 100644 index d207047..0000000 --- a/milena/mln/fun/stat/all.hh +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of Olena. -// -// Olena is free software: you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, version 2 of the License. -// -// Olena is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Olena. If not, see <http://www.gnu.org/licenses/>. -// -// As a special exception, you may use this file as part of a free -// software project without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to produce -// an executable, this file does not by itself cause the resulting -// executable to be covered by the GNU General Public License. This -// exception does not however invalidate any other reasons why the -// executable file might be covered by the GNU General Public License. - -#ifndef MLN_FUN_STAT_ALL_HH -# define MLN_FUN_STAT_ALL_HH - -/// \file -/// -/// File that includes all statistical functions. - - -namespace mln -{ - - namespace fun - { - - /// \brief Namespace of statistical functions. - /// - /// \ingroup modfun - namespace stat {} - - } -} - - -# include <mln/fun/stat/mahalanobis.hh> - - -#endif // ! MLN_FUN_STAT_ALL_HH diff --git a/milena/mln/fun/v2i/all.hh b/milena/mln/fun/v2i/all.hh deleted file mode 100644 index 8ae635b..0000000 --- a/milena/mln/fun/v2i/all.hh +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of Olena. -// -// Olena is free software: you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation, version 2 of the License. -// -// Olena is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Olena. If not, see <http://www.gnu.org/licenses/>. -// -// As a special exception, you may use this file as part of a free -// software project without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to produce -// an executable, this file does not by itself cause the resulting -// executable to be covered by the GNU General Public License. This -// exception does not however invalidate any other reasons why the -// executable file might be covered by the GNU General Public License. - -#ifndef MLN_FUN_V2I_ALL_HH -# define MLN_FUN_V2I_ALL_HH - -/// \file -/// -/// \brief File that includes all value-to-integer functions. - - -namespace mln -{ - - /// Namespace of functions. - namespace fun - { - - /// \brief Namespace of value-to-integer functions. - /// - /// \ingroup modfun - // - namespace v2i - {} - - } -} - - -# include <mln/fun/v2i/index_of_value.hh> - - -#endif // ! MLN_FUN_V2I_ALL_HH diff --git a/milena/mln/fun/i2v/all_to.hh b/milena/mln/fun/v2v/all_to.hh similarity index 79% rename from milena/mln/fun/i2v/all_to.hh rename to milena/mln/fun/v2v/all_to.hh index e05cd57..d9e7569 100644 --- a/milena/mln/fun/i2v/all_to.hh +++ b/milena/mln/fun/v2v/all_to.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2007, 2009, 2013 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -23,12 +24,12 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_I2V_ALL_TO_HH -# define MLN_FUN_I2V_ALL_TO_HH +#ifndef MLN_FUN_V2V_ALL_TO_HH +# define MLN_FUN_V2V_ALL_TO_HH /// \file /// -/// FIXME. +/// Function always returning the same value. # include <mln/core/concept/function.hh> @@ -39,9 +40,13 @@ namespace mln namespace fun { - namespace i2v + namespace v2v { + /*! \brief Function always returning the same value. + + \ingroup funv2v + */ template <typename T> struct all_to : public Function_v2v< all_to<T> > { @@ -53,12 +58,12 @@ namespace mln T t_; }; - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun template <typename T> - fun::i2v::all_to<T> all_to(T t); + fun::v2v::all_to<T> all_to(T t); # ifndef MLN_INCLUDE_ONLY @@ -66,7 +71,7 @@ namespace mln namespace fun { - namespace i2v + namespace v2v { template <typename T> @@ -85,15 +90,15 @@ namespace mln return t_; } - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun template <typename T> inline - fun::i2v::all_to<T> all_to(T t) + fun::v2v::all_to<T> all_to(T t) { - fun::i2v::all_to<T> tmp(t); + fun::v2v::all_to<T> tmp(t); return tmp; } @@ -102,4 +107,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_FUN_I2V_ALL_TO_HH +#endif // ! MLN_FUN_V2V_ALL_TO_HH diff --git a/milena/mln/fun/i2v/array.hh b/milena/mln/fun/v2v/array.hh similarity index 84% rename from milena/mln/fun/i2v/array.hh rename to milena/mln/fun/v2v/array.hh index 8f7168f..1707f4e 100644 --- a/milena/mln/fun/i2v/array.hh +++ b/milena/mln/fun/v2v/array.hh @@ -24,8 +24,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_I2V_ARRAY_HH -# define MLN_FUN_I2V_ARRAY_HH +#ifndef MLN_FUN_V2V_ARRAY_HH +# define MLN_FUN_V2V_ARRAY_HH /// \file /// @@ -37,6 +37,7 @@ # include <mln/util/array.hh> # include <mln/metal/equal.hh> # include <mln/tag/init.hh> +# include <mln/convert/to.hh> # include <mln/fun/internal/selector.hh> @@ -45,9 +46,9 @@ namespace mln /// Forward declaration. namespace fun { - namespace i2v { + namespace v2v { template <typename T> class array; - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun namespace util { @@ -58,9 +59,13 @@ namespace mln namespace fun { - namespace i2v + namespace v2v { + /*! \brief Function mapping an id to a value. + + \ingroup funv2v + */ template <typename T> class array : public fun::internal::selector_from_result_<T, array<T> >::ret @@ -124,21 +129,24 @@ namespace mln }; - /// Operator<<. + /*! + \brief Operator<<. + \relates fun::v2v::array + */ template <typename T> std::ostream& operator<<(std::ostream& ostr, const array<T>& a); /*! - \brief Conversion: fun::i2v::array -> util::array + \brief Conversion: fun::v2v::array -> util::array \ingroup fromto */ template <typename T1, typename T2> void - from_to_(const fun::i2v::array<T1>& from, util::array<T2>& to); + from_to_(const fun::v2v::array<T1>& from, util::array<T2>& to); - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun @@ -149,22 +157,22 @@ namespace std { /*! - \brief Conversion: std::vectorfun::i2v::array<T> -> fun::i2v::array<T> + \brief Conversion: std::vectorfun::v2v::array<T> -> fun::v2v::array<T> \ingroup fromto */ template <typename T> inline void - from_to_(const vector<T>& from, mln::fun::i2v::array<T>& to); + from_to_(const vector<T>& from, mln::fun::v2v::array<T>& to); /*! - \brief Conversion: std::vector<T> -> mln::fun::i2v::array<U> + \brief Conversion: std::vector<T> -> mln::fun::v2v::array<U> \ingroup fromto */ template <typename T, typename U> inline void - from_to_(const vector<T>& from, mln::fun::i2v::array<U>& to); + from_to_(const vector<T>& from, mln::fun::v2v::array<U>& to); } // end of namespace std @@ -178,19 +186,19 @@ namespace mln template <typename T1, typename T2> void init_(tag::function_t, - fun::i2v::array<T1>& f, - const fun::i2v::array<T2>& model) + fun::v2v::array<T1>& f, + const fun::v2v::array<T2>& model) { f.init_(model.size()); } - /// fun::i2v::array + /// fun::v2v::array namespace fun { - namespace i2v + namespace v2v { template <typename T> @@ -332,19 +340,19 @@ namespace mln to.resize(from.size()); for (unsigned i = 0; i < from.size(); ++i) - to[i] = convert::to<T2>(from(i)); + to[i] = mln::convert::to<T2>(from(i)); } - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun template <typename T> inline - fun::i2v::array<T> array(unsigned n, const T& t) + fun::v2v::array<T> array(unsigned n, const T& t) { - fun::i2v::array<T> tmp(n, t); + fun::v2v::array<T> tmp(n, t); return tmp; } @@ -356,15 +364,15 @@ namespace std template <typename T> inline void - from_to_(const vector<T>& from, mln::fun::i2v::array<T>& to) + from_to_(const vector<T>& from, mln::fun::v2v::array<T>& to) { - to = mln::fun::i2v::array<T>(from); + to = mln::fun::v2v::array<T>(from); } template <typename T, typename U> inline void - from_to_(const vector<T>& from, mln::fun::i2v::array<U>& to) + from_to_(const vector<T>& from, mln::fun::v2v::array<U>& to) { to.resize(from.nelements()); for (unsigned i = 0; i < from.size(); ++i) @@ -375,4 +383,4 @@ namespace std # endif // ! MLN_INCLUDE_ONLY -#endif // ! MLN_FUN_I2V_ARRAY_HH +#endif // ! MLN_FUN_V2V_ARRAY_HH diff --git a/milena/mln/fun/v2i/index_of_value.hh b/milena/mln/fun/v2v/index_of_value.hh similarity index 87% rename from milena/mln/fun/v2i/index_of_value.hh rename to milena/mln/fun/v2v/index_of_value.hh index 816d3e5..b128302 100644 --- a/milena/mln/fun/v2i/index_of_value.hh +++ b/milena/mln/fun/v2v/index_of_value.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -23,8 +24,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_V2I_INDEX_OF_VALUE_HH -# define MLN_FUN_V2I_INDEX_OF_VALUE_HH +#ifndef MLN_FUN_V2V_INDEX_OF_VALUE_HH +# define MLN_FUN_V2V_INDEX_OF_VALUE_HH /// \file /// @@ -40,9 +41,13 @@ namespace mln namespace fun { - namespace v2i + namespace v2v { + /*! File that define a function that gives an index per value. + + \ingroup funv2v + */ template <typename T> struct index_of_value : Function_v2v< index_of_value<T> >, private metal::bool_<(mln_dim(T) == 1)>::check_t @@ -90,10 +95,10 @@ namespace mln # endif // ! MLN_INCLUDE_ONLY - } // end of namespace mln::fun::v2i + } // end of namespace mln::fun::v2v } // end of namespace mln::fun } // end of namespace mln -#endif // ! MLN_FUN_V2I_INDEX_OF_VALUE_HH +#endif // ! MLN_FUN_V2V_INDEX_OF_VALUE_HH diff --git a/milena/mln/fun/stat/mahalanobis.hh b/milena/mln/fun/v2v/mahalanobis.hh similarity index 65% rename from milena/mln/fun/stat/mahalanobis.hh rename to milena/mln/fun/v2v/mahalanobis.hh index bdd0d18..46ff33c 100644 --- a/milena/mln/fun/stat/mahalanobis.hh +++ b/milena/mln/fun/v2v/mahalanobis.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -23,8 +24,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_STAT_MAHALANOBIS_HH -# define MLN_FUN_STAT_MAHALANOBIS_HH +#ifndef MLN_FUN_V2V_MAHALANOBIS_HH +# define MLN_FUN_V2V_MAHALANOBIS_HH /// \file /// @@ -42,67 +43,67 @@ namespace mln namespace fun { - namespace stat + namespace v2v { - template <typename V> + template <typename V, typename R = float> struct mahalanobis - : public Function_v2v< mahalanobis<V> >, - private metal::equal< V, algebra::vec<V::dim,float> >::check_t + : public Function_v2v< mahalanobis<V,R> >, + private metal::equal< V, algebra::vec<V::dim,R> >::check_t { enum { n = V::dim }; - typedef float result; + typedef R result; - mahalanobis(const algebra::mat<n,n,float>& var, - const algebra::vec<n,float>& mean); + mahalanobis(const algebra::mat<n,n,R>& var, + const algebra::vec<n,R>& mean); // Tech. note: using n (instead of V::dim) above helps g++-2.95. - float operator()(const V& v) const; + R operator()(const V& v) const; - typedef algebra::vec<n,float> mean_t; + typedef algebra::vec<n,R> mean_t; mean_t mean() const; protected: - algebra::mat<n,n,float> var_1_; - algebra::vec<n,float> mean_; + algebra::mat<n,n,R> var_1_; + algebra::vec<n,R> mean_; }; # ifndef MLN_INCLUDE_ONLY - template <typename V> + template <typename V, typename R> inline - mahalanobis<V>::mahalanobis(const algebra::mat<n,n,float>& var, - const algebra::vec<n,float>& mean) + mahalanobis<V,R>::mahalanobis(const algebra::mat<n,n,R>& var, + const algebra::vec<n,R>& mean) { var_1_ = var._1(); mean_ = mean; } - template <typename V> + template <typename V, typename R> inline - float - mahalanobis<V>::operator()(const V& v) const + R + mahalanobis<V,R>::operator()(const V& v) const { return std::sqrt((v - mean_).t() * var_1_ * (v - mean_)); } - template <typename V> + template <typename V, typename R> inline - typename mahalanobis<V>::mean_t - mahalanobis<V>::mean() const + typename mahalanobis<V,R>::mean_t + mahalanobis<V,R>::mean() const { return mean_; } # endif // ! MLN_INCLUDE_ONLY - } // end of namespace mln::fun::stat + } // end of namespace mln::fun::v2v } // end of namespace mln::fun } // end of namespace mln -#endif // ! MLN_FUN_STAT_MAHALANOBIS_HH +#endif // ! MLN_FUN_V2V_MAHALANOBIS_HH diff --git a/milena/mln/fun/i2v/value_at_index.hh b/milena/mln/fun/v2v/value_at_index.hh similarity index 85% rename from milena/mln/fun/i2v/value_at_index.hh rename to milena/mln/fun/v2v/value_at_index.hh index cef3453..90470ce 100644 --- a/milena/mln/fun/i2v/value_at_index.hh +++ b/milena/mln/fun/v2v/value_at_index.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -23,8 +24,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_I2V_VALUE_AT_INDEX_HH -# define MLN_FUN_I2V_VALUE_AT_INDEX_HH +#ifndef MLN_FUN_V2V_VALUE_AT_INDEX_HH +# define MLN_FUN_V2V_VALUE_AT_INDEX_HH /// \file /// @@ -40,9 +41,14 @@ namespace mln namespace fun { - namespace i2v + namespace v2v { + /*! \brief File that define a function that gives an index per + value. + + \ingroup funv2v + */ template <typename T> struct value_at_index : Function_v2v< value_at_index<T> >, private metal::bool_<(mln_dim(T) == 1)>::check_t @@ -79,10 +85,10 @@ namespace mln # endif // ! MLN_INCLUDE_ONLY - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun } // end of namespace mln -#endif // ! MLN_FUN_I2V_VALUE_AT_INDEX_HH +#endif // ! MLN_FUN_V2V_VALUE_AT_INDEX_HH diff --git a/milena/mln/fun/x2x/translation.hh b/milena/mln/fun/x2x/translation.hh index 39587a3..0c58e46 100644 --- a/milena/mln/fun/x2x/translation.hh +++ b/milena/mln/fun/x2x/translation.hh @@ -34,7 +34,7 @@ # include <mln/fun/internal/x2x_linear_impl.hh> # include <mln/algebra/vec.hh> # include <mln/algebra/h_mat.hh> -# include <mln/fun/i2v/all.hh> +# include <mln/fun/v2v/all.hh> namespace mln diff --git a/milena/mln/histo/point_from_value.hh b/milena/mln/histo/point_from_value.hh index ea5b722..54fadd0 100644 --- a/milena/mln/histo/point_from_value.hh +++ b/milena/mln/histo/point_from_value.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -32,7 +33,7 @@ # include <mln/core/grids.hh> # include <mln/core/point.hh> -# include <mln/fun/v2i/index_of_value.hh> +# include <mln/fun/v2v/index_of_value.hh> # include <mln/fun/v2v/component.hh> # include <mln/trait/value/comp.hh> @@ -85,7 +86,7 @@ namespace mln template <typename T, typename P> static void run(const T& v, P& p) { - p[0] = fun::v2i::meta_index_of_value(v); + p[0] = fun::v2v::meta_index_of_value(v); } }; @@ -95,8 +96,8 @@ namespace mln template <typename T, typename P> static void run(const T& v, P& p) { - p[0] = fun::v2i::meta_index_of_value( fun::v2v::component<T,0>()(v) ); - p[1] = fun::v2i::meta_index_of_value( fun::v2v::component<T,1>()(v) ); + p[0] = fun::v2v::meta_index_of_value( fun::v2v::component<T,0>()(v) ); + p[1] = fun::v2v::meta_index_of_value( fun::v2v::component<T,1>()(v) ); } }; @@ -106,9 +107,9 @@ namespace mln template <typename T, typename P> static void run(const T& v, P& p) { - p[0] = fun::v2i::meta_index_of_value( fun::v2v::component<T,0>()(v) ); - p[1] = fun::v2i::meta_index_of_value( fun::v2v::component<T,1>()(v) ); - p[2] = fun::v2i::meta_index_of_value( fun::v2v::component<T,2>()(v) ); + p[0] = fun::v2v::meta_index_of_value( fun::v2v::component<T,0>()(v) ); + p[1] = fun::v2v::meta_index_of_value( fun::v2v::component<T,1>()(v) ); + p[2] = fun::v2v::meta_index_of_value( fun::v2v::component<T,2>()(v) ); } }; diff --git a/milena/mln/labeling/colorize.hh b/milena/mln/labeling/colorize.hh index 1e39e78..37e6e65 100644 --- a/milena/mln/labeling/colorize.hh +++ b/milena/mln/labeling/colorize.hh @@ -32,7 +32,7 @@ /// Fill an image with successive values. # include <mln/core/concept/image.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> # include <mln/value/rgb8.hh> # include <mln/literal/black.hh> # include <mln/data/transform.hh> @@ -211,7 +211,7 @@ namespace mln (void) value; unsigned label_count = value::next(nlabels); - static fun::i2v::array<V> f(0); + static fun::v2v::array<V> f(0); int diff_size = f.size() - label_count; if (diff_size < 0) { diff --git a/milena/mln/labeling/mean_values.hh b/milena/mln/labeling/mean_values.hh index 6bb4cd0..c154d3e 100644 --- a/milena/mln/labeling/mean_values.hh +++ b/milena/mln/labeling/mean_values.hh @@ -156,7 +156,7 @@ namespace mln m[0] = literal::yellow; //FIXME: handle label 0 correctly. mln_concrete(I) output = data::transform(lbl, - convert::to< fun::i2v::array<mln_value(I)> >(m)); + convert::to< fun::v2v::array<mln_value(I)> >(m)); return output; diff --git a/milena/mln/labeling/pack.hh b/milena/mln/labeling/pack.hh index 1f10ef8..15a5218 100644 --- a/milena/mln/labeling/pack.hh +++ b/milena/mln/labeling/pack.hh @@ -63,7 +63,7 @@ namespace mln template <typename I> mln_concrete(I) pack(const Image<I>& label, mln_value(I)& new_nlabels, - fun::i2v::array<mln_value(I)>& repack_fun); + fun::v2v::array<mln_value(I)>& repack_fun); /*! \overload @@ -93,7 +93,7 @@ namespace mln template <typename I> void pack_inplace(Image<I>& label, mln_value(I)& new_nlabels, - fun::i2v::array<mln_value(I)>& repack_fun); + fun::v2v::array<mln_value(I)>& repack_fun); /// \overload @@ -128,7 +128,7 @@ namespace mln mln_concrete(I) pack(const Image<I>& label, mln_value(I)& new_nlabels) { - fun::i2v::array<mln_value(I)> repack_fun; + fun::v2v::array<mln_value(I)> repack_fun; return pack(label, new_nlabels, repack_fun); } @@ -136,13 +136,13 @@ namespace mln template <typename I> mln_concrete(I) pack(const Image<I>& label, mln_value(I)& new_nlabels, - fun::i2v::array<mln_value(I)>& repack_fun) + fun::v2v::array<mln_value(I)>& repack_fun) { mln_trace("labeling::pack"); internal::pack_tests(label, new_nlabels); - fun::i2v::array<bool> + fun::v2v::array<bool> fv2b = data::compute(accu::meta::label_used(), label); mln_value(I) tmp_nlabels = fv2b.size() - 1; @@ -160,7 +160,7 @@ namespace mln void pack_inplace(Image<I>& label, mln_value(I)& new_nlabels) { - fun::i2v::array<mln_value(I)> repack_fun; + fun::v2v::array<mln_value(I)> repack_fun; pack_inplace(label, new_nlabels, repack_fun); } @@ -168,13 +168,13 @@ namespace mln template <typename I> void pack_inplace(Image<I>& label, mln_value(I)& new_nlabels, - fun::i2v::array<mln_value(I)>& repack_fun) + fun::v2v::array<mln_value(I)>& repack_fun) { mln_trace("labeling::pack_inplace"); internal::pack_tests(label, new_nlabels); - fun::i2v::array<bool> + fun::v2v::array<bool> fv2b = data::compute(accu::meta::label_used(), label); mln_value(I) tmp_nlabels = fv2b.size() - 1; diff --git a/milena/mln/labeling/relabel.hh b/milena/mln/labeling/relabel.hh index 1683e7d..37d6c8f 100644 --- a/milena/mln/labeling/relabel.hh +++ b/milena/mln/labeling/relabel.hh @@ -216,7 +216,7 @@ namespace mln internal::relabel_tests(label, nlabels, new_nlabels, fv2b); - typedef fun::i2v::array<mln_value(I)> fv2v_t; + typedef fun::v2v::array<mln_value(I)> fv2v_t; fv2v_t fv2v = make::relabelfun(fv2b, nlabels, new_nlabels); mln_concrete(I) output = labeling::relabel(label, new_nlabels, fv2v); @@ -253,7 +253,7 @@ namespace mln internal::relabel_inplace_tests(label, nlabels, fv2b); - typedef fun::i2v::array<mln_value(I)> fv2v_t; + typedef fun::v2v::array<mln_value(I)> fv2v_t; mln_value(I) tmp; fv2v_t fv2v = make::relabelfun(fv2b, nlabels, tmp); labeling::relabel_inplace(label, tmp, fv2v); diff --git a/milena/mln/make/edge_image.hh b/milena/mln/make/edge_image.hh index a1d2d70..b5ba40a 100644 --- a/milena/mln/make/edge_image.hh +++ b/milena/mln/make/edge_image.hh @@ -53,7 +53,7 @@ namespace mln // template <typename V, typename G> mln::edge_image<void,V,G> - edge_image(const Graph<G>& g, const fun::i2v::array<V>& fv); + edge_image(const Graph<G>& g, const fun::v2v::array<V>& fv); /// Construct an edge image. /// @@ -138,7 +138,7 @@ namespace mln template <typename V, typename G> inline mln::edge_image<void,V,G> - edge_image(const Graph<G>& g, const fun::i2v::array<V>& fv) + edge_image(const Graph<G>& g, const fun::v2v::array<V>& fv) { mln_trace("make::edge_image"); mln_precondition(exact(g).is_valid()); diff --git a/milena/mln/make/p_edges_with_mass_centers.hh b/milena/mln/make/p_edges_with_mass_centers.hh index a597d93..f692f6e 100644 --- a/milena/mln/make/p_edges_with_mass_centers.hh +++ b/milena/mln/make/p_edges_with_mass_centers.hh @@ -43,7 +43,7 @@ # include <mln/accu/center.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> # include <mln/util/site_pair.hh> @@ -67,7 +67,7 @@ namespace mln // template <typename W, typename G> inline - p_edges<G, fun::i2v::array<util::site_pair<mln_site(W)> > > + p_edges<G, fun::v2v::array<util::site_pair<mln_site(W)> > > p_edges_with_mass_centers(const Image<W>& wst_, const Graph<G>& g_); @@ -77,7 +77,7 @@ namespace mln template <typename W, typename G> inline - p_edges<G, fun::i2v::array<util::site_pair<mln_site(W)> > > + p_edges<G, fun::v2v::array<util::site_pair<mln_site(W)> > > p_edges_with_mass_centers(const Image<W>& wst_, const Graph<G>& g_) { @@ -95,7 +95,7 @@ namespace mln util::array<mln_vec(P)> mass_centers = labeling::compute(accu::center<P>(), wst, nbasins); - typedef fun::i2v::array< util::site_pair<P> > edge_sites_t; + typedef fun::v2v::array< util::site_pair<P> > edge_sites_t; edge_sites_t edge_sites(g.e_nmax()); mln_edge_iter(G) e(g); diff --git a/milena/mln/make/p_vertices_with_mass_centers.hh b/milena/mln/make/p_vertices_with_mass_centers.hh index ce6c089..25e122d 100644 --- a/milena/mln/make/p_vertices_with_mass_centers.hh +++ b/milena/mln/make/p_vertices_with_mass_centers.hh @@ -41,7 +41,7 @@ # include <mln/accu/center.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> namespace mln @@ -63,7 +63,7 @@ namespace mln // template <typename W, typename G> inline - p_vertices<G, fun::i2v::array<mln_site(W)> > + p_vertices<G, fun::v2v::array<mln_site(W)> > p_vertices_with_mass_centers(const Image<W>& wst_, const Graph<G>& g_); @@ -73,7 +73,7 @@ namespace mln template <typename W, typename G> inline - p_vertices<G, fun::i2v::array<mln_site(W)> > + p_vertices<G, fun::v2v::array<mln_site(W)> > p_vertices_with_mass_centers(const Image<W>& wst_, const Graph<G>& g_) { @@ -85,7 +85,7 @@ namespace mln mln_precondition(g.is_valid()); typedef mln_site(W) P; - typedef fun::i2v::array<P> vertex_sites_t; + typedef fun::v2v::array<P> vertex_sites_t; // nbasins does not include the background label. mln_value(W) nbasins = g.v_nmax() - 1; diff --git a/milena/mln/make/relabelfun.hh b/milena/mln/make/relabelfun.hh index dfc9608..834d6ba 100644 --- a/milena/mln/make/relabelfun.hh +++ b/milena/mln/make/relabelfun.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008, 2009, 2010 EPITA Research and Development +// Copyright (C) 2008, 2009, 2010, 2013 EPITA Research and Development // Laboratory (LRDE) // // This file is part of Olena. @@ -32,7 +32,7 @@ /// Routines to construct a function in order to relabel a labeled image. # include <mln/core/concept/function.hh> -# include <mln/fun/i2v/array.hh> +# include <mln/fun/v2v/array.hh> # include <mln/value/next.hh> namespace mln @@ -41,23 +41,23 @@ namespace mln namespace make { - /// Create a i2v function from a v2b function. + /// Create a v2v function from a v2b function. /// This function can be used to relabel a labeled image. /// /// \param[in] fv2b A v2b function. /// \param[in] nlabels The number of labels. /// \param[in] new_nlabels The number of labels after relabeling. /// - /// \return a i2v function. + /// \return a v2v function. /// /// \sa mln::labeling::relabel template <typename V, typename F> - fun::i2v::array<V> + fun::v2v::array<V> relabelfun(const Function_v2b<F>& fv2b, const V& nlabels, V& new_nlabels); - /// Create a i2v function from a v2v function. + /// Create a v2v function from a v2v function. /// This function can be used to relabel a labeled image. /// /// \param[in] fv2v A v2v function. This function maps an id to @@ -65,11 +65,11 @@ namespace mln /// \param[in] nlabels The number of labels. /// \param[in] new_nlabels The number of labels after relabeling. /// - /// \return a i2v function. + /// \return a v2v function. /// /// \sa mln::labeling::relabel template <typename V, typename F> - fun::i2v::array<V> + fun::v2v::array<V> relabelfun(const Function_v2v<F>& fv2v, const V& nlabels, V& new_nlabels); @@ -79,7 +79,7 @@ namespace mln template <typename V, typename F> inline - fun::i2v::array<V> + fun::v2v::array<V> relabelfun(const Function_v2b<F>& fv2b_, const V& nlabels, V& new_nlabels) @@ -90,18 +90,18 @@ namespace mln unsigned nlabels_i = value::next(nlabels); V tmp_nlabels = literal::zero; - fun::i2v::array<V> fi2v(nlabels_i, literal::zero); + fun::v2v::array<V> output(nlabels_i, literal::zero); for (V i = 1; i < nlabels_i; ++i) if (fv2b(i)) - fi2v(i) = ++tmp_nlabels; + output(i) = ++tmp_nlabels; new_nlabels = tmp_nlabels; - return fi2v; + return output; } template <typename V, typename F> inline - fun::i2v::array<V> + fun::v2v::array<V> relabelfun(const Function_v2v<F>& fv2v_, const V& nlabels, V& new_nlabels) @@ -115,8 +115,8 @@ namespace mln util::array<V> new_labels(nlabels_i, mln_max(V)); new_labels(0) = literal::zero; V tmp_nlabels = literal::zero; - fun::i2v::array<V> fi2v(nlabels_i, mln_max(V)); - fi2v(0) = literal::zero; + fun::v2v::array<V> output(nlabels_i, mln_max(V)); + fv2v(0) = literal::zero; for (V i = 1; i < nlabels_i; ++i) { @@ -124,13 +124,13 @@ namespace mln if (new_labels(fv2v(i)) == mln_max(V)) { new_labels(fv2v(i)) = ++tmp_nlabels; - fi2v(i) = tmp_nlabels; + output(i) = tmp_nlabels; } else - fi2v(i) = new_labels(fv2v(i)); + output(i) = new_labels(fv2v(i)); } new_nlabels = tmp_nlabels; - return fi2v; + return output; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/make/voronoi.hh b/milena/mln/make/voronoi.hh index ec4975f..953ffa2 100644 --- a/milena/mln/make/voronoi.hh +++ b/milena/mln/make/voronoi.hh @@ -55,7 +55,7 @@ namespace mln * \return The computed graph. */ template <typename I, typename N> - p_vertices<util::graph, fun::i2v::array<mln_site(I)> > + p_vertices<util::graph, fun::v2v::array<mln_site(I)> > voronoi (Image<I>& ima_, Image<I>& orig_, const Neighborhood<N>& nbh); @@ -64,7 +64,7 @@ namespace mln template <typename I, typename N> inline - p_vertices<util::graph, fun::i2v::array<mln_site(I)> > + p_vertices<util::graph, fun::v2v::array<mln_site(I)> > voronoi (Image<I>& ima_, Image<I>& orig_, const Neighborhood<N>& nbh) @@ -79,7 +79,7 @@ namespace mln V min, max; estim::min_max (ima, min, max); unsigned nb = max - min + 1; - fun::i2v::array<P> v(nb); + fun::v2v::array<P> v(nb); std::vector< accu::stat::mean< X > > tab_mean (nb); std::map<std::pair<V, V>, bool> m; @@ -124,7 +124,7 @@ namespace mln for (; it != m.end (); ++it) gr.add_edge((*it).first.first, (*it).first.second); - p_vertices<util::graph, fun::i2v::array<P> > res(gr, v); + p_vertices<util::graph, fun::v2v::array<P> > res(gr, v); return res; } diff --git a/milena/mln/metal/vec.hh b/milena/mln/metal/vec.hh index a129d68..b4b7291 100644 --- a/milena/mln/metal/vec.hh +++ b/milena/mln/metal/vec.hh @@ -39,7 +39,7 @@ # include <mln/trait/all.hh> # include <mln/trait/value_.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> # include <mln/debug/format.hh> # include <mln/value/ops.hh> diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh index 2ee1f09..ddcfa72 100644 --- a/milena/mln/morpho/line_gradient.hh +++ b/milena/mln/morpho/line_gradient.hh @@ -81,8 +81,8 @@ namespace mln // Vertices. image2d<unsigned> vpsite(ima.domain()); - fun::i2v::array<point2d> fv2p(ima.domain().nsites()); - fun::i2v::array<V> vertex_values(ima.domain().nsites()); + fun::v2v::array<point2d> fv2p(ima.domain().nsites()); + fun::v2v::array<V> vertex_values(ima.domain().nsites()); mln_fwd_piter(image2d<V>) p(ima.domain()); for_all (p) @@ -97,8 +97,8 @@ namespace mln // FIXME: The creation of this window should be generic. window2d next_c4_win; next_c4_win.insert(0, 1).insert(1, 0); - typedef fun::i2v::array<V> edge_values_t; - typedef fun::i2v::array< util::site_pair<point2d> > edge_sites_t; + typedef fun::v2v::array<V> edge_values_t; + typedef fun::v2v::array< util::site_pair<point2d> > edge_sites_t; edge_values_t edge_values; edge_sites_t edge_sites; mln_fwd_qiter_(window2d) q(next_c4_win, p); diff --git a/milena/mln/trait/ch_function_value.hh b/milena/mln/trait/ch_function_value.hh index 9a41ea9..fda72ce 100644 --- a/milena/mln/trait/ch_function_value.hh +++ b/milena/mln/trait/ch_function_value.hh @@ -44,7 +44,7 @@ namespace mln // Forward declarations. namespace trait { template <typename F, typename V> struct ch_function_value; } - namespace fun { namespace i2v { template <typename T> class array; } } + namespace fun { namespace v2v { template <typename T> class array; } } namespace trait @@ -61,9 +61,9 @@ namespace mln }; template <typename VF, typename V> - struct ch_function_value<fun::i2v::array<VF>, VF, V> + struct ch_function_value<fun::v2v::array<VF>, VF, V> { - typedef fun::i2v::array<V> ret; + typedef fun::v2v::array<V> ret; }; } // end of namespace mln::trait::impl diff --git a/milena/mln/util/array.hh b/milena/mln/util/array.hh index 4469806..bcd0ea3 100644 --- a/milena/mln/util/array.hh +++ b/milena/mln/util/array.hh @@ -51,7 +51,7 @@ namespace mln // Forward declarations. namespace fun { - namespace i2v { + namespace v2v { template <typename T> class array; } } @@ -144,7 +144,7 @@ namespace mln unsigned nelements() const; /// Return the number of elements of the array. - /// Added for compatibility with fun::i2v::array. + /// Added for compatibility with fun::v2v::array. /// \sa nelements unsigned size() const; @@ -217,22 +217,22 @@ namespace mln from_to_(const array<T1>& from, array<T2>& to); /*! - \brief Conversion: array<T> -> fun::i2v::array<T> + \brief Conversion: array<T> -> fun::v2v::array<T> \ingroup fromto */ template <typename T> inline void - from_to_(const array<T>& from, fun::i2v::array<T>& to); + from_to_(const array<T>& from, fun::v2v::array<T>& to); /*! - \brief Conversion: array<T> -> fun::i2v::array<U> + \brief Conversion: array<T> -> fun::v2v::array<U> \ingroup fromto */ template <typename T, typename U> inline void - from_to_(const array<T>& from, fun::i2v::array<U>& to); + from_to_(const array<T>& from, fun::v2v::array<U>& to); /*! \brief Conversion: util::array -> image1d. @@ -602,14 +602,14 @@ namespace mln template <typename T> void - from_to_(const array<T>& from, fun::i2v::array<T>& to) + from_to_(const array<T>& from, fun::v2v::array<T>& to) { - to = fun::i2v::array<T>(from); + to = fun::v2v::array<T>(from); } template <typename T, typename U> void - from_to_(const array<T>& from, fun::i2v::array<U>& to) + from_to_(const array<T>& from, fun::v2v::array<U>& to) { to.resize(from.nelements()); for (unsigned i = 0; i < from.nelements(); ++i) diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh index a3eda5b..57d7340 100644 --- a/milena/mln/value/lut_vec.hh +++ b/milena/mln/value/lut_vec.hh @@ -45,9 +45,9 @@ namespace mln /// Forward declarations. namespace fun { - namespace i2v { + namespace v2v { template <typename T> class array; - } // end of namespace mln::fun::i2v + } // end of namespace mln::fun::v2v } // end of namespace mln::fun namespace util{ template <typename T> class array; @@ -100,9 +100,9 @@ namespace mln template <typename F> lut_vec(const S& vset, const Function_v2v<F>& f); - /// Constructor from a value set and any fun::i2v::array. + /// Constructor from a value set and any fun::v2v::array. template <typename V> - lut_vec(const S& vset, const Function_v2v< fun::i2v::array<V> >& f); + lut_vec(const S& vset, const Function_v2v< fun::v2v::array<V> >& f); /// Constructor from a value set and any util::array. template <typename V> @@ -159,10 +159,10 @@ namespace mln template <typename S, typename T> template <typename V> inline - lut_vec<S,T>::lut_vec(const S& vset, const Function_v2v< fun::i2v::array<V> >& f) + lut_vec<S,T>::lut_vec(const S& vset, const Function_v2v< fun::v2v::array<V> >& f) : vset_(vset) { - const fun::i2v::array<V>& f_ = exact(f); + const fun::v2v::array<V>& f_ = exact(f); n_ = f_.size(); vec_ = f_.std_vector(); } diff --git a/milena/mln/win/ball.hh b/milena/mln/win/ball.hh index 5a1acd7..64ef6dc 100644 --- a/milena/mln/win/ball.hh +++ b/milena/mln/win/ball.hh @@ -33,7 +33,7 @@ # include <mln/core/internal/classical_window_base.hh> # include <mln/core/dpoint.hh> # include <mln/core/site_set/box.hh> -# include <mln/fun/i2v/all_to.hh> +# include <mln/fun/v2v/all_to.hh> namespace mln diff --git a/milena/tests/algebra/h_mat.cc b/milena/tests/algebra/h_mat.cc index 7a30f6b..4ee72a5 100644 --- a/milena/tests/algebra/h_mat.cc +++ b/milena/tests/algebra/h_mat.cc @@ -24,7 +24,7 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> #include <mln/algebra/mat.hh> #include <mln/algebra/h_mat.hh> #include <mln/make/h_mat.hh> diff --git a/milena/tests/algebra/mat.cc b/milena/tests/algebra/mat.cc index 8250b1f..3174f2e 100644 --- a/milena/tests/algebra/mat.cc +++ b/milena/tests/algebra/mat.cc @@ -24,7 +24,7 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> #include <mln/algebra/mat.hh> diff --git a/milena/tests/algebra/vec2.cc b/milena/tests/algebra/vec2.cc index d03dfe7..72f80b4 100644 --- a/milena/tests/algebra/vec2.cc +++ b/milena/tests/algebra/vec2.cc @@ -24,7 +24,7 @@ // executable file might be covered by the GNU General Public License. #include <iostream> -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> #include <mln/algebra/vec.hh> #include <mln/algebra/h_vec.hh> diff --git a/milena/tests/core/image/edge_image.cc b/milena/tests/core/image/edge_image.cc index 0e28126..ee6ff10 100644 --- a/milena/tests/core/image/edge_image.cc +++ b/milena/tests/core/image/edge_image.cc @@ -33,7 +33,7 @@ #include <mln/core/image/image2d.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> @@ -81,7 +81,7 @@ int main() attached to a vertex graph (image) rather than building them manually. */ typedef util::site_pair<point2d> site_t; - typedef fun::i2v::array<site_t> fsite_t; + typedef fun::v2v::array<site_t> fsite_t; fsite_t sites(5); sites(0) = site_t(point2d(0,0), point2d(2,2)); // Site associated to edge 0. sites(1) = site_t(point2d(2,2), point2d(0,4)); // Site associated to edge 1. @@ -94,7 +94,7 @@ int main() `-------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/core/image/graph_image.cc b/milena/tests/core/image/graph_image.cc index f27969d..7a6d7ad 100644 --- a/milena/tests/core/image/graph_image.cc +++ b/milena/tests/core/image/graph_image.cc @@ -32,7 +32,7 @@ #include <mln/core/neighb.hh> #include <mln/core/var.hh> #include <mln/accu/shape/bbox.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> #include <mln/debug/draw_graph.hh> #include <mln/debug/println.hh> @@ -79,7 +79,7 @@ int main() `--------*/ // Points associated to vertices. - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t sites(5); sites(0) = point2d(0,0); // Point associated to vertex 0. sites(1) = point2d(2,2); // Point associated to vertex 1. @@ -114,7 +114,7 @@ int main() `-------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(pv.nsites()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/core/image/imorph/labeled_image.cc b/milena/tests/core/image/imorph/labeled_image.cc index 627c38a..e4eec47 100644 --- a/milena/tests/core/image/imorph/labeled_image.cc +++ b/milena/tests/core/image/imorph/labeled_image.cc @@ -97,7 +97,7 @@ int main() mln_assertion(lbl_i.nlabels() == 9); test_image(lbl_i, bboxes_1); - fun::i2v::array<label_8> f(10, 0); + fun::v2v::array<label_8> f(10, 0); f(0) = 0; f(1) = 1; f(5) = 2; diff --git a/milena/tests/core/image/line_graph_image.cc b/milena/tests/core/image/line_graph_image.cc index d5a35b1..37f5ba2 100644 --- a/milena/tests/core/image/line_graph_image.cc +++ b/milena/tests/core/image/line_graph_image.cc @@ -38,7 +38,7 @@ #include <mln/util/graph.hh> #include <mln/util/line_graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/vertex_image.hh> #include <mln/make/vertex_image.hh> @@ -84,7 +84,7 @@ int main() attached to a vertex graph (image) rather than building them manually. */ typedef util::site_pair<point2d> site_t; - typedef fun::i2v::array<site_t> fsite_t; + typedef fun::v2v::array<site_t> fsite_t; fsite_t sites(5); sites(0) = site_t(point2d(0,0), point2d(2,2)); // Site associated to edge 0. sites(1) = site_t(point2d(2,2), point2d(0,4)); // Site associated to edge 1. @@ -101,7 +101,7 @@ int main() `-------------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/core/image/vertex_and_edge_image.cc b/milena/tests/core/image/vertex_and_edge_image.cc index 05aa059..dedf864 100644 --- a/milena/tests/core/image/vertex_and_edge_image.cc +++ b/milena/tests/core/image/vertex_and_edge_image.cc @@ -28,7 +28,7 @@ #include <mln/core/image/graph_elt_mixed_window.hh> #include <mln/core/image/vertex_image.hh> #include <mln/core/image/edge_image.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> @@ -72,7 +72,7 @@ int main() `--------*/ // Points associated to vertices. - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t sites(5); sites(0) = point2d(0,0); // Point associated to vertex 0. sites(1) = point2d(2,2); // Point associated to vertex 1. @@ -100,14 +100,14 @@ int main() `-------------*/ // Vertex values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; // Edge values. - typedef fun::i2v::array<unsigned> eiota_t; + typedef fun::v2v::array<unsigned> eiota_t; eiota_t eiota(g.e_nmax()); for (unsigned i = 0; i < eiota.size(); ++i) eiota(i) = 20 + i; diff --git a/milena/tests/core/image/vertex_image.cc b/milena/tests/core/image/vertex_image.cc index 9f00e5a..e8f7886 100644 --- a/milena/tests/core/image/vertex_image.cc +++ b/milena/tests/core/image/vertex_image.cc @@ -29,7 +29,7 @@ #include <mln/make/vertex_image.hh> #include <mln/core/image/image2d.hh> #include <mln/accu/shape/bbox.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> #include <mln/debug/draw_graph.hh> @@ -76,7 +76,7 @@ int main() `--------*/ // Points associated to vertices. - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t sites(5); sites(0) = point2d(0,0); // Point associated to vertex 0. sites(1) = point2d(2,2); // Point associated to vertex 1. @@ -104,7 +104,7 @@ int main() `-------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/core/other/graph_elt_neighborhood.cc b/milena/tests/core/other/graph_elt_neighborhood.cc index 356fc4a..afe899e 100644 --- a/milena/tests/core/other/graph_elt_neighborhood.cc +++ b/milena/tests/core/other/graph_elt_neighborhood.cc @@ -31,7 +31,7 @@ #include <mln/core/alias/point2d.hh> #include <mln/core/site_set/p_vertices.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> #include <mln/core/image/graph_elt_neighborhood.hh> @@ -63,7 +63,7 @@ int main() */ // Points associated to vertices. - typedef fun::i2v::array<p_t> F; + typedef fun::v2v::array<p_t> F; F points(5); points(0) = point2d(0,0); // Point associated to vertex 0. points(1) = point2d(2,2); // Point associated to vertex 1. diff --git a/milena/tests/core/other/graph_elt_window.cc b/milena/tests/core/other/graph_elt_window.cc index 15a74d3..82326a8 100644 --- a/milena/tests/core/other/graph_elt_window.cc +++ b/milena/tests/core/other/graph_elt_window.cc @@ -31,7 +31,7 @@ #include <mln/core/alias/point2d.hh> #include <mln/core/image/graph_elt_window.hh> #include <mln/core/site_set/p_vertices.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> unsigned fwd_neighb[] = { 0, 2, 3 }; @@ -62,7 +62,7 @@ int main() */ // Points associated to vertices. - typedef fun::i2v::array<p_t> F; + typedef fun::v2v::array<p_t> F; F points(5); points(0) = point2d(0,0); // Point associated to vertex 0. points(1) = point2d(2,2); // Point associated to vertex 1. diff --git a/milena/tests/core/other/point_set_compatibility.cc b/milena/tests/core/other/point_set_compatibility.cc index ac73ab6..82ac6ee 100644 --- a/milena/tests/core/other/point_set_compatibility.cc +++ b/milena/tests/core/other/point_set_compatibility.cc @@ -26,7 +26,7 @@ #include <mln/core/alias/point2d.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/core/site_set/p_array.hh> #include <mln/core/site_set/p_set.hh> #include <mln/core/site_set/p_vertices.hh> @@ -45,7 +45,7 @@ int main() // Graph //Vertices - typedef fun::i2v::array<point2d> fpoint_t; + typedef fun::v2v::array<point2d> fpoint_t; fpoint_t points(5); points(0) = point2d(0,0); // Point associated to vertex 0. points(1) = point2d(2,2); // Point associated to vertex 1. diff --git a/milena/tests/core/site_set/p_vertices.cc b/milena/tests/core/site_set/p_vertices.cc index 1ca9a11..d036b4c 100644 --- a/milena/tests/core/site_set/p_vertices.cc +++ b/milena/tests/core/site_set/p_vertices.cc @@ -26,7 +26,7 @@ #include <mln/util/graph.hh> #include <mln/core/alias/point2d.hh> #include <mln/core/site_set/p_vertices.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> int main() @@ -50,7 +50,7 @@ int main() g.add_edge(2, 1); // Map vertices to sites. - typedef fun::i2v::array<point2d> F; + typedef fun::v2v::array<point2d> F; F f(6); for (unsigned i = 0; i < 6; ++i) f(i) = point2d(i, 0); diff --git a/milena/tests/draw/graph.cc b/milena/tests/draw/graph.cc index 845d318..e89fdb9 100644 --- a/milena/tests/draw/graph.cc +++ b/milena/tests/draw/graph.cc @@ -27,7 +27,7 @@ #include <vector> #include <utility> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/core/image/image2d.hh> #include <mln/core/alias/point2d.hh> #include <mln/debug/println.hh> @@ -60,7 +60,7 @@ void do_test(points_type& points, const edges_type& edges, g.add_edge(i->first, i->second); // Associate vertices to sites. - typedef fun::i2v::array<mln::point2d> F; + typedef fun::v2v::array<mln::point2d> F; F fpoints(points); mln::p_vertices<G, F> pg(g, fpoints); diff --git a/milena/tests/fun/Makefile.am b/milena/tests/fun/Makefile.am index 23e1db6..fab2efb 100644 --- a/milena/tests/fun/Makefile.am +++ b/milena/tests/fun/Makefile.am @@ -18,11 +18,10 @@ include $(top_srcdir)/milena/tests/tests.mk SUBDIRS = \ - i2v \ + v2v \ p2b \ p2p \ p2v \ - stat \ v2v \ vv2v \ x2x diff --git a/milena/tests/fun/i2v/Makefile.am b/milena/tests/fun/i2v/Makefile.am deleted file mode 100644 index d98b0fd..0000000 --- a/milena/tests/fun/i2v/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2007, 2009, 2010 EPITA Research and Development -# Laboratory (LRDE). -# -# This file is part of Olena. -# -# Olena is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, version 2 of the License. -# -# Olena is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Olena. If not, see <http://www.gnu.org/licenses/>. - -include $(top_srcdir)/milena/tests/tests.mk - -check_PROGRAMS = \ - all_to \ - array \ - value_at_index - - -TESTS = $(check_PROGRAMS) diff --git a/milena/tests/fun/stat/Makefile.am b/milena/tests/fun/stat/Makefile.am deleted file mode 100644 index f70b046..0000000 --- a/milena/tests/fun/stat/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) -# -# This file is part of Olena. -# -# Olena is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, version 2 of the License. -# -# Olena is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Olena. If not, see <http://www.gnu.org/licenses/>. - -include $(top_srcdir)/milena/tests/tests.mk - -check_PROGRAMS = \ - mahalanobis - - -TESTS = $(check_PROGRAMS) diff --git a/milena/tests/fun/v2i/Makefile.am b/milena/tests/fun/v2i/Makefile.am deleted file mode 100644 index 29de7e8..0000000 --- a/milena/tests/fun/v2i/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) -# -# This file is part of Olena. -# -# Olena is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, version 2 of the License. -# -# Olena is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Olena. If not, see <http://www.gnu.org/licenses/>. - -include $(top_srcdir)/milena/tests/tests.mk - -check_PROGRAMS = \ - index_of_value - - -TESTS = $(check_PROGRAMS) diff --git a/milena/tests/fun/v2v/Makefile.am b/milena/tests/fun/v2v/Makefile.am index 6a67c47..2d11afc 100644 --- a/milena/tests/fun/v2v/Makefile.am +++ b/milena/tests/fun/v2v/Makefile.am @@ -18,8 +18,13 @@ include $(top_srcdir)/milena/tests/tests.mk check_PROGRAMS = \ + all_to \ + array \ + index_of_value \ + mahalanobis \ norm \ projection \ + value_at_index \ wrap diff --git a/milena/tests/fun/i2v/all_to.cc b/milena/tests/fun/v2v/all_to.cc similarity index 95% rename from milena/tests/fun/i2v/all_to.cc rename to milena/tests/fun/v2v/all_to.cc index efc81c7..81c5b43 100644 --- a/milena/tests/fun/i2v/all_to.cc +++ b/milena/tests/fun/v2v/all_to.cc @@ -23,14 +23,14 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> int main() { using namespace mln; - fun::i2v::all_to<int> f(51); + fun::v2v::all_to<int> f(51); mln_assertion(f( 0) == 51); mln_assertion(f( 1) == 51); diff --git a/milena/tests/fun/i2v/array.cc b/milena/tests/fun/v2v/array.cc similarity index 96% rename from milena/tests/fun/i2v/array.cc rename to milena/tests/fun/v2v/array.cc index 2633b41..fbbc86e 100644 --- a/milena/tests/fun/i2v/array.cc +++ b/milena/tests/fun/v2v/array.cc @@ -23,14 +23,14 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> int main() { using namespace mln; - fun::i2v::array<int> f; + fun::v2v::array<int> f; mln_assertion(f.size() == 0u); f.append(0); diff --git a/milena/tests/fun/v2i/index_of_value.cc b/milena/tests/fun/v2v/index_of_value.cc similarity index 89% rename from milena/tests/fun/v2i/index_of_value.cc rename to milena/tests/fun/v2v/index_of_value.cc index ef3847a..78fcab5 100644 --- a/milena/tests/fun/v2i/index_of_value.cc +++ b/milena/tests/fun/v2v/index_of_value.cc @@ -23,7 +23,7 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/v2i/index_of_value.hh> +#include <mln/fun/v2v/index_of_value.hh> #include <mln/value/int_u8.hh> #include <mln/value/int_s8.hh> @@ -33,17 +33,17 @@ int main() using namespace mln; { - fun::v2i::index_of_value<bool> f; + fun::v2v::index_of_value<bool> f; mln_assertion(f(false) == 0); mln_assertion(f(true) == 1); } { - fun::v2i::index_of_value< value::int_u8 > f; + fun::v2v::index_of_value< value::int_u8 > f; mln_assertion(f( 0) == 0); mln_assertion(f(255) == 255); } { - fun::v2i::index_of_value< value::int_s8 > f; + fun::v2v::index_of_value< value::int_s8 > f; mln_assertion(f(-127) == 0); mln_assertion(f(+127) == 254); } diff --git a/milena/tests/fun/stat/mahalanobis.cc b/milena/tests/fun/v2v/mahalanobis.cc similarity index 94% rename from milena/tests/fun/stat/mahalanobis.cc rename to milena/tests/fun/v2v/mahalanobis.cc index 030f2cc..9f52be2 100644 --- a/milena/tests/fun/stat/mahalanobis.cc +++ b/milena/tests/fun/v2v/mahalanobis.cc @@ -25,7 +25,7 @@ #include <cstdlib> #include <mln/accu/stat/var.hh> -#include <mln/fun/stat/mahalanobis.hh> +#include <mln/fun/v2v/mahalanobis.hh> float my_rand(int c) @@ -49,12 +49,12 @@ int main() v[i][1] = my_rand(1); v[i][2] = my_rand(2); } - + accu::stat::var<vec3f> a; for (int i = 0; i < n; ++i) a.take(v[i]); - fun::stat::mahalanobis<vec3f> f(a.variance(), a.mean()); + fun::v2v::mahalanobis<vec3f> f(a.variance(), a.mean()); mln_assertion(f(a.mean()) == 0.f); float sum = 0.f; diff --git a/milena/tests/fun/i2v/value_at_index.cc b/milena/tests/fun/v2v/value_at_index.cc similarity index 89% rename from milena/tests/fun/i2v/value_at_index.cc rename to milena/tests/fun/v2v/value_at_index.cc index 533d011..239667f 100644 --- a/milena/tests/fun/i2v/value_at_index.cc +++ b/milena/tests/fun/v2v/value_at_index.cc @@ -23,7 +23,7 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/fun/i2v/value_at_index.hh> +#include <mln/fun/v2v/value_at_index.hh> #include <mln/value/int_u8.hh> #include <mln/value/int_s8.hh> @@ -33,17 +33,17 @@ int main() using namespace mln; { - fun::i2v::value_at_index<bool> f; + fun::v2v::value_at_index<bool> f; mln_assertion(f(0) == false); mln_assertion(f(1) == true); } { - fun::i2v::value_at_index< value::int_u8 > f; + fun::v2v::value_at_index< value::int_u8 > f; mln_assertion(f( 0) == 0); mln_assertion(f(255) == 255); } { - fun::i2v::value_at_index< value::int_s8 > f; + fun::v2v::value_at_index< value::int_s8 > f; mln_assertion(f( 0) == -127); mln_assertion(f(254) == +127); } diff --git a/milena/tests/fun/x2x/composed.cc b/milena/tests/fun/x2x/composed.cc index f07b302..e7f7f56 100644 --- a/milena/tests/fun/x2x/composed.cc +++ b/milena/tests/fun/x2x/composed.cc @@ -28,7 +28,7 @@ #include <mln/fun/x2x/translation.hh> #include <mln/fun/x2x/rotation.hh> #include <mln/fun/x2x/composed.hh> -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> int main() diff --git a/milena/tests/fun/x2x/translation.cc b/milena/tests/fun/x2x/translation.cc index a362f6f..492405b 100644 --- a/milena/tests/fun/x2x/translation.cc +++ b/milena/tests/fun/x2x/translation.cc @@ -26,7 +26,7 @@ #include <cmath> #include <iostream> #include <mln/fun/x2x/translation.hh> -#include <mln/fun/i2v/all_to.hh> +#include <mln/fun/v2v/all_to.hh> diff --git a/milena/tests/graph/labeling.cc b/milena/tests/graph/labeling.cc index 8b55b88..73365e6 100644 --- a/milena/tests/graph/labeling.cc +++ b/milena/tests/graph/labeling.cc @@ -34,7 +34,7 @@ #include <mln/value/label_8.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/graph/labeling.hh> #include <mln/graph/to_neighb.hh> @@ -76,7 +76,7 @@ int main() gr.add_edge(4,5); - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t fsite(6); fsite(0) = point2d(0,0); fsite(1) = point2d(2,2); diff --git a/milena/tests/make/p_edges_with_mass_centers.cc b/milena/tests/make/p_edges_with_mass_centers.cc index afb34e7..6f5586c 100644 --- a/milena/tests/make/p_edges_with_mass_centers.cc +++ b/milena/tests/make/p_edges_with_mass_centers.cc @@ -59,7 +59,7 @@ int main() g.add_edge(4,3); g.add_edge(4,2); - typedef p_edges<G,fun::i2v::array<util::site_pair<point2d> > > pe_t; + typedef p_edges<G,fun::v2v::array<util::site_pair<point2d> > > pe_t; pe_t pe = make::p_edges_with_mass_centers(wst, g); typedef util::site_pair<point2d> P; diff --git a/milena/tests/make/p_vertices_with_mass_centers.cc b/milena/tests/make/p_vertices_with_mass_centers.cc index cb30707..19237a4 100644 --- a/milena/tests/make/p_vertices_with_mass_centers.cc +++ b/milena/tests/make/p_vertices_with_mass_centers.cc @@ -57,7 +57,7 @@ int main() g.add_edge(4,3); g.add_edge(4,2); - typedef p_vertices<G,fun::i2v::array<point2d> > pv_t; + typedef p_vertices<G,fun::v2v::array<point2d> > pv_t; pv_t pv = make::p_vertices_with_mass_centers(wst, g); typedef p_array<point2d> arr_t; diff --git a/milena/tests/morpho/artificial_line_graph_image_wst.cc b/milena/tests/morpho/artificial_line_graph_image_wst.cc index 43887e0..7d5136e 100644 --- a/milena/tests/morpho/artificial_line_graph_image_wst.cc +++ b/milena/tests/morpho/artificial_line_graph_image_wst.cc @@ -52,7 +52,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> diff --git a/milena/tests/morpho/closing/area_on_vertices.cc b/milena/tests/morpho/closing/area_on_vertices.cc index 1213e0d..0e8ea7d 100644 --- a/milena/tests/morpho/closing/area_on_vertices.cc +++ b/milena/tests/morpho/closing/area_on_vertices.cc @@ -26,7 +26,7 @@ #include <mln/core/image/edge_image.hh> #include <mln/morpho/closing/area_on_vertices.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include "tests/data.hh" @@ -43,7 +43,7 @@ int main() gr.add_edge(1, 2); gr.add_edge(2 ,4); - fun::i2v::array<unsigned> f(5); + fun::v2v::array<unsigned> f(5); for (unsigned i = 0; i < 5; ++i) f(i) = 100 + i; typedef edge_image<void,unsigned> e_ima_t; diff --git a/milena/tests/morpho/graph_image_morpho.cc b/milena/tests/morpho/graph_image_morpho.cc index 821f396..00f1681 100644 --- a/milena/tests/morpho/graph_image_morpho.cc +++ b/milena/tests/morpho/graph_image_morpho.cc @@ -36,7 +36,7 @@ /// Required for graph images. #include <mln/core/image/vertex_image.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/graph.hh> #include <mln/make/vertex_image.hh> @@ -67,7 +67,7 @@ int main() */ // Points associated to vertices. - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t sites(5); sites(0) = point2d(0,0); // Point associated to vertex 0. sites(1) = point2d(2,2); // Point associated to vertex 1. @@ -94,7 +94,7 @@ int main() `--------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/morpho/graph_image_wst.cc b/milena/tests/morpho/graph_image_wst.cc index 2fc5762..fb9ecff 100644 --- a/milena/tests/morpho/graph_image_wst.cc +++ b/milena/tests/morpho/graph_image_wst.cc @@ -30,7 +30,7 @@ #include <vector> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/core/alias/point2d.hh> #include <mln/core/image/vertex_image.hh> #include <mln/make/vertex_image.hh> @@ -60,7 +60,7 @@ int main() */ // Points associated to vertices. - typedef fun::i2v::array<point2d> fsite_t; + typedef fun::v2v::array<point2d> fsite_t; fsite_t sites(5); sites(0) = point2d(0,0); // Point associated to vertex 0. sites(1) = point2d(2,2); // Point associated to vertex 1. @@ -86,7 +86,7 @@ int main() `-------------*/ // Graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/morpho/lena_line_graph_image_wst1.cc b/milena/tests/morpho/lena_line_graph_image_wst1.cc index 38bd790..5aa8eb5 100644 --- a/milena/tests/morpho/lena_line_graph_image_wst1.cc +++ b/milena/tests/morpho/lena_line_graph_image_wst1.cc @@ -58,7 +58,7 @@ #include <mln/convert/to_window.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> @@ -122,8 +122,8 @@ int main() // Edges. window2d next_c4_win; next_c4_win.insert(0, 1).insert(1, 0); - typedef fun::i2v::array<int> edge_values_t; - typedef fun::i2v::array< util::site_pair<point2d> > edge_sites_t; + typedef fun::v2v::array<int> edge_values_t; + typedef fun::v2v::array< util::site_pair<point2d> > edge_sites_t; edge_values_t edge_values; edge_sites_t edge_sites; mln_fwd_qiter_(window2d) q(next_c4_win, p); diff --git a/milena/tests/morpho/lena_line_graph_image_wst2.cc b/milena/tests/morpho/lena_line_graph_image_wst2.cc index 1a4ba90..75d9e45 100644 --- a/milena/tests/morpho/lena_line_graph_image_wst2.cc +++ b/milena/tests/morpho/lena_line_graph_image_wst2.cc @@ -54,7 +54,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> diff --git a/milena/tests/morpho/line_graph_image_morpho.cc b/milena/tests/morpho/line_graph_image_morpho.cc index bfe6b34..b16f358 100644 --- a/milena/tests/morpho/line_graph_image_morpho.cc +++ b/milena/tests/morpho/line_graph_image_morpho.cc @@ -33,7 +33,7 @@ #include <mln/core/alias/point2d.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> @@ -78,7 +78,7 @@ int main() // Sites (points) associated to edges. typedef util::site_pair<point2d> P; - typedef fun::i2v::array<P> fsite_t; + typedef fun::v2v::array<P> fsite_t; fsite_t sites(5); sites(0) = P(point2d(0,0), point2d(2,2)); // Site associated to edge 0. sites(1) = P(point2d(2,2), point2d(0,4)); // Site associated to edge 1. @@ -91,7 +91,7 @@ int main() `-------------------*/ // Line graph values. - typedef fun::i2v::array<unsigned> viota_t; + typedef fun::v2v::array<unsigned> viota_t; viota_t iota(g.v_nmax()); for (unsigned i = 0; i < iota.size(); ++i) iota(i) = 10 + i; diff --git a/milena/tests/morpho/line_graph_image_wst.cc b/milena/tests/morpho/line_graph_image_wst.cc index 9f676ca..baf1850 100644 --- a/milena/tests/morpho/line_graph_image_wst.cc +++ b/milena/tests/morpho/line_graph_image_wst.cc @@ -31,7 +31,7 @@ #include <mln/core/alias/point2d.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/util/site_pair.hh> #include <mln/core/image/edge_image.hh> @@ -82,7 +82,7 @@ int main() // Sites associated to edges. typedef util::site_pair<point2d> P; - typedef fun::i2v::array<P> fsite_t; + typedef fun::v2v::array<P> fsite_t; fsite_t sites(10); sites(0) = P(point2d(0,0), point2d(0,1)); // Site associated to edge 0. sites(1) = P(point2d(0,1), point2d(0,2)); // Site associated to edge 1. @@ -96,7 +96,7 @@ int main() sites(9) = P(point2d(1,2), point2d(1,3)); // Site associated to edge 6. // Edge values. - typedef fun::i2v::array<unsigned> edge_values_t; + typedef fun::v2v::array<unsigned> edge_values_t; edge_values_t edge_values(10); static const unsigned values[] = { 0, 10, 5, 2, 4, 6, 0, 3, 5, 2 }; diff --git a/milena/tests/morpho/opening/area_on_vertices.cc b/milena/tests/morpho/opening/area_on_vertices.cc index 75a6bd5..7b2d70b 100644 --- a/milena/tests/morpho/opening/area_on_vertices.cc +++ b/milena/tests/morpho/opening/area_on_vertices.cc @@ -26,7 +26,7 @@ #include <mln/core/image/edge_image.hh> #include <mln/morpho/opening/area_on_vertices.hh> #include <mln/util/graph.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include "tests/data.hh" @@ -43,7 +43,7 @@ int main() gr.add_edge(1, 2); gr.add_edge(2 ,4); - fun::i2v::array<unsigned> f(5); + fun::v2v::array<unsigned> f(5); for (unsigned i = 0; i < 5; ++i) f(i) = 100 + i; typedef edge_image<void,unsigned> e_ima_t; diff --git a/milena/tests/pw/image.cc b/milena/tests/pw/image.cc index 52b08aa..59a7bb5 100644 --- a/milena/tests/pw/image.cc +++ b/milena/tests/pw/image.cc @@ -24,7 +24,7 @@ // executable file might be covered by the GNU General Public License. #include <mln/fun/p2b/chess.hh> -#include <mln/fun/i2v/array.hh> +#include <mln/fun/v2v/array.hh> #include <mln/core/alias/box2d.hh> #include <mln/core/site_set/p_array.hh> #include <mln/pw/image.hh> @@ -56,8 +56,8 @@ int main() { p_array<int> arr; // Sites are ints (why not?) arr.insert(51); // Site 51. - typedef pw::image<fun::i2v::array<int>, p_array<int> > ima_t; - ima_t ima = fun::i2v::array<int>(1) | arr; // An array psite converts to int so that works :-) + typedef pw::image<fun::v2v::array<int>, p_array<int> > ima_t; + ima_t ima = fun::v2v::array<int>(1) | arr; // An array psite converts to int so that works :-) // trait::image::print(ima); p_array<int>::psite p(ima.domain(), 0); // index 0 means the 1st element of arr diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk index c79f929..a98b5cf 100644 --- a/milena/tests/unit_test/unit-tests.mk +++ b/milena/tests/unit_test/unit-tests.mk @@ -574,11 +574,6 @@ mln_fun_component_green \ mln_fun_component_red \ mln_fun_component_rgb \ mln_fun_essential \ -mln_fun_i2v_all \ -mln_fun_i2v_all_to \ -mln_fun_i2v_array \ -mln_fun_i2v_essential \ -mln_fun_i2v_value_at_index \ mln_fun_internal_ch_function_value_impl \ mln_fun_internal_resolve \ mln_fun_internal_selector \ @@ -605,8 +600,6 @@ mln_fun_p2v_iota \ mln_fun_p2v_ternary \ mln_fun_param \ mln_fun_spe_unary \ -mln_fun_stat_all \ -mln_fun_stat_mahalanobis \ mln_fun_unary \ mln_fun_v2b_all \ mln_fun_v2b_always_false \ @@ -615,10 +608,10 @@ mln_fun_v2b_essential \ mln_fun_v2b_lnot \ mln_fun_v2b_threshold_ge \ mln_fun_v2b_threshold_le \ -mln_fun_v2i_all \ -mln_fun_v2i_index_of_value \ mln_fun_v2v_abs \ mln_fun_v2v_all \ +mln_fun_v2v_all_to \ +mln_fun_v2v_array \ mln_fun_v2v_cast \ mln_fun_v2v_ch_function_value \ mln_fun_v2v_component \ @@ -629,7 +622,9 @@ mln_fun_v2v_essential \ mln_fun_v2v_hsl_to_rgb \ mln_fun_v2v_id \ mln_fun_v2v_inc \ +mln_fun_v2v_index_of_value \ mln_fun_v2v_linear \ +mln_fun_v2v_mahalanobis \ mln_fun_v2v_norm \ mln_fun_v2v_projection \ mln_fun_v2v_qt_rgb_to_int_u \ @@ -640,6 +635,7 @@ mln_fun_v2v_rgb_to_luma \ mln_fun_v2v_round \ mln_fun_v2v_round_sat \ mln_fun_v2v_saturate \ +mln_fun_v2v_value_at_index \ mln_fun_v2v_wrap \ mln_fun_v2w2v_all \ mln_fun_v2w2v_cos \ diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc index 5efbcf9..b947aae 100644 --- a/milena/tools/area_flooding.cc +++ b/milena/tools/area_flooding.cc @@ -100,10 +100,10 @@ int main(int argc, char* argv[]) // Type of the function mapping graph edges and image sites. typedef util::site_pair<point2d> P; - typedef fun::i2v::array<P> fedge_site_t; + typedef fun::v2v::array<P> fedge_site_t; // Line graph image. - typedef fun::i2v::array<val_t> fval_t; + typedef fun::v2v::array<val_t> fval_t; fval_t values; typedef edge_image<P,val_t> lg_ima_t; lg_ima_t lg_ima = morpho::line_gradient(input); -- 1.7.2.5