3083: Fix compilation issues.

* mln/core/site_set/operators.hh: add missing forward declaration. * mln/linear/local/convolve.hh: update declaration. * mln/morpho/closing_area_on_vertices.hh: add a missing include. * mln/morpho/opening_area_on_vertices.hh: fix wrong declaration. * tests/core/site_set/p_array.cc, * tests/core/site_set/pset_if.cc: fix an assertion. * tests/linear/local/convolve.cc: update doc. * tests/unit_test/Makefile.am, * headers.mk: remove entries related to non commited files. * tests/unit_test/mln_core_routine_duplicate.cc, * tests/unit_test/mln_data_all.cc * tests/unit_test/mln_data_essential.cc: add new unit tests. --- milena/ChangeLog | 24 +++++++++ milena/headers.mk | 4 +- milena/mln/core/site_set/operators.hh | 2 + milena/mln/linear/local/convolve.hh | 50 ++++++++++--------- milena/mln/morpho/closing_area_on_vertices.hh | 1 + milena/mln/morpho/opening_area_on_vertices.hh | 7 ++- milena/tests/core/site_set/p_array.cc | 11 ++-- milena/tests/core/site_set/pset_if.cc | 4 +- milena/tests/linear/local/convolve.cc | 10 ++-- milena/tests/unit_test/Makefile.am | 6 -- .../tests/unit_test/mln_core_routine_duplicate.cc | 11 ++++ milena/tests/unit_test/mln_data_all.cc | 11 ++++ milena/tests/unit_test/mln_data_essential.cc | 11 ++++ 13 files changed, 103 insertions(+), 49 deletions(-) create mode 100644 milena/tests/unit_test/mln_core_routine_duplicate.cc create mode 100644 milena/tests/unit_test/mln_data_all.cc create mode 100644 milena/tests/unit_test/mln_data_essential.cc diff --git a/milena/ChangeLog b/milena/ChangeLog index 3f34834..32d2dcd 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,29 @@ 2008-12-22 Guillaume Lazzara <z@lrde.epita.fr> + Fix compilation issues. + + * mln/core/site_set/operators.hh: add missing forward declaration. + + * mln/linear/local/convolve.hh: update declaration. + + * mln/morpho/closing_area_on_vertices.hh: add a missing include. + + * mln/morpho/opening_area_on_vertices.hh: fix wrong declaration. + + * tests/core/site_set/p_array.cc, + * tests/core/site_set/pset_if.cc: fix an assertion. + + * tests/linear/local/convolve.cc: update doc. + + * tests/unit_test/Makefile.am, + * headers.mk: remove entries related to non commited files. + + * tests/unit_test/mln_core_routine_duplicate.cc, + * tests/unit_test/mln_data_all.cc + * tests/unit_test/mln_data_essential.cc: add new unit tests. + +2008-12-22 Guillaume Lazzara <z@lrde.epita.fr> + Add a dispatch in from_to. * headers.mk: add new headers to the distribution. diff --git a/milena/headers.mk b/milena/headers.mk index dd0aa62..24043ff 100644 --- a/milena/headers.mk +++ b/milena/headers.mk @@ -190,7 +190,6 @@ mln/fun/vv2v/min.hh \ mln/fun/vv2v/essential.hh \ mln/fun/internal/array_base.hh \ mln/fun/internal/x2x_linear_impl.hh \ -mln/fun/internal/ch_function_value_impl.hh \ mln/fun/internal/selector.hh \ mln/fun/v2w_w2v/norm.hh \ mln/fun/p2v/ternary.hh \ @@ -213,7 +212,6 @@ mln/fun/v2v/dec.hh \ mln/fun/v2v/abs.hh \ mln/fun/v2v/rgb_to_hsl.hh \ mln/fun/v2v/cast.hh \ -mln/fun/v2v/ch_function_value.hh \ mln/fun/v2v/rgb_to_hsi.hh \ mln/fun/v2v/enc.hh \ mln/fun/v2v/convert.hh \ @@ -442,7 +440,6 @@ mln/trait/value/essential.hh \ mln/trait/images.hh \ mln/trait/window/props.hh \ mln/trait/window/print.hh \ -mln/trait/ch_function_value.hh \ mln/trait/ch_value.hh \ mln/trait/solve.hh \ mln/trait/solve_unary.hh \ @@ -768,6 +765,7 @@ mln/core/routine/ops.hh \ mln/core/routine/all.hh \ mln/core/routine/exact.hh \ mln/core/routine/extend.hh \ +mln/core/routine/init.hxx \ mln/core/routine/essential.hh \ mln/core/trait/op_mult.hh \ mln/core/trait/all.hh \ diff --git a/milena/mln/core/site_set/operators.hh b/milena/mln/core/site_set/operators.hh index 45971c4..4c34368 100644 --- a/milena/mln/core/site_set/operators.hh +++ b/milena/mln/core/site_set/operators.hh @@ -44,7 +44,9 @@ namespace mln { + // Forward declarations. template <typename E> struct Box; + namespace set { template <typename S> unsigned card(const Site_Set<S>& s); } template <typename Sl, typename Sr> diff --git a/milena/mln/linear/local/convolve.hh b/milena/mln/linear/local/convolve.hh index 6bc2c12..522800a 100644 --- a/milena/mln/linear/local/convolve.hh +++ b/milena/mln/linear/local/convolve.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,13 +29,12 @@ #ifndef MLN_LINEAR_LOCAL_CONVOLVE_HH # define MLN_LINEAR_LOCAL_CONVOLVE_HH -/*! \file mln/linear/local/convolve.hh - * - * \brief Local convolution at a point. - */ +/// \file mln/linear/local/convolve.hh +/// +/// Local convolution at a point. # include <mln/core/concept/image.hh> -# include <mln/core/concept/point_site.hh> +# include <mln/core/concept/site.hh> # include <mln/core/concept/generalized_pixel.hh> # include <mln/core/concept/weighted_window.hh> # include <mln/metal/const.hh> @@ -61,9 +61,9 @@ namespace mln */ template <typename I, typename P, typename W, typename R> void convolve(const Image<I>& input, - const Point_Site<P>& p, + const Site<P>& p, const Weighted_Window<W>& w_win, - R& result); + R& result); /*! Local convolution around (generalized) pixel \p by the @@ -78,7 +78,7 @@ namespace mln template <typename P, typename W, typename R> void convolve(const Generalized_Pixel<P>& p, const Weighted_Window<W>& w_win, - R& result); + R& result); # ifndef MLN_INCLUDE_ONLY @@ -88,14 +88,15 @@ namespace mln template <typename I, typename P, typename W, typename R> inline - void convolve(trait::image::speed::any, const I& input, - const Point_Site<P>& p_, - const W& w_win, - R& result) + void convolve(trait::image::speed::any, + const I& input, + const Site<P>& p_, + const W& w_win, + R& result) { const P& p = exact(p_); - R tmp = 0; // FIXME: zero? + R tmp = literal::zero; // FIXME: zero? mln_qiter(W) q(w_win, p); for_all(q) if (input.has(q)) tmp += input(q) * q.w(); @@ -104,10 +105,11 @@ namespace mln template <typename I, typename P, typename W, typename R> inline - void convolve(trait::image::speed::fastest, const I& input, - const Point_Site<P>& p_, - const W& w_win, - R& result) + void convolve(trait::image::speed::fastest, + const I& input, + const Site<P>& p_, + const W& w_win, + R& result) { const P& p = exact(p_); @@ -125,7 +127,7 @@ namespace mln inline void convolve(const Generalized_Pixel<P>& p_, const W& w_win, - R& result) + R& result) { const P& p = mln::internal::force_exact<P>(p_); mln_precondition(p.ima().border() >= w_win.delta()); @@ -147,10 +149,10 @@ namespace mln template <typename I, typename P, typename W, typename R> inline - void convolve(const Image<I>& input, - const Point_Site<P>& p, - const Weighted_Window<W>& w_win, - R& result) + void convolve(const Image<I>& input, + const Site<P>& p, + const Weighted_Window<W>& w_win, + R& result) { mln_precondition(exact(input).has_data()); impl::convolve(mln_trait_image_speed(I)(), exact(input), @@ -161,7 +163,7 @@ namespace mln inline void convolve(const Generalized_Pixel<P>& p, const Weighted_Window<W>& w_win, - R& result) + R& result) { impl::convolve(p, exact(w_win), result); } diff --git a/milena/mln/morpho/closing_area_on_vertices.hh b/milena/mln/morpho/closing_area_on_vertices.hh index cfaf955..f05067c 100644 --- a/milena/mln/morpho/closing_area_on_vertices.hh +++ b/milena/mln/morpho/closing_area_on_vertices.hh @@ -34,6 +34,7 @@ /// Morphological area closing on a line graph image computing /// the area in terms of adjacent vertices. +# include <mln/pw/image.hh> # include <mln/core/site_set/p_edges.hh> # include <mln/morpho/closing_attribute.hh> # include <mln/accu/count_adjacent_vertices.hh> diff --git a/milena/mln/morpho/opening_area_on_vertices.hh b/milena/mln/morpho/opening_area_on_vertices.hh index 5b080e7..80c6053 100644 --- a/milena/mln/morpho/opening_area_on_vertices.hh +++ b/milena/mln/morpho/opening_area_on_vertices.hh @@ -35,6 +35,7 @@ /// the area in terms of adjacent vertices. # include <mln/pw/image.hh> +# include <mln/core/concept/neighborhood.hh> # include <mln/core/site_set/p_edges.hh> # include <mln/morpho/opening_attribute.hh> # include <mln/accu/count_adjacent_vertices.hh> @@ -58,9 +59,9 @@ namespace mln template <typename P2V, typename G, typename V2P, typename N> pw::image<P2V, p_edges<G, V2P> > - void opening_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, - const Neighborhood<N>& nbh, - unsigned lambda) + opening_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, + const Neighborhood<N>& nbh, + unsigned lambda) { trace::entering("morpho::opening_area_on_vertices"); diff --git a/milena/tests/core/site_set/p_array.cc b/milena/tests/core/site_set/p_array.cc index d0e07fd..0ba751f 100644 --- a/milena/tests/core/site_set/p_array.cc +++ b/milena/tests/core/site_set/p_array.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +25,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/site_set/p_array.cc - * - * \brief Tests on mln::p_array. - */ +/// \file tests/core/site_set/p_array.cc +/// +/// Tests on mln::p_array. #include <mln/core/alias/point2d.hh> #include <mln/core/site_set/p_array.hh> @@ -51,5 +50,5 @@ int main() mln_psite_(Arr) p(arr, 0); mln_assertion(p.to_site() == x); mln_assertion(p.row() == 5); - mln_assertion(point2d(p) == x); + mln_assertion(p == x); } diff --git a/milena/tests/core/site_set/pset_if.cc b/milena/tests/core/site_set/pset_if.cc index 1319848..cd57329 100644 --- a/milena/tests/core/site_set/pset_if.cc +++ b/milena/tests/core/site_set/pset_if.cc @@ -36,7 +36,7 @@ #include <mln/fun/p2b/chess.hh> #include <mln/convert/to_image.hh> #include <mln/convert/to_p_set.hh> -#include <mln/geom/nsites.hh> +#include <mln/set/card.hh> int main() @@ -44,7 +44,7 @@ int main() using namespace mln; box2d box_8x8 = make::box2d(8, 8); - mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess())) == 32); + mln_assertion(set::card((box_8x8 | fun::p2b::chess())) == 32); { p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess()); diff --git a/milena/tests/linear/local/convolve.cc b/milena/tests/linear/local/convolve.cc index 9f3e7e6..4da7d75 100644 --- a/milena/tests/linear/local/convolve.cc +++ b/milena/tests/linear/local/convolve.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/linear/local/convolve.cc - * - * \brief Tests on mln::linear::local::convolve. - */ +/// \file tests/linear/local/convolve.cc +/// +/// Tests on mln::linear::local::convolve. #include <mln/core/image/image2d.hh> #include <mln/value/int_u8.hh> diff --git a/milena/tests/unit_test/Makefile.am b/milena/tests/unit_test/Makefile.am index c8b4aa9..c8fc350 100644 --- a/milena/tests/unit_test/Makefile.am +++ b/milena/tests/unit_test/Makefile.am @@ -187,7 +187,6 @@ mln_fun_vv2v_min \ mln_fun_vv2v_essential \ mln_fun_internal_array_base \ mln_fun_internal_x2x_linear_impl \ -mln_fun_internal_ch_function_value_impl \ mln_fun_internal_selector \ mln_fun_v2w_w2v_norm \ mln_fun_p2v_ternary \ @@ -210,7 +209,6 @@ mln_fun_v2v_dec \ mln_fun_v2v_abs \ mln_fun_v2v_rgb_to_hsl \ mln_fun_v2v_cast \ -mln_fun_v2v_ch_function_value \ mln_fun_v2v_rgb_to_hsi \ mln_fun_v2v_enc \ mln_fun_v2v_convert \ @@ -436,7 +434,6 @@ mln_trait_value_essential \ mln_trait_images \ mln_trait_window_props \ mln_trait_window_print \ -mln_trait_ch_function_value \ mln_trait_ch_value \ mln_trait_solve \ mln_trait_solve_unary \ @@ -1196,7 +1193,6 @@ mln_fun_vv2v_min_SOURCES = mln_fun_vv2v_min.cc mln_fun_vv2v_essential_SOURCES = mln_fun_vv2v_essential.cc mln_fun_internal_array_base_SOURCES = mln_fun_internal_array_base.cc mln_fun_internal_x2x_linear_impl_SOURCES = mln_fun_internal_x2x_linear_impl.cc -mln_fun_internal_ch_function_value_impl_SOURCES = mln_fun_internal_ch_function_value_impl.cc mln_fun_internal_selector_SOURCES = mln_fun_internal_selector.cc mln_fun_v2w_w2v_norm_SOURCES = mln_fun_v2w_w2v_norm.cc mln_fun_p2v_ternary_SOURCES = mln_fun_p2v_ternary.cc @@ -1219,7 +1215,6 @@ mln_fun_v2v_dec_SOURCES = mln_fun_v2v_dec.cc mln_fun_v2v_abs_SOURCES = mln_fun_v2v_abs.cc mln_fun_v2v_rgb_to_hsl_SOURCES = mln_fun_v2v_rgb_to_hsl.cc mln_fun_v2v_cast_SOURCES = mln_fun_v2v_cast.cc -mln_fun_v2v_ch_function_value_SOURCES = mln_fun_v2v_ch_function_value.cc mln_fun_v2v_rgb_to_hsi_SOURCES = mln_fun_v2v_rgb_to_hsi.cc mln_fun_v2v_enc_SOURCES = mln_fun_v2v_enc.cc mln_fun_v2v_convert_SOURCES = mln_fun_v2v_convert.cc @@ -1445,7 +1440,6 @@ mln_trait_value_essential_SOURCES = mln_trait_value_essential.cc mln_trait_images_SOURCES = mln_trait_images.cc mln_trait_window_props_SOURCES = mln_trait_window_props.cc mln_trait_window_print_SOURCES = mln_trait_window_print.cc -mln_trait_ch_function_value_SOURCES = mln_trait_ch_function_value.cc mln_trait_ch_value_SOURCES = mln_trait_ch_value.cc mln_trait_solve_SOURCES = mln_trait_solve.cc mln_trait_solve_unary_SOURCES = mln_trait_solve_unary.cc diff --git a/milena/tests/unit_test/mln_core_routine_duplicate.cc b/milena/tests/unit_test/mln_core_routine_duplicate.cc new file mode 100644 index 0000000..d64acc2 --- /dev/null +++ b/milena/tests/unit_test/mln_core_routine_duplicate.cc @@ -0,0 +1,11 @@ +// Unit test for mln/core/routine/duplicate.hh. +// Generated by ./build_unit_test.sh, do not modify. + +// Include the file twice, so we detect missing inclusion guards. +#include <mln/core/routine/duplicate.hh> +#include <mln/core/routine/duplicate.hh> + +int main() +{ + // Nothing. +} diff --git a/milena/tests/unit_test/mln_data_all.cc b/milena/tests/unit_test/mln_data_all.cc new file mode 100644 index 0000000..04eff54 --- /dev/null +++ b/milena/tests/unit_test/mln_data_all.cc @@ -0,0 +1,11 @@ +// Unit test for mln/data/all.hh. +// Generated by ./build_unit_test.sh, do not modify. + +// Include the file twice, so we detect missing inclusion guards. +#include <mln/data/all.hh> +#include <mln/data/all.hh> + +int main() +{ + // Nothing. +} diff --git a/milena/tests/unit_test/mln_data_essential.cc b/milena/tests/unit_test/mln_data_essential.cc new file mode 100644 index 0000000..5acc28c --- /dev/null +++ b/milena/tests/unit_test/mln_data_essential.cc @@ -0,0 +1,11 @@ +// Unit test for mln/data/essential.hh. +// Generated by ./build_unit_test.sh, do not modify. + +// Include the file twice, so we detect missing inclusion guards. +#include <mln/data/essential.hh> +#include <mln/data/essential.hh> + +int main() +{ + // Nothing. +} -- 1.5.6.5
participants (1)
-
Guillaume Lazzara