3036: Fix many various tests.

* tests/morpho/hit_or_miss.cc, * mln/util/tree_to_image.hh, * mln/topo/internal/complex_iterator_base.hh, * mln/topo/internal/complex_relative_iterator_sequence.hh, * mln/topo/algebraic_face.hh, * mln/core/image/image2d.hh, * mln/core/image/image2d_h.hh, * mln/core/alias/complex_geometry.hh, * mln/accu/count_adjacent_vertices.hh: update comments. * tests/fun/x2x/rotation.cc, * mln/value/internal/convert.hh, * mln/topo/all.hh, * mln/morpho/opening_area_on_vertices.hh, * mln/registration/internal/rms.hh, * mln/morpho/erosion.hh, * mln/morpho/general.hh, * mln/morpho/general.spe.hh, * mln/morpho/closing_area_on_vertices.hh, * mln/debug/println_with_border.hh, * mln/fun/p2p/mirror.hh, * mln/core/site_set/attic/p_complex_faces_piter.hh, * mln/core/internal/neighb_niter_impl.hh, * mln/core/image/complex_neighborhood_piter.hh, * mln/convert/to.hh, * mln/accu/land_basic.hh, * mln/accu/lor.hh, * mln/accu/lor_basic.hh, * mln/binarization/includes.hh, * mln/border/get.hh, * mln/accu/land.hh: add missing/fix includes. * mln/canvas/browsing/depth_first_search.hh: use template parameter G instead of util::graph. * mln/convert/from_to.hh: add a new overload from_to() for conversion from a type T to itself. * mln/core/clock_neighb.hh: add a missing typedef window and win() member. * mln/core/image/hexa.hh: remove duplicate method has() and try to fix image properties. * mln/core/image/hexa_piter.hh: update attribute name. * mln/core/internal/piter_adaptor.hh: update change_target(); * mln/debug/iota.spe.hh: cleanup. * mln/debug/println.spe.hh: remove wrong ifndef. * mln/labeling/relabel.hh: fix infinite recursion. * mln/metal/has_neighborhood.hh: remove. Not needed anymore. * mln/morpho/hit_or_miss.hh: improve dispatch and fix a wrong precondition. * mln/morpho/line_gradient.hh: update with the new graph structure. * mln/subsampling/gaussian_subsampling.hh: add missing coma. * mln/topo/face_iter.hh, * mln/topo/internal/complex_set_iterator_base.hh, * mln/topo/internal/complex_relative_iterator_base.hh, * mln/topo/adj_lower_face_iter.hh, * mln/topo/adj_lower_higher_face_iter.hh, * mln/topo/adj_higher_face_iter.hh: add missing forward declarations. * mln/trait/neighborhood.hh: Fix wrong declaration order. * tests/morpho/complex_image_wst.cc, * tests/border/resize_image_if.cc, * tests/border/get.cc: fix test. * tests/border/resize_image3d_3.cc: write test. * tests/core/image/Makefile.am: enable hexa and image2d_h tests. * tests/core/image/hexa.cc, * tests/core/image/image2d_h.cc: make the test compile. * tests/labeling/relabel.cc: fix typo. * tests/unit_test/build_unit_test.sh: do not compile headers located in mln/concept/doc. --- milena/ChangeLog | 93 ++++++++ milena/mln/accu/count_adjacent_vertices.hh | 1 + milena/mln/accu/land.hh | 1 + milena/mln/accu/land_basic.hh | 1 + milena/mln/accu/lor.hh | 1 + milena/mln/accu/lor_basic.hh | 1 + milena/mln/binarization/includes.hh | 10 +- milena/mln/border/get.hh | 11 +- milena/mln/canvas/browsing/depth_first_search.hh | 9 +- milena/mln/convert/from_to.hh | 13 +- milena/mln/convert/to.hh | 1 + milena/mln/core/alias/complex_geometry.hh | 3 +- milena/mln/core/clock_neighb.hh | 35 +++- .../mln/core/image/complex_neighborhood_piter.hh | 4 +- milena/mln/core/image/hexa.hh | 35 +-- milena/mln/core/image/hexa_piter.hh | 36 ++-- milena/mln/core/image/image2d.hh | 2 +- milena/mln/core/image/image2d_h.hh | 12 +- milena/mln/core/internal/neighb_niter_impl.hh | 2 + milena/mln/core/internal/piter_adaptor.hh | 31 ++-- .../core/site_set/attic/p_complex_faces_piter.hh | 10 +- milena/mln/debug/iota.spe.hh | 20 +- milena/mln/debug/println.spe.hh | 49 +++-- milena/mln/debug/println_with_border.hh | 17 +- milena/mln/fun/p2p/mirror.hh | 7 + milena/mln/labeling/relabel.hh | 2 +- milena/mln/metal/has_neighborhood.hh | 53 ----- milena/mln/morpho/closing_area_on_vertices.hh | 15 +- milena/mln/morpho/erosion.hh | 2 +- milena/mln/morpho/general.hh | 8 +- milena/mln/morpho/general.spe.hh | 5 + milena/mln/morpho/hit_or_miss.hh | 239 ++++++++++++-------- milena/mln/morpho/line_gradient.hh | 71 +++--- milena/mln/morpho/opening_area_on_vertices.hh | 17 +- milena/mln/registration/internal/rms.hh | 1 + milena/mln/subsampling/gaussian_subsampling.hh | 2 +- milena/mln/topo/adj_higher_face_iter.hh | 13 +- milena/mln/topo/adj_lower_face_iter.hh | 19 ++- milena/mln/topo/adj_lower_higher_face_iter.hh | 15 +- milena/mln/topo/algebraic_face.hh | 14 +- milena/mln/topo/all.hh | 41 ++-- milena/mln/topo/face_iter.hh | 10 +- milena/mln/topo/internal/complex_iterator_base.hh | 8 +- .../internal/complex_relative_iterator_base.hh | 15 +- .../internal/complex_relative_iterator_sequence.hh | 5 +- .../mln/topo/internal/complex_set_iterator_base.hh | 13 +- milena/mln/trait/neighborhood.hh | 38 ++-- milena/mln/util/tree_to_image.hh | 47 ++-- milena/mln/value/internal/convert.hh | 11 +- milena/tests/border/get.cc | 14 +- milena/tests/border/resize_image3d_3.cc | 37 +-- milena/tests/border/resize_image_if.cc | 10 +- milena/tests/core/image/Makefile.am | 8 +- milena/tests/core/image/hexa.cc | 34 ++-- milena/tests/core/image/image2d_h.cc | 28 ++- milena/tests/fun/x2x/rotation.cc | 2 +- milena/tests/labeling/relabel.cc | 6 +- milena/tests/morpho/complex_image_wst.cc | 29 ++-- milena/tests/morpho/hit_or_miss.cc | 14 +- milena/tests/unit_test/build_unit_test.sh | 2 +- 60 files changed, 735 insertions(+), 518 deletions(-) delete mode 100644 milena/mln/metal/has_neighborhood.hh diff --git a/milena/ChangeLog b/milena/ChangeLog index 926ad95..0748651 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,96 @@ +2008-12-11 Guillaume Lazzara <z@lrde.epita.fr> + + Fix many various tests. + + * tests/morpho/hit_or_miss.cc, + * mln/util/tree_to_image.hh, + * mln/topo/internal/complex_iterator_base.hh, + * mln/topo/internal/complex_relative_iterator_sequence.hh, + * mln/topo/algebraic_face.hh, + * mln/core/image/image2d.hh, + * mln/core/image/image2d_h.hh, + * mln/core/alias/complex_geometry.hh, + * mln/accu/count_adjacent_vertices.hh: update comments. + + * tests/fun/x2x/rotation.cc, + * mln/value/internal/convert.hh, + * mln/topo/all.hh, + * mln/morpho/opening_area_on_vertices.hh, + * mln/registration/internal/rms.hh, + * mln/morpho/erosion.hh, + * mln/morpho/general.hh, + * mln/morpho/general.spe.hh, + * mln/morpho/closing_area_on_vertices.hh, + * mln/debug/println_with_border.hh, + * mln/fun/p2p/mirror.hh, + * mln/core/site_set/attic/p_complex_faces_piter.hh, + * mln/core/internal/neighb_niter_impl.hh, + * mln/core/image/complex_neighborhood_piter.hh, + * mln/convert/to.hh, + * mln/accu/land_basic.hh, + * mln/accu/lor.hh, + * mln/accu/lor_basic.hh, + * mln/binarization/includes.hh, + * mln/border/get.hh, + * mln/accu/land.hh: add missing/fix includes. + + * mln/canvas/browsing/depth_first_search.hh: use template parameter G + instead of util::graph. + + * mln/convert/from_to.hh: add a new overload from_to() for conversion + from a type T to itself. + + * mln/core/clock_neighb.hh: add a missing typedef window and win() + member. + + * mln/core/image/hexa.hh: remove duplicate method has() and try to fix + image properties. + + * mln/core/image/hexa_piter.hh: update attribute name. + + * mln/core/internal/piter_adaptor.hh: update change_target(); + + * mln/debug/iota.spe.hh: cleanup. + + * mln/debug/println.spe.hh: remove wrong ifndef. + + * mln/labeling/relabel.hh: fix infinite recursion. + + * mln/metal/has_neighborhood.hh: remove. Not needed anymore. + + + * mln/morpho/hit_or_miss.hh: improve dispatch and fix a wrong + precondition. + + * mln/morpho/line_gradient.hh: update with the new graph structure. + + * mln/subsampling/gaussian_subsampling.hh: add missing coma. + + * mln/topo/face_iter.hh, + * mln/topo/internal/complex_set_iterator_base.hh, + * mln/topo/internal/complex_relative_iterator_base.hh, + * mln/topo/adj_lower_face_iter.hh, + * mln/topo/adj_lower_higher_face_iter.hh, + * mln/topo/adj_higher_face_iter.hh: add missing forward declarations. + + * mln/trait/neighborhood.hh: Fix wrong declaration order. + + * tests/morpho/complex_image_wst.cc, + * tests/border/resize_image_if.cc, + * tests/border/get.cc: fix test. + + * tests/border/resize_image3d_3.cc: write test. + + * tests/core/image/Makefile.am: enable hexa and image2d_h tests. + + * tests/core/image/hexa.cc, + * tests/core/image/image2d_h.cc: make the test compile. + + * tests/labeling/relabel.cc: fix typo. + + * tests/unit_test/build_unit_test.sh: do not compile headers + located in mln/concept/doc. + 2008-12-12 Ugo Jardonnet <jardonnet@lrde.epita.fr> Strengthen unit_test. Beautify file generation. diff --git a/milena/mln/accu/count_adjacent_vertices.hh b/milena/mln/accu/count_adjacent_vertices.hh index 164a150..382e509 100644 --- a/milena/mln/accu/count_adjacent_vertices.hh +++ b/milena/mln/accu/count_adjacent_vertices.hh @@ -30,6 +30,7 @@ # define MLN_ACCU_COUNT_ADJACENT_VERTICES_HH /// \file mln/accu/count_adjacent_vertices.hh +/// /// Define an accumulator that counts the vertices adjacent to a /// set of p_edges psites. diff --git a/milena/mln/accu/land.hh b/milena/mln/accu/land.hh index 1b3058e..80a1701 100644 --- a/milena/mln/accu/land.hh +++ b/milena/mln/accu/land.hh @@ -35,6 +35,7 @@ /// /// \todo Have land be parameterized. +# include <mln/core/concept/meta_accumulator.hh> # include <mln/accu/internal/base.hh> diff --git a/milena/mln/accu/land_basic.hh b/milena/mln/accu/land_basic.hh index 831ff4b..ea4a886 100644 --- a/milena/mln/accu/land_basic.hh +++ b/milena/mln/accu/land_basic.hh @@ -35,6 +35,7 @@ /// /// \todo Have land_basic be parameterized. +# include <mln/core/concept/meta_accumulator.hh> # include <mln/accu/internal/base.hh> diff --git a/milena/mln/accu/lor.hh b/milena/mln/accu/lor.hh index 2e74d63..11411d5 100644 --- a/milena/mln/accu/lor.hh +++ b/milena/mln/accu/lor.hh @@ -35,6 +35,7 @@ /// /// \todo Have lor be parameterized. +# include <mln/core/concept/meta_accumulator.hh> # include <mln/accu/internal/base.hh> diff --git a/milena/mln/accu/lor_basic.hh b/milena/mln/accu/lor_basic.hh index 39a9864..896bb39 100644 --- a/milena/mln/accu/lor_basic.hh +++ b/milena/mln/accu/lor_basic.hh @@ -35,6 +35,7 @@ /// /// \todo Have lor_basic be parameterized. +# include <mln/core/concept/meta_accumulator.hh> # include <mln/accu/internal/base.hh> diff --git a/milena/mln/binarization/includes.hh b/milena/mln/binarization/includes.hh index ac01dfb..c191f7d 100644 --- a/milena/mln/binarization/includes.hh +++ b/milena/mln/binarization/includes.hh @@ -1,4 +1,5 @@ // 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 @@ -28,16 +29,13 @@ #ifndef MLN_BINARIZATION_INCLUDES_HH # define MLN_BINARIZATION_INCLUDES_HH -/*! \file mln/binarization/includes.hh - * - * \brief Basic list of includes for all files in mln/binarization/. - */ +/// \file mln/binarization/includes.hh +/// +/// Basic list of includes for all files in mln/binarization/. # include <mln/core/concept/image.hh> # include <mln/core/concept/window.hh> # include <mln/core/concept/neighborhood.hh> -# include <mln/metal/has_neighborhood.hh> - #endif // ! MLN_BINARIZATION_INCLUDES_HH diff --git a/milena/mln/border/get.hh b/milena/mln/border/get.hh index 4a6642b..9d752fa 100644 --- a/milena/mln/border/get.hh +++ b/milena/mln/border/get.hh @@ -29,13 +29,12 @@ #ifndef MLN_BORDER_GET_HH # define MLN_BORDER_GET_HH -/*! \file mln/border/get.hh - * - * \brief Define function that returns the real border thickness of image. - */ +/// \file mln/border/get.hh +/// +/// Define function that returns the real border thickness of image. # include <mln/trait/images.hh> - +# include <mln/trace/all.hh> namespace mln { @@ -72,7 +71,7 @@ namespace mln unsigned get_(trait::image::ext_domain::some, trait::image::category::morpher, const I& ima) { - return border::get( *ima.delegatee_() ); + return border::get(*ima.delegatee_()); } diff --git a/milena/mln/canvas/browsing/depth_first_search.hh b/milena/mln/canvas/browsing/depth_first_search.hh index 716be86..a8d840e 100644 --- a/milena/mln/canvas/browsing/depth_first_search.hh +++ b/milena/mln/canvas/browsing/depth_first_search.hh @@ -62,7 +62,12 @@ ** */ +# include <queue> +# include <mln/core/concept/iterator.hh> +# include <mln/core/concept/browsing.hh> # include <mln/core/concept/graph.hh> +# include <mln/util/vertex.hh> + namespace mln { @@ -96,7 +101,7 @@ namespace mln f.init(g); - mln_vertex_iter(util::graph) v(g); + mln_vertex_iter(G) v(g); for_all(v) if (f.to_be_treated(v.id())) { @@ -105,7 +110,7 @@ namespace mln f.update_treated(v.id()); while (!queue.empty()) { - util::vertex<util::graph> current_v = g.vertex(queue.front()); + util::vertex<G> current_v = g.vertex(queue.front()); queue.pop(); for (unsigned nv = 0; nv < current_v.nmax_nbh_vertices(); ++nv) if (f.to_be_queued(current_v.ith_nbh_vertex(nv))) diff --git a/milena/mln/convert/from_to.hh b/milena/mln/convert/from_to.hh index 877ac7a..1c4761d 100644 --- a/milena/mln/convert/from_to.hh +++ b/milena/mln/convert/from_to.hh @@ -63,8 +63,11 @@ namespace mln template <typename T> void - from_to(const float& from, Object<T>& to); + from_to(const T& from, T& to); + template <typename T> + void + from_to(const float& from, Object<T>& to); template <typename T> void @@ -87,6 +90,14 @@ namespace mln mlc_abort(F)::check(); } + // T -> T + template <typename T> + inline + void + from_to(const T& from, T& to) + { + to = from; + } // Image -> Site_Set. template <typename I, typename S> diff --git a/milena/mln/convert/to.hh b/milena/mln/convert/to.hh index 9d1ae7d..154084a 100644 --- a/milena/mln/convert/to.hh +++ b/milena/mln/convert/to.hh @@ -37,6 +37,7 @@ # include <mln/core/routine/exact.hh> # include <mln/metal/equal.hh> # include <mln/trace/all.hh> +# include <mln/convert/from_to.hh> # include <mln/convert/from_to.hxx> diff --git a/milena/mln/core/alias/complex_geometry.hh b/milena/mln/core/alias/complex_geometry.hh index 3bde2d4..d4e3a75 100644 --- a/milena/mln/core/alias/complex_geometry.hh +++ b/milena/mln/core/alias/complex_geometry.hh @@ -29,7 +29,8 @@ # define MLN_CORE_ALIAS_COMPLEX_GEOMETRY_HH /// \file mln/core/alias/complex_geometry.hh -/// \brief Definition of mln::geom::complex_geometry aliases. +/// +/// Definition of mln::geom::complex_geometry aliases. # include <mln/geom/complex_geometry.hh> # include <mln/core/alias/point3df.hh> diff --git a/milena/mln/core/clock_neighb.hh b/milena/mln/core/clock_neighb.hh index 1e18a8c..be0245c 100644 --- a/milena/mln/core/clock_neighb.hh +++ b/milena/mln/core/clock_neighb.hh @@ -35,13 +35,14 @@ # include <mln/core/concept/neighborhood.hh> +# include <mln/core/window.hh> # include <mln/core/dpoint.hh> # include <mln/core/site_set/p_array.hh> namespace mln { - // fwd decls + // forward declarations template <typename D> class dpsites_fwd_piter; template <typename D> class dpsites_bkd_piter; @@ -60,6 +61,9 @@ namespace mln /// Site associated type. typedef mln_psite(D) site; + /// Window associated type. + typedef window<dpsite> window; + /// Site_Iterator type to browse the psites of a generic /// neighborhood w.r.t. the ordering of delta-psites. /// @@ -93,11 +97,15 @@ namespace mln /// clock_neighb<D>& append(const D& dp); /// \} - const std::vector<D>& vect() const - { - return vec_; - } + /// Return the dpsites of this neighborhood. + const std::vector<D>& vect() const; + + /// Return the corresponding window. + /// FIXME: not in constant time! + mln::window<D> win() const; + + private: std::vector<D> vec_; }; @@ -119,7 +127,24 @@ namespace mln return *this; } + template <typename D> + inline + const std::vector<D>& + clock_neighb<D>::vect() const + { + return vec_; + } + template <typename D> + inline + window<D> + clock_neighb<D>::win() const + { + window<D> result; + for (unsigned i = 0; i < vec_.size(); ++i) + result.insert(vec_[i]); + return result; + } # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln diff --git a/milena/mln/core/image/complex_neighborhood_piter.hh b/milena/mln/core/image/complex_neighborhood_piter.hh index 4cbf7ab..6c44649 100644 --- a/milena/mln/core/image/complex_neighborhood_piter.hh +++ b/milena/mln/core/image/complex_neighborhood_piter.hh @@ -29,8 +29,10 @@ # define MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOOD_PITER_HH /// \file mln/core/image/complex_neighborhood_piter.hh -/// \brief Definition of a site iterator on a complex neighborhood. +/// +/// Definition of a site iterator on a complex neighborhood. +# include <mln/core/concept/neighborhood.hh> # include <mln/core/internal/site_relative_iterator_base.hh> // FIXME: These might be factor-able, both between fwd/bkd and nbh/win. diff --git a/milena/mln/core/image/hexa.hh b/milena/mln/core/image/hexa.hh index 3b113ea..433907b 100644 --- a/milena/mln/core/image/hexa.hh +++ b/milena/mln/core/image/hexa.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 @@ -30,11 +31,10 @@ # define MLN_CORE_IMAGE_HEXA_HH -/*! \file mln/core/image/hexa.hh - * - * \brief Definition of a morpher that makes hexagonal the mesh of an - * image. - */ +/// \file mln/core/image/hexa.hh +/// +/// Definition of a morpher that makes hexagonal the mesh of an +/// image. # include <mln/core/internal/image_domain_morpher.hh> # include <mln/core/alias/point2d_h.hh> @@ -65,7 +65,7 @@ namespace mln namespace trait { - + /// FIXME: use the right properties. template <typename I> struct image_< hexa<I> > : default_image_morpher< I, mln_value(I), hexa<I> > @@ -77,14 +77,14 @@ namespace mln typedef trait::image::category::domain_morpher category; + typedef mln_trait_image_pw_io(I) pw_io; // un-write when I const + typedef mln_trait_image_dimension(I) dimension; - typedef mln_trait_image_border(I) border; // have a border only if I does. - - typedef mln_trait_image_io_from_(I) io; // un-write when I const - - typedef mln_trait_image_data_from_(I) data; + // Extended domain + typedef mln_trait_image_ext_domain(I) ext_domain; // have a border only if I does. + typedef mln_trait_image_ext_value(I) ext_value; + typedef mln_trait_image_ext_io(I) ext_io; // un-write when I const - typedef trait::image::support::regular support; // typedef mlc_if( I_data_are_linear_, // trait::data::stored, // if linear then just stored // I_data_ ) data; // otherwise like I @@ -157,7 +157,6 @@ namespace mln /// Test if \p p belongs to the image domain. bool has(const psite& p) const; - bool has(const psite& p) const; /// Read-only access of pixel value at hexa point site \p p. rvalue operator()(const point2d_h& p) const; @@ -267,14 +266,6 @@ namespace mln } - template <typename I> - inline - bool - hexa<I>::has(const psite& p) const - { - return this->has(p); - } - # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln diff --git a/milena/mln/core/image/hexa_piter.hh b/milena/mln/core/image/hexa_piter.hh index ad6f36f..222c1e5 100644 --- a/milena/mln/core/image/hexa_piter.hh +++ b/milena/mln/core/image/hexa_piter.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,10 +29,9 @@ #ifndef MLN_CORE_IMAGE_HEXA_PITER_HH # define MLN_CORE_IMAGE_HEXA_PITER_HH -/*! \file mln/core/image/hexa_piter.hh - * - * \brief Definition of iterators on hexagonal points. - */ +/// \file mln/core/image/hexa_piter.hh +/// +/// Definition of iterators on hexagonal points. # include <mln/core/internal/piter_adaptor.hh> @@ -42,13 +42,13 @@ namespace mln { - /*! \brief A generic forward iterator on points of subsets. - * - * Parameter \c S is a point set type; parameter F is a function - * from point to Boolean. - * - * \see mln::hexa - */ + /// A generic forward iterator on points of subsets. + /// + /// Parameter \c S is a point set type; parameter F is a function + /// from point to Boolean. + /// + /// \see mln::hexa + /// template <typename S> class hexa_fwd_piter_ : public internal::piter_adaptor_< mln_fwd_piter(S), @@ -111,9 +111,9 @@ namespace mln void hexa_fwd_piter_<S>::start() { - this->piter_.start(); - p_[0] = this->piter_[0]; - p_[1] = this->piter_[1]; + this->pi_.start(); + p_[0] = this->pi_[0]; + p_[1] = this->pi_[1]; } template <typename S> @@ -121,9 +121,9 @@ namespace mln void hexa_fwd_piter_<S>::next_() { - this->piter_.next(); - p_[0] = this->piter_[0] * 2; - p_[1] = this->piter_[1] * 2 + this->piter_[0] % 2; + this->pi_.next(); + p_[0] = this->pi_[0] * 2; + p_[1] = this->pi_[1] * 2 + this->pi_[0] % 2; } template <typename S> diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh index b58dfed..7528a51 100644 --- a/milena/mln/core/image/image2d.hh +++ b/milena/mln/core/image/image2d.hh @@ -30,7 +30,7 @@ # define MLN_CORE_IMAGE_IMAGE2D_HH /// \file mln/core/image/image2d.hh -/// \brief Definition of the basic mln::image2d class. +/// Definition of the basic mln::image2d class. /// /// \todo Re-activate include at EOF when make::image2d is up again. diff --git a/milena/mln/core/image/image2d_h.hh b/milena/mln/core/image/image2d_h.hh index e733bc9..f2ba145 100644 --- a/milena/mln/core/image/image2d_h.hh +++ b/milena/mln/core/image/image2d_h.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,11 +29,10 @@ #ifndef MLN_CORE_IMAGE_IMAGE2D_H_HH # define MLN_CORE_IMAGE_IMAGE2D_H_HH -/*! \file mln/core/image/image2d_h.hh - * - * \brief Definition of an alias for a 2d image based on an hexagonal - * mesh. - */ +/// \file mln/core/image/image2d_h.hh +/// +/// Definition of an alias for a 2d image based on an hexagonal +/// mesh. # include <mln/core/image/image2d.hh> # include <mln/core/image/hexa.hh> diff --git a/milena/mln/core/internal/neighb_niter_impl.hh b/milena/mln/core/internal/neighb_niter_impl.hh index 868e1f8..aa0965d 100644 --- a/milena/mln/core/internal/neighb_niter_impl.hh +++ b/milena/mln/core/internal/neighb_niter_impl.hh @@ -32,6 +32,8 @@ /// /// Optional implementation for neigbh_niter. +# include <mln/core/macros.hh> +# include <mln/core/internal/force_exact.hh> namespace mln { diff --git a/milena/mln/core/internal/piter_adaptor.hh b/milena/mln/core/internal/piter_adaptor.hh index a2467dc..5c8e7be 100644 --- a/milena/mln/core/internal/piter_adaptor.hh +++ b/milena/mln/core/internal/piter_adaptor.hh @@ -1,4 +1,5 @@ // 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,15 +29,14 @@ #ifndef MLN_CORE_INTERNAL_PITER_ADAPTOR_HH # define MLN_CORE_INTERNAL_PITER_ADAPTOR_HH -/*! \file mln/core/internal/piter_adaptor.hh - * - * \brief Definition of iterators on points of boxes. - * - * \todo Rename as site_iterator_adaptor_base. - * - * \todo Distinguish between adaptors of site_set_iterator, - * site_relative_iterator, etc. (?) - */ +/// \file mln/core/internal/piter_adaptor.hh +/// +/// \brief Definition of iterators on points of boxes. +/// +/// \todo Rename as site_iterator_adaptor_base. +/// +/// \todo Distinguish between adaptors of site_set_iterator, +/// site_relative_iterator, etc. (?) # include <mln/core/internal/site_iterator_base.hh> @@ -47,11 +47,11 @@ namespace mln namespace internal { - /*! A base class for point iterator adaptors. - * - * Parameter \c Pi is the type of the point iterator adaptee; - * parameter E is the exact type. - */ + /// A base class for point iterator adaptors. + /// + /// Parameter \c Pi is the type of the point iterator adaptee; + /// parameter E is the exact type. + /// template <typename Pi, typename S, typename E> class piter_adaptor_ : public internal::site_iterator_base< S, E > { @@ -78,7 +78,7 @@ namespace mln /// Hook to the current location. const mln_psite(S)& p_hook_() const; - /// Change the site set targeted by this iterator. + /// Change the site set targeted by this iterator. void change_target(const S& s); /// Change the site set targeted by pi_. This default impl is a @@ -166,6 +166,7 @@ namespace mln void piter_adaptor_<Pi,S,E>::pi_change_target_(const S& s) { + this->pi_.change_target(s); } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/core/site_set/attic/p_complex_faces_piter.hh b/milena/mln/core/site_set/attic/p_complex_faces_piter.hh index 936b10e..8c66788 100644 --- a/milena/mln/core/site_set/attic/p_complex_faces_piter.hh +++ b/milena/mln/core/site_set/attic/p_complex_faces_piter.hh @@ -37,7 +37,7 @@ # include <mln/core/site_set/p_complex.hh> # include <mln/core/internal/p_complex_piter_base.hh> -# include <mln/topo/attic/complex_faces_iter.hh> +# include <mln/topo/attic/faces_iter.hh> /* FIXME: p_complex_faces_fwd_piter_ and p_complex_faces_bkd_piter_ are really long names: find something shorter. */ @@ -61,13 +61,13 @@ namespace mln /// mln::p_complex<D, P>. template <unsigned N, unsigned D, typename P> class p_complex_faces_fwd_piter_ - : public internal::p_complex_piter_base_< topo::complex_faces_fwd_iter_<N, D>, + : public internal::p_complex_piter_base_< topo::faces_fwd_iter_<N, D>, p_complex<D, P>, P, p_complex_faces_fwd_piter_<N, D, P> > { typedef p_complex_faces_fwd_piter_<N, D, P> self_; - typedef internal::p_complex_piter_base_< topo::complex_faces_fwd_iter_<N, D>, + typedef internal::p_complex_piter_base_< topo::faces_fwd_iter_<N, D>, p_complex<D, P>, P, self_ > super_; @@ -91,13 +91,13 @@ namespace mln class p_complex_faces_bkd_piter_ /* FIXME: Rename internal::p_complex_piter_base_ to something else, as it is also used for p_faces piters! */ - : public internal::p_complex_piter_base_< topo::complex_faces_bkd_iter_<N, D>, + : public internal::p_complex_piter_base_< topo::faces_bkd_iter_<N, D>, p_complex<D, P>, P, p_complex_faces_bkd_piter_<N, D, P> > { typedef p_complex_faces_bkd_piter_<N, D, P> self_; - typedef internal::p_complex_piter_base_< topo::complex_faces_bkd_iter_<N, D>, + typedef internal::p_complex_piter_base_< topo::faces_bkd_iter_<N, D>, p_complex<D, P>, P, self_ > super_; diff --git a/milena/mln/debug/iota.spe.hh b/milena/mln/debug/iota.spe.hh index ea52cf4..d0d4a9b 100644 --- a/milena/mln/debug/iota.spe.hh +++ b/milena/mln/debug/iota.spe.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,10 +29,9 @@ #ifndef MLN_DEBUG_IOTA_SPE_HH # define MLN_DEBUG_IOTA_SPE_HH -/*! \file mln/debug/iota.spe.hh - * - * \brief Specializations for mln::debug::iota. - */ +/// \file mln/debug/iota.spe.hh +/// +/// Specializations for mln::debug::iota. # ifndef MLN_DEBUG_IOTA_HH # error "Forbidden inclusion of *.spe.hh" @@ -46,12 +46,16 @@ namespace mln namespace debug { -# ifndef MLN_INCLUDE_ONLY namespace impl { template <typename I> + void iota(trait::image::speed::fastest, I& input); + +# ifndef MLN_INCLUDE_ONLY + + template <typename I> inline void iota(trait::image::speed::fastest, I& input) @@ -62,10 +66,10 @@ namespace mln p.val() = ++i % mln_max(mln_value(I)); } - } // end of namespace mln::debug::impl - # endif // ! MLN_INCLUDE_ONLY + } // end of namespace mln::debug::impl + } // end of namespace mln::debug } // end of namespace mln diff --git a/milena/mln/debug/println.spe.hh b/milena/mln/debug/println.spe.hh index 7e8ebc7..3d1a188 100644 --- a/milena/mln/debug/println.spe.hh +++ b/milena/mln/debug/println.spe.hh @@ -1,4 +1,5 @@ // 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,12 +29,11 @@ #ifndef MLN_DEBUG_PRINTLN_SPE_HH # define MLN_DEBUG_PRINTLN_SPE_HH -/*! \file mln/debug/println.spe.hh - * - * \brief Specializations for mln::debug::println. - * - * \todo Clean-up code. - */ +/// \file mln/debug/println.spe.hh +/// +/// Specializations for mln::debug::println. +/// +/// \todo Clean-up code. # ifndef MLN_DEBUG_PRINTLN_HH # error "Forbidden inclusion of *.spe.hh" @@ -47,19 +47,35 @@ # include <mln/level/fill.hh> # include <mln/accu/max.hh> +//FIXME: do not include all these headers +# include <mln/core/alias/box2d.hh> +# include <mln/core/alias/box2d_h.hh> +# include <mln/core/alias/box3d.hh> namespace mln { + // Forward declaration. + template <typename I> class hexa; namespace debug { -# ifndef MLN_INCLUDE_ONLY - namespace impl { -# ifdef MLN_CORE_SITE_SET_BOX2D_HH + void println(const box2d& b, const image2d<char>& input); + + template <typename I> + void println(const box2d& b, const I& input); + + template <typename I> + void println(const box2d_h& b, const hexa<I>& input); + + template <typename I> + void println(const box3d& b, const I& input); + + +# ifndef MLN_INCLUDE_ONLY // 2D versions. @@ -112,16 +128,12 @@ namespace mln std::cout << std::endl; } -# endif // MLN_CORE_SITE_SET_BOX2D_HH - -# ifdef MLN_CORE_IMAGE_IMAGE2D_H_HH - // Hexa version. template <typename I> void println(const box2d_h& b, const hexa<I>& input) { - typename hexa<I>::fwd_piter p(input.domain()); + mln_piter(hexa<I>) p(input.domain()); int c = 1; int r = 1; @@ -147,11 +159,6 @@ namespace mln std::cout << std::endl; } -# endif // MLN_CORE_IMAGE_IMAGE2D_H_HH - - -# ifdef MLN_CORE_SITE_SET_BOX3D_HH - // 3D version. template <typename I> void @@ -183,12 +190,10 @@ namespace mln } } -# endif // MLN_CORE_SITE_SET_BOX3D_HH +# endif // ! MLN_INCLUDE_ONLY } // end of namespace mln::debug::impl -# endif // ! MLN_INCLUDE_ONLY - } // end of namespace mln::debug } // end of namespace mln diff --git a/milena/mln/debug/println_with_border.hh b/milena/mln/debug/println_with_border.hh index 52ff01b..589f703 100644 --- a/milena/mln/debug/println_with_border.hh +++ b/milena/mln/debug/println_with_border.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,18 +29,18 @@ #ifndef MLN_DEBUG_PRINTLN_WITH_BORDER_HH # define MLN_DEBUG_PRINTLN_WITH_BORDER_HH -/*! \file mln/debug/println_with_border.hh - * - * \brief Print an image on the standard output with its border. - */ +/// \file mln/debug/println_with_border.hh +/// +/// Print an image on the standard output with its border. # include <mln/core/concept/image.hh> # include <mln/core/concept/window.hh> -# include <mln/debug/format.hh> - # include <mln/core/alias/box2d.hh> # include <mln/core/alias/box3d.hh> +# include <mln/geom/bbox.hh> + +# include <mln/debug/format.hh> // Specializations are in: # include <mln/debug/println_with_border.spe.hh> @@ -65,7 +66,7 @@ namespace mln void println_with_border(const S&, const I& input) { - for (size_t i = 0; i < input.nelements(); i++) + for (size_t i = 0; i < input.nelements(); i++) std::cout << format(input.buffer()[i]) << ' '; std::cout << std::endl; } diff --git a/milena/mln/fun/p2p/mirror.hh b/milena/mln/fun/p2p/mirror.hh index 5c0519c..88b1211 100644 --- a/milena/mln/fun/p2p/mirror.hh +++ b/milena/mln/fun/p2p/mirror.hh @@ -1,4 +1,5 @@ // 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 @@ -28,6 +29,12 @@ #ifndef MLN_FUN_P2P_MIRROR_HH # define MLN_FUN_P2P_MIRROR_HH +/// \file mln/fun/p2p/mirror.hh +/// +/// FIXME: doc + +# include <mln/core/concept/function.hh> + namespace mln { diff --git a/milena/mln/labeling/relabel.hh b/milena/mln/labeling/relabel.hh index d906a38..551da6d 100644 --- a/milena/mln/labeling/relabel.hh +++ b/milena/mln/labeling/relabel.hh @@ -156,7 +156,7 @@ namespace mln typedef fun::l2l::relabel<mln_value(I)> fl2l_t; fl2l_t fl2l = make::relabelfun(fl2b, nlabels, new_nlabels); - mln_concrete(I) output = relabel(label, nlabels, new_nlabels, fl2b); + mln_concrete(I) output = labeling::relabel(label, nlabels, new_nlabels, fl2l); trace::exiting("labeling::relabel"); return output; diff --git a/milena/mln/metal/has_neighborhood.hh b/milena/mln/metal/has_neighborhood.hh deleted file mode 100644 index 627db43..0000000 --- a/milena/mln/metal/has_neighborhood.hh +++ /dev/null @@ -1,53 +0,0 @@ -// 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 -// of the GNU General Public License version 2 as published by the -// Free Software Foundation. -// -// This library 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 this library; see the file COPYING. If not, write to -// the Free Software Foundation, 51 Franklin Street, Fifth Floor, -// Boston, MA 02111-1307, USA. -// -// As a special exception, you may use this file as part of a free -// software library 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_METAL_HAS_NEIGHBORHOOD_HH -# define MLN_METAL_HAS_NEIGHBORHOOD_HH - -# include <mln/neighb/get.hh> - -namespace mln -{ - - namespace metal - { - - template <typename I> - struct has_neighborhood - { - static void check() - { - // Ensure the image has a `neighb' property. - typedef mln_neighb(I) neighb; - } - }; - - } // end of namespace mln::metal - -} // end of namespace mln - -#endif // ! MLN_METAL_HAS_NEIGHBORHOOD_HH diff --git a/milena/mln/morpho/closing_area_on_vertices.hh b/milena/mln/morpho/closing_area_on_vertices.hh index 6cd9a10..7af8e6e 100644 --- a/milena/mln/morpho/closing_area_on_vertices.hh +++ b/milena/mln/morpho/closing_area_on_vertices.hh @@ -31,10 +31,10 @@ /// \file mln/morpho/closing_area.hh /// -/// \brief Morphological area closing on a line graph image computing +/// Morphological area closing on a line graph image computing /// the area in terms of adjacent vertices. -# include <mln/core/image/line_graph_image.hh> +# include <mln/core/site_set/p_edges.hh> # include <mln/morpho/closing_attribute.hh> # include <mln/accu/count_adjacent_vertices.hh> @@ -47,22 +47,23 @@ namespace mln /// Morphological area closing on a mln::line_graph_image computing /// the area in terms of adjacent vertices. - template <typename P, typename V, typename N, typename O> - void closing_area_on_vertices(const line_graph_image<P, V>& input, + template <typename P2V, typename G, typename V2P, typename N, typename O> + void closing_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, const Neighborhood<N>& nbh, unsigned lambda, Image<O>& output); # ifndef MLN_INCLUDE_ONLY - template <typename P, typename V, typename N, typename O> + template <typename P2V, typename G, typename V2P, typename N, typename O> inline - void closing_area_on_vertices(const line_graph_image<P, V>& input, + void closing_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, const Neighborhood<N>& nbh, unsigned lambda, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); - typedef accu::count_adjacent_vertices<P, V> attribute_t; + typedef p_edges<G, V2P> pe_t; + typedef accu::count_adjacent_vertices<P2V, pe_t> attribute_t; // FIXME: Change sig of closing_attribute! closing_attribute<attribute_t>(input, nbh, lambda, output); } diff --git a/milena/mln/morpho/erosion.hh b/milena/mln/morpho/erosion.hh index 4f750fe..053e320 100644 --- a/milena/mln/morpho/erosion.hh +++ b/milena/mln/morpho/erosion.hh @@ -35,8 +35,8 @@ /// /// \todo The overloads are hidden and I don't know why! -# include <mln/morpho/includes.hh> # include <mln/morpho/general.hh> +# include <mln/morpho/includes.hh> # include <mln/accu/land.hh> # include <mln/accu/land_basic.hh> # include <mln/accu/min.hh> diff --git a/milena/mln/morpho/general.hh b/milena/mln/morpho/general.hh index 72ab05d..31905f0 100644 --- a/milena/mln/morpho/general.hh +++ b/milena/mln/morpho/general.hh @@ -36,13 +36,17 @@ /// \todo Have infimum and supremum for value types, apart from /// morphology! -# include <mln/morpho/includes.hh> +# include <mln/core/concept/image.hh> +# include <mln/core/concept/window.hh> +# include <mln/core/concept/neighborhood.hh> + +# include <mln/extension/adjust_fill.hh> +# include <mln/accu/transform.hh> // Specializations are in: # include <mln/morpho/general.spe.hh> - # define mln_morpho_select_accu(I, S, F) \ typename mln::metal::if_< mln::metal::is< mln_trait_image_kind(I), \ trait::image::kind::binary >, \ diff --git a/milena/mln/morpho/general.spe.hh b/milena/mln/morpho/general.spe.hh index 784c88c..0ce2112 100644 --- a/milena/mln/morpho/general.spe.hh +++ b/milena/mln/morpho/general.spe.hh @@ -39,6 +39,11 @@ # include <mln/win/octagon2d.hh> # include <mln/win/rectangle2d.hh> +# include <mln/accu/transform_directional.hh> +# include <mln/accu/transform_snake.hh> +# include <mln/accu/transform_stop.hh> +# include <mln/accu/transform_diagonal.hh> + # include <mln/accu/min_h.hh> # include <mln/accu/line.hh> diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh index 38bb1d5..55f08ac 100644 --- a/milena/mln/morpho/hit_or_miss.hh +++ b/milena/mln/morpho/hit_or_miss.hh @@ -58,8 +58,8 @@ namespace mln */ template <typename I, typename Wh, typename Wm> mln_concrete(I) - hit_or_miss(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss); + hit_or_miss(const Image<I>& input, + const Window<Wh>& win_hit, const Window<Wm>& win_miss); /// Morphological hit-or-miss opening. @@ -68,8 +68,8 @@ namespace mln */ template <typename I, typename Wh, typename Wm> mln_concrete(I) - hit_or_miss_opening(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss); + hit_or_miss_opening(const Image<I>& input, + const Window<Wh>& win_hit, const Window<Wm>& win_miss); /// Morphological hit-or-miss opening of the background. @@ -78,8 +78,8 @@ namespace mln */ template <typename I, typename Wh, typename Wm> mln_concrete(I) - hit_or_miss_background_opening(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss); + hit_or_miss_background_opening(const Image<I>& input, + const Window<Wh>& win_hit, const Window<Wm>& win_miss); /// Morphological hit-or-miss closing. @@ -88,8 +88,8 @@ namespace mln */ template <typename I, typename Wh, typename Wm> mln_concrete(I) - hit_or_miss_closing(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss); + hit_or_miss_closing(const Image<I>& input, + const Window<Wh>& win_hit, const Window<Wm>& win_miss); /// Morphological hit-or-miss closing of the background. @@ -98,8 +98,8 @@ namespace mln */ template <typename I, typename Wh, typename Wm> mln_concrete(I) - hit_or_miss_background_closing(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss); + hit_or_miss_background_closing(const Image<I>& input, + const Window<Wh>& win_hit, const Window<Wm>& win_miss); @@ -123,7 +123,6 @@ namespace mln // Tests. mln_precondition(input.has_data()); - mln_precondition(win_hit.is_centered()); mln_precondition((win_hit && win_miss).is_empty()); // Avoid warnings. @@ -138,111 +137,155 @@ namespace mln namespace impl { - - // Preconditions. + // On sets. template <typename I, typename Wh, typename Wm> inline - void hit_or_miss_preconditions_(const Image<I>& input_, - const Window<Wh>& win_hit_, - const Window<Wm>& win_miss_) + mln_concrete(I) + hit_or_miss_logic(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { - const I& input = exact(input_); - const Wh& win_hit = exact(win_hit_); - const Wm& win_miss = exact(win_miss_); - mln_precondition(input.has_data()); - mln_precondition((win_hit && win_miss).is_empty()); + trace::entering("morpho::impl::hit_or_miss_logic"); + internal::hit_or_miss_tests(input, win_hit, win_miss); + + mln_concrete(I) output = logical::and_(erosion(input, win_hit), + erosion(complementation(input), + win_miss)); + + trace::exiting("morpho::impl::hit_or_miss_logic"); + return output; } - // On sets. - template <typename I, typename Wh, typename Wm> - inline - mln_concrete(I) - hit_or_miss_(trait::image::kind::logic, - const I& input, - const Wh& win_hit, const Wm& win_miss) + namespace generic { - return logical::and_(erosion(input, win_hit), - erosion(complementation(input), win_miss)); - } + // On functions. - // On functions. + template <typename I, typename Wh, typename Wm> + inline + mln_concrete(I) + hit_or_miss(const Image<I>& input_, + const Window<Wh>& win_hit_, + const Window<Wm>& win_miss_) + { + trace::entering("morpho::impl::generic::hit_or_miss"); + internal::hit_or_miss_tests(input_, win_hit_, win_miss_); - template <typename I, typename Wh, typename Wm> - inline - mln_concrete(I) - hit_or_miss_(trait::image::kind::any, - const I& input, - const Wh& win_hit, const Wm& win_miss) - { - typedef mln_value(I) V; - mln_value(I) zero_V = literal::zero; + const I& input = exact(input_); + const Wh& win_hit = exact(win_hit_); + const Wm& win_miss = exact(win_miss_); + + typedef mln_value(I) V; + mln_value(I) zero_V = literal::zero; - mln_concrete(I) output; - initialize(output, input); + mln_concrete(I) output; + initialize(output, input); - if (constrained_hit_or_miss) // CHMT. + if (constrained_hit_or_miss) // CHMT. { if (win_hit.is_centered()) - { - mln_concrete(I) - ero_fg = erosion(input, win_hit), - dil_bg = dilation(input, win_miss); - level::fill(output, - fun::p2v::ternary(pw::value(input) == pw::value(ero_fg) - && pw::value(dil_bg) < pw::value(input), - fun::cast<V>(pw::value(input) - pw::value(dil_bg)), - pw::cst(zero_V))); - } + { + mln_concrete(I) + ero_fg = erosion(input, win_hit), + dil_bg = dilation(input, win_miss); + level::fill(output, + fun::p2v::ternary(pw::value(input) == pw::value(ero_fg) + && pw::value(dil_bg) < pw::value(input), + fun::cast<V>(pw::value(input) - pw::value(dil_bg)), + pw::cst(zero_V))); + } else if (win_miss.is_centered()) - { - mln_concrete(I) - ero_bg = erosion(input, win_miss), - dil_fg = dilation(input, win_hit); - level::fill(output, - fun::p2v::ternary(pw::value(input) == pw::value(dil_fg) - && pw::value(ero_bg) > pw::value(input), - fun::cast<V>(pw::value(ero_bg) - pw::value(input)), - pw::cst(zero_V))); - } + { + mln_concrete(I) + ero_bg = erosion(input, win_miss), + dil_fg = dilation(input, win_hit); + level::fill(output, + fun::p2v::ternary(pw::value(input) == pw::value(dil_fg) + && pw::value(ero_bg) > pw::value(input), + fun::cast<V>(pw::value(ero_bg) - pw::value(input)), + pw::cst(zero_V))); + } else level::fill(output, zero_V); } - else // Unconstrained: UHMT. + else // Unconstrained: UHMT. { mln_concrete(I) ero = erosion(input, win_hit), dil = dilation(input, win_miss); level::fill(output, fun::p2v::ternary(pw::value(dil) < pw::value(ero), - fun::cast<V>(pw::value(ero) - pw::value(dil)), - pw::cst(zero_V))); + fun::cast<V>(pw::value(ero) - pw::value(dil)), + pw::cst(zero_V))); } - return output; - } + trace::exiting("morpho::impl::generic::hit_or_miss"); + return output; + } + } // end of namespace mln::morpho::impl::generic } // end of mln::morpho::impl + namespace internal + { + + template <typename I, typename Wh, typename Wm> + inline + mln_concrete(I) + hit_or_miss_dispatch(trait::image::kind::any, + const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) + { + return impl::generic::hit_or_miss(input, win_hit, win_miss); + } + + template <typename I, typename Wh, typename Wm> + inline + mln_concrete(I) + hit_or_miss_dispatch(trait::image::kind::logic, + const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) + { + return impl::hit_or_miss_logic(input, win_hit, win_miss); + } + + + template <typename I, typename Wh, typename Wm> + inline + mln_concrete(I) + hit_or_miss_dispatch(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) + { + return hit_or_miss_dispatch(mln_trait_image_kind(I)(), + exact(input), + exact(win_hit), + exact(win_miss)); + } + + } // end of namespace mln::morpho::internal + template <typename I, typename Wh, typename Wm> inline mln_concrete(I) - hit_or_miss(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss) + hit_or_miss(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { trace::entering("morpho::hit_or_miss"); internal::hit_or_miss_tests(input, win_hit, win_miss); - mln_concrete(I) output = impl::hit_or_miss_(mln_trait_image_kind(I)(), - exact(input), - exact(win_hit), exact(win_miss)); - + mln_concrete(I) output = internal::hit_or_miss_dispatch(input, + win_hit, + win_miss); trace::exiting("morpho::hit_or_miss"); return output; } @@ -251,14 +294,17 @@ namespace mln template <typename I, typename Wh, typename Wm> inline mln_concrete(I) - hit_or_miss_opening(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss) + hit_or_miss_opening(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { trace::entering("morpho::hit_or_miss_opening"); internal::hit_or_miss_tests(input, win_hit, win_miss); - mln_concrete(I) output = dilation( hit_or_miss(input, win_hit, win_miss), - win::sym(win_hit) ); + mln_concrete(I) output = dilation(internal::hit_or_miss_dispatch(input, + win_hit, + win_miss), + win::sym(win_hit)); trace::exiting("morpho::hit_or_miss_opening"); return output; @@ -268,16 +314,21 @@ namespace mln template <typename I, typename Wh, typename Wm> inline mln_concrete(I) - hit_or_miss_background_opening(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss) + hit_or_miss_background_opening(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { trace::entering("morpho::hit_or_miss_background_opening"); internal::hit_or_miss_tests(input, win_hit, win_miss); - mln_concrete(I) output = hit_or_miss_opening(complementation(input), win_miss, win_hit); + mln_concrete(I) output = hit_or_miss_opening(complementation(input), + win_miss, + win_hit); - mln_postcondition( dilation( hit_or_miss(input, win_hit, win_miss), - win::sym(win_miss) ) == output); + mln_postcondition(dilation(internal::hit_or_miss_dispatch(input, + win_hit, + win_miss), + win::sym(win_miss)) == output); trace::exiting("morpho::hit_or_miss_background_opening"); return output; } @@ -286,14 +337,16 @@ namespace mln template <typename I, typename Wh, typename Wm> inline mln_concrete(I) - hit_or_miss_closing(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss) + hit_or_miss_closing(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { trace::entering("morpho::hit_or_miss_closing"); internal::hit_or_miss_tests(input, win_hit, win_miss); - mln_concrete(I) output = complementation( hit_or_miss_opening( complementation(input), - win_hit, win_miss ) ); + mln_concrete(I) output = + complementation(hit_or_miss_opening(complementation(input), + win_hit, win_miss)); // FIXME: Postcondition. trace::exiting("morpho::hit_or_miss_closing"); @@ -304,16 +357,18 @@ namespace mln template <typename I, typename Wh, typename Wm> inline mln_concrete(I) - hit_or_miss_background_closing(const Image<I>& input, - const Window<Wh>& win_hit, const Window<Wm>& win_miss) + hit_or_miss_background_closing(const Image<I>& input, + const Window<Wh>& win_hit, + const Window<Wm>& win_miss) { trace::entering("morpho::hit_or_miss_background_closing"); internal::hit_or_miss_tests(input, win_hit, win_miss); mln_concrete(I) output = hit_or_miss_closing(input, win_miss, win_hit); - mln_postcondition( complementation( hit_or_miss_background_opening( complementation(input), - win_hit, win_miss ) ) == output ); + mln_postcondition(complementation(hit_or_miss_background_opening( + complementation(input), + win_hit, win_miss)) == output); trace::exiting("morpho::hit_or_miss_background_closing"); return output; } diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh index f9b32b2..1d0128a 100644 --- a/milena/mln/morpho/line_gradient.hh +++ b/milena/mln/morpho/line_gradient.hh @@ -1,4 +1,5 @@ // 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 @@ -29,7 +30,8 @@ # define MLN_MORPHO_LINE_GRADIENT_HH /// \file mln/morpho/line_gradient.hh -/// \brief Conversions to mln::line_graph_image. +/// +/// Conversions to mln::line_graph_image. # include <functional> @@ -42,7 +44,11 @@ # include <mln/core/image/image2d.hh> # include <mln/core/alias/window2d.hh> -# include <mln/core/image/line_graph_image.hh> + +# include <mln/core/site_set/p_edges.hh> + +# include <mln/util/graph.hh> +# include <mln/util/site_pair.hh> // FIXME: Generalize to other (input) images as well (image1d, // image3d, etc.). @@ -53,68 +59,67 @@ namespace mln namespace morpho { - /// \brief Create a line graph image representing the gradient + /// Create a line graph image representing the gradient /// norm of a mln::image2d. /* FIXME: Currently, the adjacency is set to 4-c and cannot be changed. */ - template <typename T> - mln::line_graph_image<mln::point2d, T> - line_gradient(const mln::image2d<T>& ima); + template <typename F, typename S> + mln::pw::image<F, S> + line_gradient(const mln::image2d<mln_result(F)>& ima); # ifndef MLN_INCLUDE_ONLY - template <typename T> - mln::line_graph_image<mln::point2d, T> - line_gradient(const mln::image2d<T>& ima) + template <typename F, typename S> + mln::pw::image<F, S> + line_gradient(const mln::image2d<mln_result(F)>& ima) { // FIXME: Precondition: Ensure the image is scalar. - typedef T value_t; + typedef mln_result(F) value_t; - util::graph<mln::point2d> g; - - // Points. - /* FIXME: The need for such a structure during the conversion - exhibits the lack of a service from util::graph (or a another, - missing tool) regarding the retrieval of vertices' ids from - points. */ - std::map< mln::point2d, util::vertex_id, util::ord<point2d> > points; + util::graph g; // Vertices. - std::vector<value_t> vertex_values; + image2d<unsigned> vpsite(ima.domain()); + fun::i2v::array<mln::point2d> fv2p(ima.domain().nsites()); + fun::i2v::array<value_t> vertex_values(ima.domain().nsites()); + mln_fwd_piter(image2d<value_t>) p(ima.domain()); for_all (p) { - util::vertex_id id = g.add_vertex (p); - vertex_values.push_back (ima(p)); - points[p] = id; + g.add_vertex(); + unsigned id = g.v_nmax() - 1; + vpsite[p] = id; + fv2p(id) = p; } // Edges. // FIXME: The creation of this window should be generic. window2d next_c4_win; next_c4_win.insert(0, 1).insert(1, 0); - std::vector<value_t> edge_values; - mln_fwd_qiter_(window2d) q(next_c4_win, p); + typedef fun::i2v::array<value_t> edge_values_t; + typedef fun::i2v::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); for_all (p) for_all (q) if (ima.domain().has(q)) { - util::edge_id id = g.add_edge(points[p], points[q]); - // Avoid a warning about an undefined variable when NDEBUG - // is not defined. - (void) id; + g.add_edge(vpsite(p), vpsite(q)); // The computed value is a norm of the gradient between P and Q. - edge_values.push_back(math::abs(ima(p) - ima(q))); - mln_assertion(id != mln_max(util::edge_id::equiv)); + unsigned edge_id = edge_values.size(); + edge_values.resize(edge_values.size() + 1); + edge_values(edge_id) = math::abs(ima(p) - ima(q)); } // Line graph point set. - p_line_graph<mln::point2d> plg(g); + typedef p_edges<util::graph, edge_sites_t> pe_t; + pe_t plg(g, edge_sites); // Line graph image. - typedef line_graph_image<mln::point2d, value_t> ima_t; - ima_t lg_ima(plg, vertex_values, edge_values); + typedef pw::image<edge_values_t, pe_t> ima_t; + ima_t lg_ima = (edge_values | plg); return lg_ima; } diff --git a/milena/mln/morpho/opening_area_on_vertices.hh b/milena/mln/morpho/opening_area_on_vertices.hh index d6e7234..b8e420e 100644 --- a/milena/mln/morpho/opening_area_on_vertices.hh +++ b/milena/mln/morpho/opening_area_on_vertices.hh @@ -30,10 +30,12 @@ # define MLN_MORPHO_OPENING_AREA_ON_VERTICES_HH /// \file mln/morpho/opening_area_on_vertices.hh -/// \brief Morphological area opening on a line graph image computing +/// +/// Morphological area opening on a line graph image computing /// the area in terms of adjacent vertices. -# include <mln/core/image/line_graph_image.hh> +# include <mln/pw/image.hh> +# include <mln/core/site_set/p_edges.hh> # include <mln/morpho/opening_attribute.hh> # include <mln/accu/count_adjacent_vertices.hh> @@ -46,22 +48,23 @@ namespace mln /// Morphological area opening on a mln::line_graph_image computing /// the area in terms of adjacent vertices. - template <typename P, typename V, typename N, typename O> - void opening_area_on_vertices(const line_graph_image<P, V>& input, + template <typename P2V, typename G, typename V2P, typename N, typename O> + void opening_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, const Neighborhood<N>& nbh, unsigned lambda, Image<O>& output); # ifndef MLN_INCLUDE_ONLY - template <typename P, typename V, typename N, typename O> + template <typename P2V, typename G, typename V2P, typename N, typename O> inline - void opening_area_on_vertices(const line_graph_image<P, V>& input, + void opening_area_on_vertices(const pw::image<P2V, p_edges<G, V2P> >& input, const Neighborhood<N>& nbh, unsigned lambda, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); - typedef accu::count_adjacent_vertices<P, V> attribute_t; + typedef p_edges<G, V2P> pe_t; + typedef accu::count_adjacent_vertices<P2V, pe_t> attribute_t; // FIXME: Change sig of opening_attribute! opening_attribute<attribute_t>(input, nbh, lambda, output); } diff --git a/milena/mln/registration/internal/rms.hh b/milena/mln/registration/internal/rms.hh index f5b8579..375ff79 100644 --- a/milena/mln/registration/internal/rms.hh +++ b/milena/mln/registration/internal/rms.hh @@ -28,6 +28,7 @@ #ifndef MLN_REGISTRATION_INTERNAL_RMS_HH # define MLN_REGISTRATION_INTERNAL_RMS_HH +# include <mln/norm/l2.hh> # include <mln/core/site_set/p_array.hh> namespace mln diff --git a/milena/mln/subsampling/gaussian_subsampling.hh b/milena/mln/subsampling/gaussian_subsampling.hh index b4aa2e0..4e20a1b 100644 --- a/milena/mln/subsampling/gaussian_subsampling.hh +++ b/milena/mln/subsampling/gaussian_subsampling.hh @@ -52,7 +52,7 @@ namespace mln template <typename I> inline mln_concrete(I) - gaussian_subsampling(const Image<I>& input, float sigma + gaussian_subsampling(const Image<I>& input, float sigma, const mln_dpsite(I)& first_p, const mln_deduce(I, site, coord)& gap); diff --git a/milena/mln/topo/adj_higher_face_iter.hh b/milena/mln/topo/adj_higher_face_iter.hh index e51d678..0cac258 100644 --- a/milena/mln/topo/adj_higher_face_iter.hh +++ b/milena/mln/topo/adj_higher_face_iter.hh @@ -29,7 +29,8 @@ # define MLN_TOPO_ADJ_HIGHER_FACE_ITER_HH /// \file mln/topo/adj_higher_face_iter.hh -/// \brief Definition of forward and backward iterators on the +/// +/// Definition of forward and backward iterators on the /// adjacent (n+1)-faces of a (reference) n-face in a complex. # include <mln/topo/internal/complex_relative_iterator_base.hh> @@ -42,9 +43,17 @@ namespace mln namespace topo { - // Forward declaration. + // Forward declarations. template <unsigned D> class complex; + namespace internal + { + + template <typename F, typename E> + class complex_iterator_base; + + } // end of namespace mln::topo::internal + /*------------------------------------. | topo::adj_higher_face_fwd_iter<D>. | diff --git a/milena/mln/topo/adj_lower_face_iter.hh b/milena/mln/topo/adj_lower_face_iter.hh index 88cc8f2..23bcc36 100644 --- a/milena/mln/topo/adj_lower_face_iter.hh +++ b/milena/mln/topo/adj_lower_face_iter.hh @@ -29,7 +29,7 @@ # define MLN_TOPO_ADJ_LOWER_FACE_ITER_HH /// \file mln/topo/adj_lower_face_iter.hh -/// \brief Definition of forward and backward iterators on the +/// Definition of forward and backward iterators on the /// adjacent (n-1)-faces of a (reference) n-face in a complex. # include <mln/topo/internal/complex_relative_iterator_base.hh> @@ -42,15 +42,26 @@ namespace mln namespace topo { - // Forward declaration. + // Forward declarations. template <unsigned D> class complex; + namespace internal + { + + template <typename C, typename F, typename E> + class forward_complex_relative_iterator_base; + + template <typename C, typename F, typename E> + class backward_complex_relative_iterator_base; + + } // end of namespace mln::topo::internal + /*-----------------------------------. | topo::adj_lower_face_fwd_iter<D>. | `-----------------------------------*/ - /// \brief Forward iterator on all the adjacent (n-1)-faces of the + /// Forward iterator on all the adjacent (n-1)-faces of the /// n-face of an mln::complex<D>. /// /// \arg \p D The dimension of the complex this iterator belongs to. @@ -83,7 +94,7 @@ namespace mln | topo::adj_lower_face_bkd_iter<D>. | `-----------------------------------*/ - /// \brief Backward iterator on all the adjacent (n-1)-faces of the + /// Backward iterator on all the adjacent (n-1)-faces of the /// n-face of an mln::complex<D>. /// /// \arg \p D The dimension of the complex this iterator belongs to. diff --git a/milena/mln/topo/adj_lower_higher_face_iter.hh b/milena/mln/topo/adj_lower_higher_face_iter.hh index dcd11c2..f3c28c3 100644 --- a/milena/mln/topo/adj_lower_higher_face_iter.hh +++ b/milena/mln/topo/adj_lower_higher_face_iter.hh @@ -29,7 +29,8 @@ # define MLN_TOPO_ADJ_LOWER_HIGHER_FACE_ITER_HH /// \file mln/topo/adj_lower_higher_face_iter.hh -/// \brief Definition of forward and backward iterators on all the +/// +/// Definition of forward and backward iterators on all the /// adjacent (n-1)-faces and (n+1)-faces of a (reference) n-face in a /// complex. @@ -47,12 +48,20 @@ namespace mln // Forward declaration. template <unsigned D> class complex; + namespace internal + { + + template <typename I1, typename I2, typename E> + class complex_relative_iterator_sequence; + + } // end of namespace mln::topo::internal + /*------------------------------------------. | topo::adj_lower_higher_face_fwd_iter<D>. | `------------------------------------------*/ - /// \brief Forward iterator on all the adjacent (n-1)-faces and + /// Forward iterator on all the adjacent (n-1)-faces and /// (n+1)-faces of the n-face of an mln::complex<D>. /// /// \arg \p D The dimension of the complex this iterator belongs to. @@ -83,7 +92,7 @@ namespace mln | topo::adj_lower_higher_face_bkd_iter<D>. | `------------------------------------------*/ - /// \brief Forward iterator on all the adjacent (n-1)-faces and + /// Forward iterator on all the adjacent (n-1)-faces and /// (n+1)-faces of the n-face of an mln::complex<D>. /// /// \arg \p D The dimension of the complex this iterator belongs to. diff --git a/milena/mln/topo/algebraic_face.hh b/milena/mln/topo/algebraic_face.hh index 1c666ac..03768f8 100644 --- a/milena/mln/topo/algebraic_face.hh +++ b/milena/mln/topo/algebraic_face.hh @@ -29,9 +29,11 @@ # define MLN_TOPO_ALGEBRAIC_FACE_HH /// \file mln/topo/algebraic_face.hh -/// \brief Algebraic face of a complex. +/// +/// Algebraic face of a complex. #include <mln/topo/face.hh> +#include <mln/topo/algebraic_n_face.hh> namespace mln @@ -44,13 +46,13 @@ namespace mln template <unsigned D> class complex; template <unsigned N, unsigned D> class n_face; template <unsigned N, unsigned D> class face_data; - + /*-------. | Face. | `-------*/ - /// \brief Algebraic face handle in a complex; the face dimension + /// Algebraic face handle in a complex; the face dimension /// is dynamic. /// /// Contrary to an mln::topo::algebraic_n_face, the dimension of an @@ -111,7 +113,7 @@ namespace mln /// Comparison of two instances of mln::topo::algebraic_face. /// \{ - /// \brief Is \a lhs equal to \a rhs? + /// Is \a lhs equal to \a rhs? /// /// \pre Arguments \a lhs and \a rhs must belong to the same /// mln::topo::complex. @@ -119,7 +121,7 @@ namespace mln bool operator==(const algebraic_face<D>& lhs, const algebraic_face<D>& rhs); - /// \brief Is \a lhs different from \a rhs? + /// Is \a lhs different from \a rhs? /// /// \pre Arguments \a lhs and \a rhs must belong to the same /// mln::topo::complex. @@ -127,7 +129,7 @@ namespace mln bool operator!=(const algebraic_face<D>& lhs, const algebraic_face<D>& rhs); - /// \brief Is \a lhs ``less'' than \a rhs? + /// Is \a lhs ``less'' than \a rhs? /// /// This comparison is required by algorithms sorting algebraic /// face handles. diff --git a/milena/mln/topo/all.hh b/milena/mln/topo/all.hh index 2d06897..8f61744 100644 --- a/milena/mln/topo/all.hh +++ b/milena/mln/topo/all.hh @@ -1,4 +1,5 @@ // 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 @@ -28,10 +29,9 @@ #ifndef MLN_TOPO_ALL_HH # define MLN_TOPO_ALL_HH -/*! \file mln/topo/all.hh - * - * \brief File that includes all "point-wise" expression tools. - */ +/// \file mln/topo/all.hh +/// +/// File that includes all topology related algorithms. namespace mln @@ -42,22 +42,21 @@ namespace mln } // end of namespace mln - -# include <mln/core/topo/adj_higher_dim_connected_n_face_iter.hh> -# include <mln/core/topo/adj_higher_face_iter.hh> -# include <mln/core/topo/adj_lower_dim_connected_n_face_iter.hh> -# include <mln/core/topo/adj_lower_face_iter.hh> -# include <mln/core/topo/adj_lower_higher_face_iter.hh> -# include <mln/core/topo/center_only_iter.hh> -# include <mln/core/topo/centered_iter_adapter.hh> -# include <mln/core/topo/complex.hh> -# include <mln/core/topo/complex_iterators.hh> -# include <mln/core/topo/face.hh> -# include <mln/core/topo/face_data.hh> -# include <mln/core/topo/face_iter.hh> -# include <mln/core/topo/n_face.hh> -# include <mln/core/topo/n_face_iter.hh> -# include <mln/core/topo/n_faces_set.hh> -# include <mln/core/topo/static_n_face_iter> +# include <mln/topo/attic/faces_iter.hh> +# include <mln/topo/adj_higher_dim_connected_n_face_iter.hh> +# include <mln/topo/adj_higher_face_iter.hh> +# include <mln/topo/adj_lower_dim_connected_n_face_iter.hh> +# include <mln/topo/adj_lower_face_iter.hh> +# include <mln/topo/adj_lower_higher_face_iter.hh> +# include <mln/topo/center_only_iter.hh> +# include <mln/topo/centered_iter_adapter.hh> +# include <mln/topo/complex.hh> +# include <mln/topo/complex_iterators.hh> +# include <mln/topo/face.hh> +# include <mln/topo/face_data.hh> +# include <mln/topo/face_iter.hh> +# include <mln/topo/n_face.hh> +# include <mln/topo/n_face_iter.hh> +# include <mln/topo/n_faces_set.hh> #endif // ! MLN_TOPO_ALL_HH diff --git a/milena/mln/topo/face_iter.hh b/milena/mln/topo/face_iter.hh index 4030594..a9b2665 100644 --- a/milena/mln/topo/face_iter.hh +++ b/milena/mln/topo/face_iter.hh @@ -45,9 +45,17 @@ namespace mln namespace topo { - // Forward declaration. + // Forward declarations. template <unsigned D> class complex; + namespace internal + { + + template <typename F, typename E> + class complex_set_iterator_base; + + } // end of namespace mln::topo::internal + /*-------------------------. | topo::face_fwd_iter<D>. | diff --git a/milena/mln/topo/internal/complex_iterator_base.hh b/milena/mln/topo/internal/complex_iterator_base.hh index ceb86f3..cd98fba 100644 --- a/milena/mln/topo/internal/complex_iterator_base.hh +++ b/milena/mln/topo/internal/complex_iterator_base.hh @@ -21,7 +21,7 @@ // 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. +// License. // reasons why the executable file might be covered by the GNU General // Public License. @@ -29,7 +29,7 @@ # define MLN_TOPO_INTERNAL_COMPLEX_ITERATOR_BASE_HH /** \file mln/topo/internal/complex_iterator_base.hh - \brief Definition of an implementation (factoring) class for + Definition of an implementation (factoring) class for iterators on complexes. Concrete iterators should inherit either from @@ -69,7 +69,7 @@ namespace mln namespace internal { - /// \brief Factoring class for iterators on mln::complex. + /// Factoring class for iterators on mln::complex. /// /// \arg \p F The type of the face handle. /// \arg \p E The type exact type of the iterator. @@ -82,7 +82,7 @@ namespace mln /// The type of the iterated faces. typedef F face; - /// \brief Conversion. + /// Conversion. /// /// Return a reference to the corresponding face handle. /// \{ diff --git a/milena/mln/topo/internal/complex_relative_iterator_base.hh b/milena/mln/topo/internal/complex_relative_iterator_base.hh index 4925952..c795043 100644 --- a/milena/mln/topo/internal/complex_relative_iterator_base.hh +++ b/milena/mln/topo/internal/complex_relative_iterator_base.hh @@ -21,7 +21,7 @@ // 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. +// License. // reasons why the executable file might be covered by the GNU General // Public License. @@ -29,7 +29,7 @@ # define MLN_TOPO_INTERNAL_COMPLEX_RELATIVE_ITERATOR_BASE_HH /** \file mln/topo/internal/complex_relative_iterator_base.hh - \brief Definition of an implementation (factoring) class for + Definition of an implementation (factoring) class for iterators on mln::complex. The hierarchy of classes in this file is as follows @@ -68,11 +68,16 @@ namespace mln namespace internal { + // Forward declaration. + template <typename F, typename E> + class complex_iterator_base; + + /*----------------------------------------------------------. | topo::internal::complex_relative_iterator_base<C, F, E>. | `----------------------------------------------------------*/ - /// \brief Factoring class for relative iterators on mln::complex. + /// Factoring class for relative iterators on mln::complex. /// /// \arg \p C The type of the center face handle. /// \arg \p F The type of the face handle. @@ -124,7 +129,7 @@ namespace mln | topo::internal::forward_complex_relative_iterator_base<C, F, E>. | `------------------------------------------------------------------*/ - /// \brief Factoring class for forward relative iterators on + /// Factoring class for forward relative iterators on /// mln::complex. /// /// \arg \p C The type of the center face handle. @@ -175,7 +180,7 @@ namespace mln | topo::internal::backward_complex_relative_iterator_base<C, F, E>. | `-------------------------------------------------------------------*/ - /// \brief Factoring class for backward relative iterators on + /// Factoring class for backward relative iterators on /// mln::complex. /// /// \arg \p C The type of the center face handle. diff --git a/milena/mln/topo/internal/complex_relative_iterator_sequence.hh b/milena/mln/topo/internal/complex_relative_iterator_sequence.hh index 57b4843..c3574d0 100644 --- a/milena/mln/topo/internal/complex_relative_iterator_sequence.hh +++ b/milena/mln/topo/internal/complex_relative_iterator_sequence.hh @@ -29,7 +29,8 @@ # define MLN_TOPO_INTERNAL_COMPLEX_RELATIVE_ITERATOR_SEQUENCE_HH /// \file mln/topo/internal/complex_relative_iterator_sequence.hh -/// \brief Definition of a meta complex relative iterator using two +/// +/// Definition of a meta complex relative iterator using two /// complex relative iterators sequentially. # include <iosfwd> @@ -48,7 +49,7 @@ namespace mln namespace internal { - /// \brief A meta relative iterator on the faces of a complex + /// A meta relative iterator on the faces of a complex /// using two complex relative iterators sequentially. /// /// The first relative iterator is used, and when it becomes diff --git a/milena/mln/topo/internal/complex_set_iterator_base.hh b/milena/mln/topo/internal/complex_set_iterator_base.hh index c04f5cd..231cb8a 100644 --- a/milena/mln/topo/internal/complex_set_iterator_base.hh +++ b/milena/mln/topo/internal/complex_set_iterator_base.hh @@ -21,7 +21,7 @@ // 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. +// License. // reasons why the executable file might be covered by the GNU General // Public License. @@ -29,7 +29,8 @@ # define MLN_TOPO_INTERNAL_COMPLEX_SET_ITERATOR_BASE_HH /// \file mln/topo/internal/complex_set_iterator_base.hh -/// \brief Definition of an implementation (factoring) class for +/// +/// Definition of an implementation (factoring) class for /// (set) iterators on faces of a complex. # include <mln/topo/internal/complex_iterator_base.hh> @@ -43,7 +44,13 @@ namespace mln namespace internal { - /// \brief Factoring class for (set) iterators on mln::complex. + + // Forward declaration. + template <typename F, typename E> + class complex_iterator_base; + + + /// Factoring class for (set) iterators on mln::complex. /// /// \arg \p F The type of the face handle. /// \arg \p E The type exact type of the iterator. diff --git a/milena/mln/trait/neighborhood.hh b/milena/mln/trait/neighborhood.hh index 56db0c9..1c605b5 100644 --- a/milena/mln/trait/neighborhood.hh +++ b/milena/mln/trait/neighborhood.hh @@ -29,7 +29,8 @@ # define MLN_TRAIT_NEIGHBORHOOD_HH /// \file mln/trait/neighborhood.hh -/// \brief Some base trait types for neighborhood types. +/// +/// Some base trait types for neighborhood types. # include <string> @@ -52,23 +53,6 @@ namespace mln // Forward declaration. struct undef; - struct undefined_neighborhood - { - typedef undef kind; - }; - - - struct default_neighborhood : undefined_neighborhood - { - typedef trait::neighborhood::kind::generic kind; - }; - - - template <typename V> - struct neighborhood : default_neighborhood - { - }; - /*----------------. | Traits values. | @@ -106,6 +90,24 @@ namespace mln } + + struct undefined_neighborhood_ + { + typedef undef kind; + }; + + + struct default_neighborhood_ : undefined_neighborhood_ + { + typedef trait::neighborhood::kind::generic kind; + }; + + + template <typename V> + struct neighborhood_ : default_neighborhood_ + { + }; + } // end of namespace mln::trait } // end of namespace mln diff --git a/milena/mln/util/tree_to_image.hh b/milena/mln/util/tree_to_image.hh index 21004fd..40b31ae 100644 --- a/milena/mln/util/tree_to_image.hh +++ b/milena/mln/util/tree_to_image.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,10 @@ #ifndef MLN_UTIL_TREE_TO_IMAGE_HH # define MLN_UTIL_TREE_TO_IMAGE_HH -/*! - * \file mln/util/tree_to_image.hh - * - * \brief Definition of function which transform a tree into an - * image. - * - */ +/// \file mln/util/tree_to_image.hh +/// +/// Definition of function which transform a tree into an +/// image. # include <mln/core/concept/image.hh> # include <mln/util/tree.hh> @@ -47,33 +45,30 @@ namespace mln namespace util { - /*! \brief Convert a tree into an image. - * - * \param[in] tree The tree to convert. - * \param[out] output_ The image containing tree informations. - * - */ + /// Convert a tree into an image. + /// + /// \param[in] tree The tree to convert. + /// \param[out] output_ The image containing tree informations. + /// template <typename T, typename I> void tree_to_image (tree<T>& tree, Image<I>& output_); - /*! Display a tree. - * - * \param[in] ima_ The domain of output image. - * \param[in] tree The tree to display. - * - */ + /// Display a tree. + /// + /// \param[in] ima_ The domain of output image. + /// \param[in] tree The tree to display. + /// template <typename I, typename J> void display_tree(const Image<J>& ima_, tree<I>& tree); - /*! Display an arborescence from \p tree_node. - * - * \param[in] ima_ The domain of output image. - * \param[in] tree_node The root tree_node to display. - * - */ + /// Display an arborescence from \p tree_node. + /// + /// \param[in] ima_ The domain of output image. + /// \param[in] tree_node The root tree_node to display. + /// template <typename I, typename J> void display_branch(const Image<J>& ima_, tree_node<I>* tree_node); diff --git a/milena/mln/value/internal/convert.hh b/milena/mln/value/internal/convert.hh index fc5b50f..0d3c1c4 100644 --- a/milena/mln/value/internal/convert.hh +++ b/milena/mln/value/internal/convert.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,11 +29,11 @@ #ifndef MLN_VALUE_INTERNAL_CONVERT_HH # define MLN_VALUE_INTERNAL_CONVERT_HH -/*! \file mln/value/internal/convert.hh - * - * \brief Define a conversion between an index and an iterable value. - */ +/// \file mln/value/internal/convert.hh +/// +/// Define a conversion between an index and an iterable value. +# include <mln/core/contract.hh> # include <mln/trait/value_.hh> diff --git a/milena/tests/border/get.cc b/milena/tests/border/get.cc index 88d552a..9cc6602 100644 --- a/milena/tests/border/get.cc +++ b/milena/tests/border/get.cc @@ -66,17 +66,17 @@ int main() I ima(3,3, 51); mln_assertion(border::get(ima) == 51); - mln_assertion( ima.has(point2d(2,2)) == true ); + mln_assertion(ima.has(point2d(2,2)) == true); sub_image<I, box2d> sub(ima, b); - mln_assertion( sub.has (point2d(2,2)) == false && - sub.has(point2d(2,2)) == false ); + mln_assertion(sub.has(point2d(2,2)) == false && + sub.has(point2d(2,2)) == false); mln_assertion(border::get(sub) == 0); image_if<I, f_box2d_t> imaif(ima, f_b); - mln_assertion( imaif.has (point2d(2,2)) == false && - ima.has(point2d(2,2)) == true ); - mln_assertion(border::get(imaif) == 51); + mln_assertion(imaif.has(point2d(2,2)) == false && + ima.has(point2d(2,2)) == true); + mln_assertion(border::get(imaif) == 0); - mln_assertion(border::get( (ima | b) | f_b ) == 0); + mln_assertion(border::get((ima | b) | f_b) == 0); } diff --git a/milena/tests/border/resize_image3d_3.cc b/milena/tests/border/resize_image3d_3.cc index 409d11d..1a94b9c 100644 --- a/milena/tests/border/resize_image3d_3.cc +++ b/milena/tests/border/resize_image3d_3.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/border/resize_image3d_3.cc - * - * \brief Tests on mln::border::resize. - */ +/// \file tests/border/resize_image3d_3.cc +/// +/// Tests on mln::border::resize. #include <mln/core/image/image3d.hh> @@ -41,33 +41,22 @@ using namespace mln; -int -main (void) +int main () { unsigned border = 3; unsigned new_border = 1; - std::cout << std::endl - << "Test 3d resize" - << std::endl - << std::endl; image3d<value::int_u8> ima(1, 3, 2, border); level::fill (ima, 2); border::fill(ima, 8); - std::cout << "before resize (" - << border - << ")" - << std::endl; - debug::println_with_border(ima); - std::cout << std::endl; - + mln_assertion(ima.has(point3d(-3, -3, -3)) == true); + mln_assertion(ima.has(point3d(-4, -4, -4)) == false); border::resize (ima, new_border); - std::cout << "after resize (" - << new_border - << ")" - << std::endl; - debug::println_with_border(ima); - std::cout << std::endl; + mln_assertion(ima.border() == new_border); + mln_assertion(ima.has(point3d(-1, -1, -1)) == true); + mln_assertion(ima.has(point3d(-1, -2, -1)) == false); + mln_assertion(ima.has(point3d(-3, -3, -3)) == false); + mln_assertion(ima.has(point3d(-4, -4, -4)) == false); } diff --git a/milena/tests/border/resize_image_if.cc b/milena/tests/border/resize_image_if.cc index 5b738d3..4ed8522 100644 --- a/milena/tests/border/resize_image_if.cc +++ b/milena/tests/border/resize_image_if.cc @@ -66,15 +66,15 @@ int main() I ima(3,3, border); mln_assertion(border::get(ima) == border); - mln_assertion( ima.has(point2d(2,2)) == true ); + mln_assertion(ima.has(point2d(2,2)) == true); my_box2d f_b(b); image_if<I, my_box2d> imaif(ima, f_b); - mln_assertion( imaif.has(point2d(2,2)) == false && - ima.has(point2d(2,2)) == true ); + mln_assertion(imaif.has(point2d(2,2)) == false && + ima.has(point2d(2,2)) == true); - mln_assertion(border::get(imaif) == border); + mln_assertion(border::get(imaif) == 0); border::resize (imaif, new_border); - mln_assertion(border::get(imaif) == new_border); + mln_assertion(border::get(imaif) == 0); } diff --git a/milena/tests/core/image/Makefile.am b/milena/tests/core/image/Makefile.am index 7d60304..a28dc4e 100644 --- a/milena/tests/core/image/Makefile.am +++ b/milena/tests/core/image/Makefile.am @@ -9,11 +9,11 @@ check_PROGRAMS = \ complex_image \ decorated_image \ flat_image \ -## hexa \ + hexa \ graph_image \ image1d \ image2d \ -## image2d_h \ + image2d_h \ image3d \ image_if \ interpolated \ @@ -36,10 +36,10 @@ complex_image_SOURCES = complex_image.cc decorated_image_SOURCES = decorated_image.cc graph_image_SOURCES = graph_image.cc flat_image_SOURCES = flat_image.cc -##hexa_SOURCES = hexa.cc +hexa_SOURCES = hexa.cc image1d_SOURCES = image1d.cc image2d_SOURCES = image2d.cc -##image2d_h_SOURCES = image2d_h.cc +image2d_h_SOURCES = image2d_h.cc image3d_SOURCES = image3d.cc image_if_SOURCES = image_if.cc interpolated_SOURCES = interpolated.cc diff --git a/milena/tests/core/image/hexa.cc b/milena/tests/core/image/hexa.cc index 7bd7c3a..cd157b4 100644 --- a/milena/tests/core/image/hexa.cc +++ b/milena/tests/core/image/hexa.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,18 +26,18 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/image/hexa.cc - * - * \brief Tests on mln::hexa - */ +/// \file tests/core/image/hexa.cc +/// +/// Tests on mln::hexa + #include <mln/core/image/image2d.hh> #include <mln/core/image/hexa.hh> - #include <mln/value/int_u8.hh> -#include <mln/trait/image/print.hh> #include <mln/debug/iota.hh> +#include <mln/debug/println.hh> +//FIXME: Write a real test!! int main() { @@ -45,15 +46,18 @@ int main() typedef image2d<int_u8> I; - I ima(3,3); - hexa<I> h(ima); + I ima(3,4); + + // FIXME!! The values differs from the test core/image/hexa which + // may be a bug! debug::iota does not seem to behave correctly. debug::iota(ima); - trait::image::print(h, std::cout); + debug::println(ima); + hexa<I> h(ima); + + debug::println(h); - hexa<I>::fwd_piter p(h.domain()); +// mln_piter_(hexa<I>) p(h.domain()); - for_all(p) - { - std::cout << p << "->" << h(p) << std::endl; - } +// for_all(p) +// std::cout << p << " -> " << h(p) << std::endl; } diff --git a/milena/tests/core/image/image2d_h.cc b/milena/tests/core/image/image2d_h.cc index f2d0e2e..53f2690 100644 --- a/milena/tests/core/image/image2d_h.cc +++ b/milena/tests/core/image/image2d_h.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,31 +26,32 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/image/image2d_h.cc - * - * \brief Tests on mln::image2d_h - */ +/// \file tests/core/image/image2d_h.cc +/// +/// Tests on mln::image2d_h #include <mln/core/image/image2d_h.hh> - -#include <mln/value/int_u16.hh> -#include <mln/trait/image/print.hh> +#include <mln/value/int_u8.hh> #include <mln/debug/iota.hh> #include <mln/debug/println.hh> +//FIXME: Write a real test!! int main() { using namespace mln; - using value::int_u16; - - image2d_h<int_u16> h(50,50); + using value::int_u8; - debug::println(h); + image2d_h<int_u8> h(3, 8); + // FIXME!! The values differs from the test core/image/hexa which + // may be a bug! debug::iota does not seem to behave correctly. debug::iota(h); debug::println(h); - trait::image::print(h, std::cout); +// mln_piter_(image2d_h<int_u8>) p(h.domain()); + +// for_all(p) +// std::cout << p << " - > " << h(p) << std::endl; } diff --git a/milena/tests/fun/x2x/rotation.cc b/milena/tests/fun/x2x/rotation.cc index bce3137..7835ac9 100644 --- a/milena/tests/fun/x2x/rotation.cc +++ b/milena/tests/fun/x2x/rotation.cc @@ -31,7 +31,7 @@ /// #include <iostream> -#include <mln/fun/x2v/rotation.hh> +#include <mln/fun/x2x/rotation.hh> #include <mln/core/image/image2d.hh> #include <mln/value/int_u8.hh> #include <mln/io/pgm/load.hh> diff --git a/milena/tests/labeling/relabel.cc b/milena/tests/labeling/relabel.cc index ac1f612..3ffd9c3 100644 --- a/milena/tests/labeling/relabel.cc +++ b/milena/tests/labeling/relabel.cc @@ -37,7 +37,7 @@ #include <mln/debug/println.hh> -struct not_to_removed : public mln::Function_l2b< not_to_removed > +struct not_to_remove : public mln::Function_l2b< not_to_remove > { bool operator()(const mln::value::label_16& l) const { @@ -76,7 +76,7 @@ int main() image2d<label_16> lbl2 = labeling::relabel(lbl, nlabels, new_nlabels, - not_to_removed()); + not_to_remove()); mln_assertion(new_nlabels == 2u); mln_piter_(image2d<label_16>) p(lbl2.domain()); for_all(p) @@ -87,7 +87,7 @@ int main() label_16 new_nlabels; labeling::relabel_inplace(lbl, nlabels, - not_to_removed()); + not_to_remove()); mln_assertion(nlabels == 2u); mln_piter_(image2d<label_16>) p(lbl.domain()); for_all(p) diff --git a/milena/tests/morpho/complex_image_wst.cc b/milena/tests/morpho/complex_image_wst.cc index f6aab30..a1e7cf6 100644 --- a/milena/tests/morpho/complex_image_wst.cc +++ b/milena/tests/morpho/complex_image_wst.cc @@ -26,7 +26,8 @@ // Public License. /// \file tests/morpho/complex_image_swt.cc -/// \brief Testing Meyer's Watershed Transform on mln::complex_image. +/// +/// Testing Meyer's Watershed Transform on mln::complex_image. #include <iostream> #include <fstream> @@ -38,23 +39,24 @@ #include <mln/literal/black.hh> #include <mln/literal/white.hh> +#include <mln/core/concept/function.hh> #include <mln/core/alias/point2d.hh> - #include <mln/core/site_set/p_faces.hh> #include <mln/core/image/complex_image.hh> - // FIXME: Include these elsewhere? (In complex_image.hh?) #include <mln/core/image/complex_neighborhoods.hh> #include <mln/core/image/complex_neighborhood_piter.hh> -#include <mln/debug/iota.hh> #include <mln/level/fill.hh> + #include <mln/norm/l2.hh> #include <mln/morpho/closing_area.hh> #include <mln/morpho/meyer_wst.hh> -#include <mln/core/concept/function.hh> +#include <mln/convert/to.hh> + +#include <mln/debug/iota.hh> // FIXME: To be put elsewhere (from milena/sandbox/geraud/wst_edge.cc). struct colorize : mln::Function_v2v< colorize > @@ -92,12 +94,12 @@ int main() c 0 1 2 3 r .------------------------ | v0 e3 v3 - 0 | o-----------o v0----e3----v3 - | / \ / / \ / - | / \ / / \ / - 1 | e0 / e1 / e4 e0 e1 e4 - | / \ / / \ / - | / \ / / \ / + 0 | o-----------o v0----e3----v3 + | / \ / / \ / + | / \ / / \ / + 1 | e0 / e1 / e4 e0 e1 e4 + | / \ / / \ / + | / \ / / \ / 2 | o-----------o v1----e2----v2 | v1 e2 v2 @@ -168,7 +170,7 @@ int main() v.next(); mln_invariant(!v.is_valid()); - dist_ima(e) = 10 * norm::l2_distance(p1.to_vec(), p2.to_vec()); + dist_ima(e) = convert::to<unsigned>(10 * norm::l2_distance(p1.to_vec(), p2.to_vec())); } // Initialize 0-faces to a dummy value, to prevent the watershed from // finding minima on 0-faces. @@ -195,8 +197,7 @@ int main() `-----------------*/ // Currently, does nothing (lambda = 1). - dist_ima_t closed_dist_ima (dist_ima.domain()); - morpho::closing_area(dist_ima, nbh, 1, closed_dist_ima); + dist_ima_t closed_dist_ima = morpho::closing_area(dist_ima, nbh, 1); /*------. | WST. | diff --git a/milena/tests/morpho/hit_or_miss.cc b/milena/tests/morpho/hit_or_miss.cc index 9b975ae..3ac2226 100644 --- a/milena/tests/morpho/hit_or_miss.cc +++ b/milena/tests/morpho/hit_or_miss.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE) +// 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/morpho/hit_or_miss.cc - * - * \brief Test on mln::morpho::hit_or_miss. - */ +/// \file tests/morpho/hit_or_miss.cc +/// +/// Test on mln::morpho::hit_or_miss. #include <mln/core/image/image2d.hh> #include <mln/value/int_u8.hh> @@ -66,7 +66,7 @@ int main() 0, 0, 1, 1, 1, 0, 0, 1, 1, 1 }; window2d win_hit_ = convert::to<window2d>(hit); - mln_precondition(win_hit_ == win_hit); + mln_assertion(win_hit_ == win_hit); bool miss[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -74,7 +74,7 @@ int main() 1, 1, 0, 0, 0, 1, 1, 0, 0, 0 }; window2d win_miss_ = convert::to<window2d>(miss); - mln_precondition(win_miss_ == win_miss); + mln_assertion(win_miss_ == win_miss); } border::thickness = 2; diff --git a/milena/tests/unit_test/build_unit_test.sh b/milena/tests/unit_test/build_unit_test.sh index 2eb3974..d08a0a6 100755 --- a/milena/tests/unit_test/build_unit_test.sh +++ b/milena/tests/unit_test/build_unit_test.sh @@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then echo "Usage: $0 <mln_path>" fi -HEADERS=`find $1 -name "*.hh" | grep -vE "*.spe.hh" | grep -v "mln/core/doc" | sed -e 's/.*\/mln\/\(.*\)/mln\/\1/g' | sed 's/\.\.\/\.\.\///g'` +HEADERS=`find $1 -name "*.hh" | grep -vE "*.spe.hh" | grep -v "mln/core/concept/doc" | sed -e 's/.*\/mln\/\(.*\)/mln\/\1/g' | sed 's/\.\.\/\.\.\///g'` rm -f Makefile.am rm -f *.hh *.cc -- 1.5.6.5
participants (1)
-
Guillaume Lazzara