1460: Rename point set types after p_something.

https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Rename point set types after p_something. * mln/core/queue_p.hh: Rename as... * mln/core/p_queue.hh: ...this. * mln/core/queue_p_fast.hh: Rename as... * mln/core/p_queue_fast.hh: ...this. * mln/core/queue_p_fast_priority.hh: Rename as... * mln/core/p_priority_queue_fast.hh: ...this. * mln/core/vec_p_piter.hh: Rename as... * mln/core/p_array_piter.hh: ...this. * mln/core/queue_p_priority.hh: Rename as... * mln/core/p_priority_queue.hh: ...this. * mln/core/set_p.hh: Rename as... * mln/core/p_set.hh: ...this. * mln/core/vec_p.hh: Rename as... * mln/core/p_array.hh: ...this. * mln/convert/to_set_p.hh: Rename as... * mln/convert/to_p_set.hh: ...this. * mln/convert/to_vec_p.hh: Rename as... * mln/convert/to_p_array.hh: ...this. * tests/queue_p.cc: Rename as... * tests/core_p_queue.cc: ...this. * tests/set_p.cc: Rename as... * tests/core_p_set.cc: ...this. * tests/queue_p_priority.cc: Rename... * tests/core_p_priority_queue.cc: ...this. * tests/queue_p_fast.cc: Rename as... * tests/core_p_queue_fast.cc: ...this. * tests/queue_p_fast_priority.cc: Rename as... * tests/core_p_priority_queue_fast.cc: ...this. * tests/convert_to_set_p.cc: Rename as... * tests/convert_to_p_set.cc: ...this. * tests/convert_to_vec_p.cc: Rename as... * tests/convert_to_p_array.cc: ...this. * mln/core/p_queue.hh (queue_p): Rename as... (p_queue): ...this. * mln/core/p_queue_fast.hh (queue_p_fast): Rename as... (p_queue_fast): ...this. * mln/core/p_priority_queue_fast.hh (queue_p_fast_priority): Rename as... (p_priority_queue_fast): ...this. * mln/core/p_array_piter.hh (vec_p_fwd_piter, vec_p_bkd_piter): Rename as... (p_array_fwd_piter, p_array_bkd_piter): ...these. * mln/core/p_priority_queue.hh (queue_p_priority): Rename as... (p_priority_queue): ...this. * mln/core/p_set.hh (set_p): Rename as... (p_set): ...this. * mln/core/p_array.hh (vec_p): Rename as... (p_array): ...this. * mln/core/line2d.hh, * mln/level/sort_points.hh, * mln/level/fill.hh, * mln/value/rgb.hh, * mln/convert/all.hh, * mln/geom/seeds2tiling.hh, * mln/geom/seeds2tiling_with_chamfer.hh, * mln/set/inter.hh, * mln/set/diff.hh, * mln/set/uni.hh, * mln/set/sym_diff.hh, * mln/morpho/opening_attribute.hh, * mln/morpho/erosion.spe.hh, * mln/display/color_pretty.hh, * mln/display/all.hh, * mln/util/tree_to_image.hh, * mln/labeling/regional_minima.hh, * mln/labeling/regional_maxima.hh, * tests/morpho_dilation_max_h.cc, * tests/level_sort_points.cc, * tests/morpho_erosion.cc, * tests/morpho_erosion_min_h.cc, * tests/trait_op_uminus.cc, * tests/convert_to_window.cc, * tests/tree_fast_to_image.cc, * tests/tree_to_image.cc, * tests/show.cc, * tests/color_pretty.cc, * tests/morpho_dilation.cc: Update. mln/convert/all.hh | 2 mln/convert/to_p_array.hh | 22 ++++----- mln/convert/to_p_set.hh | 30 ++++++------- mln/core/line2d.hh | 6 +- mln/core/p_array.hh | 46 ++++++++++---------- mln/core/p_array_piter.hh | 58 ++++++++++++------------- mln/core/p_priority_queue.hh | 76 +++++++++++++++++----------------- mln/core/p_priority_queue_fast.hh | 76 +++++++++++++++++----------------- mln/core/p_queue.hh | 52 +++++++++++------------ mln/core/p_queue_fast.hh | 52 +++++++++++------------ mln/core/p_set.hh | 36 ++++++++-------- mln/display/all.hh | 1 mln/display/color_pretty.hh | 26 +++++------ mln/geom/seeds2tiling.hh | 4 - mln/geom/seeds2tiling_with_chamfer.hh | 4 - mln/labeling/regional_maxima.hh | 2 mln/labeling/regional_minima.hh | 2 mln/level/fill.hh | 8 ++- mln/level/sort_points.hh | 24 +++++----- mln/morpho/erosion.spe.hh | 4 + mln/morpho/opening_attribute.hh | 2 mln/set/diff.hh | 8 +-- mln/set/inter.hh | 8 +-- mln/set/sym_diff.hh | 8 +-- mln/set/uni.hh | 8 +-- mln/util/tree_to_image.hh | 12 ++--- mln/value/rgb.hh | 6 +- tests/color_pretty.cc | 8 +-- tests/convert_to_p_array.cc | 64 ++++++++++++++++++++++++++++ tests/convert_to_p_set.cc | 18 ++++---- tests/convert_to_window.cc | 6 +- tests/core_p_priority_queue.cc | 8 +-- tests/core_p_priority_queue_fast.cc | 8 +-- tests/core_p_queue.cc | 8 +-- tests/core_p_queue_fast.cc | 8 +-- tests/core_p_set.cc | 8 +-- tests/level_sort_points.cc | 2 tests/morpho_dilation.cc | 4 - tests/morpho_dilation_max_h.cc | 4 - tests/morpho_erosion.cc | 4 - tests/morpho_erosion_min_h.cc | 4 - tests/show.cc | 2 tests/trait_op_uminus.cc | 2 tests/tree_fast_to_image.cc | 12 ++--- tests/tree_to_image.cc | 6 +- 45 files changed, 415 insertions(+), 344 deletions(-) Index: tests/morpho_dilation_max_h.cc --- tests/morpho_dilation_max_h.cc (revision 1459) +++ tests/morpho_dilation_max_h.cc (working copy) @@ -40,7 +40,7 @@ #include <mln/value/int_u8.hh> #include <mln/morpho/dilation_fast.hh> -#include <mln/convert/to_vec_p.hh> +#include <mln/convert/to_p_array.hh> #include <mln/convert/to_window.hh> @@ -55,7 +55,7 @@ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm"); { - vec_p<point2d> vec = convert::to_vec_p(rec, point2d::origin); + p_array<point2d> vec = convert::to_p_array(rec, point2d::origin); window2d win = convert::to_window(vec); image2d<int_u8> out(lena.domain()); Index: tests/level_sort_points.cc --- tests/level_sort_points.cc (revision 1459) +++ tests/level_sort_points.cc (working copy) @@ -47,7 +47,7 @@ image2d<int_u8> ima(3, 3); debug::iota(ima); - vec_p<point2d> vec; + p_array<point2d> vec; { vec = level::sort_points_increasing(ima); std::cout << vec << std::endl; Index: tests/convert_to_p_set.cc --- tests/convert_to_p_set.cc (revision 1459) +++ tests/convert_to_p_set.cc (working copy) @@ -25,9 +25,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/convert_to_set_p.cc +/*! \file tests/convert_to_p_set.cc * - * \brief Tests on mln::convert::to_set_p. + * \brief Tests on mln::convert::to_p_set. */ #include <mln/core/point2d.hh> @@ -40,11 +40,11 @@ #include <mln/level/fill.hh> -#include <mln/convert/to_set_p.hh> +#include <mln/convert/to_p_set.hh> using namespace mln; - void test(set_p<point2d> ref, set_p<point2d> cmp) + void test(p_set<point2d> ref, p_set<point2d> cmp) { mln_assertion(ref.npoints() = cmp.npoints()); for (unsigned i = 0; i < ref.npoints(); ++i) @@ -59,20 +59,20 @@ c(-1,0), d(0,-1); - set_p<point2d> ref; + p_set<point2d> ref; ref.insert(a).insert(b).insert(c).insert(d); // Reference constructed. // Nbh : neighb2d nbh = c4(); - set_p<point2d> test_nbh = convert::to_set_p(nbh); + p_set<point2d> test_nbh = convert::to_p_set(nbh); test(ref, test_nbh); // Image : image2d<bool> ima(make::box2d(-6, -6, 6, 6)); level::fill(ima, false); level::fill(inplace(ima | ref), true); - set_p<point2d> test_ima = convert::to_set_p(ima); + p_set<point2d> test_ima = convert::to_p_set(ima); test(ref, test_ima); // Window : @@ -82,7 +82,7 @@ .insert(b - point2d::origin) .insert(c - point2d::origin) .insert(d - point2d::origin); - set_p<point2d> test_win = convert::to_set_p(win); + p_set<point2d> test_win = convert::to_p_set(win); test(ref, test_win); // std::set : @@ -91,6 +91,6 @@ set.insert(b); set.insert(c); set.insert(d); - set_p<point2d> test_set = convert::to_set_p(set); + p_set<point2d> test_set = convert::to_p_set(set); test(ref, test_set); } Index: tests/morpho_erosion.cc --- tests/morpho_erosion.cc (revision 1459) +++ tests/morpho_erosion.cc (working copy) @@ -48,7 +48,7 @@ #include <mln/pw/cst.hh> #include <mln/fun/ops.hh> -#include <mln/convert/to_vec_p.hh> +#include <mln/convert/to_p_array.hh> #include <mln/convert/to_window.hh> @@ -91,7 +91,7 @@ } // { -// vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero); +// p_array<point2d> vec = convert::to_p_array(rec, point2d::zero); // window2d win = convert::to_window(vec); // image2d<int_u8> out(lena.domain()); Index: tests/core_p_queue.cc --- tests/core_p_queue.cc (revision 1451) +++ tests/core_p_queue.cc (working copy) @@ -25,13 +25,13 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/queue_p.cc +/*! \file tests/p_queue.cc * - * \brief Tests on mln::queue_p. + * \brief Tests on mln::p_queue. */ #include <mln/core/point2d.hh> -#include <mln/core/queue_p.hh> +#include <mln/core/p_queue.hh> @@ -39,7 +39,7 @@ { using namespace mln; - queue_p<point2d> q; + p_queue<point2d> q; q .push(make::point2d(6, 9)) .push(make::point2d(5, 1)) Index: tests/morpho_erosion_min_h.cc --- tests/morpho_erosion_min_h.cc (revision 1459) +++ tests/morpho_erosion_min_h.cc (working copy) @@ -40,7 +40,7 @@ #include <mln/value/int_u8.hh> #include <mln/morpho/erosion_fast.hh> -#include <mln/convert/to_vec_p.hh> +#include <mln/convert/to_p_array.hh> #include <mln/convert/to_window.hh> @@ -55,7 +55,7 @@ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm"); { - vec_p<point2d> vec = convert::to_vec_p(rec, point2d::origin); + p_array<point2d> vec = convert::to_p_array(rec, point2d::origin); window2d win = convert::to_window(vec); image2d<int_u8> out(lena.domain()); Index: tests/core_p_priority_queue.cc --- tests/core_p_priority_queue.cc (revision 1451) +++ tests/core_p_priority_queue.cc (working copy) @@ -25,19 +25,19 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/queue_p_priority.cc +/*! \file tests/p_priority_queue.cc * - * \brief Tests on mln::queue_p_priority. + * \brief Tests on mln::p_priority_queue. */ #include <mln/core/point2d.hh> -#include <mln/core/queue_p_priority.hh> +#include <mln/core/p_priority_queue.hh> int main () { using namespace mln; - mln::queue_p_priority<point2d, unsigned> q; + mln::p_priority_queue<point2d, unsigned> q; point2d p1 (6, 9); point2d p2 (5, 1); point2d p3 (4, 2); Index: tests/trait_op_uminus.cc --- tests/trait_op_uminus.cc (revision 1459) +++ tests/trait_op_uminus.cc (working copy) @@ -79,7 +79,7 @@ { // template <> -// struct set_precise_unary_< op::uminus, test > +// struct p_setrecise_unary_< op::uminus, test > // { // typedef bool ret; // }; Index: tests/core_p_set.cc --- tests/core_p_set.cc (revision 1451) +++ tests/core_p_set.cc (working copy) @@ -25,15 +25,15 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/set_p.cc +/*! \file tests/p_set.cc * - * \brief Tests on mln::set_p. + * \brief Tests on mln::p_set. */ #include <iterator> #include <mln/core/point2d.hh> -#include <mln/core/set_p.hh> +#include <mln/core/p_set.hh> @@ -41,7 +41,7 @@ { using namespace mln; - set_p<point2d> ps; + p_set<point2d> ps; ps .insert(make::point2d(6, 9)) .insert(make::point2d(4, 2)) Index: tests/convert_to_window.cc --- tests/convert_to_window.cc (revision 1459) +++ tests/convert_to_window.cc (working copy) @@ -41,7 +41,7 @@ #include <mln/level/fill.hh> #include <mln/convert/to_window.hh> -#include <mln/convert/to_set_p.hh> +#include <mln/convert/to_p_set.hh> using namespace mln; @@ -72,12 +72,12 @@ // Image : image2d<bool> ima(make::box2d(-6, -6, 6, 6)); level::fill(ima, false); - level::fill(inplace(ima | convert::to_set_p(ref)), true); + level::fill(inplace(ima | convert::to_p_set(ref)), true); window2d test_ima = convert::to_window(ima); test(ref, test_ima); // Window : - set_p<point2d> setp; + p_set<point2d> setp; setp .insert(point2d::origin + a) .insert(point2d::origin + b) Index: tests/core_p_priority_queue_fast.cc --- tests/core_p_priority_queue_fast.cc (revision 1451) +++ tests/core_p_priority_queue_fast.cc (working copy) @@ -25,19 +25,19 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/queue_p_fast_priority.cc +/*! \file tests/p_priority_queue_fast.cc * - * \brief Tests on mln::queue_p_fast_priority. + * \brief Tests on mln::p_priority_queue_fast. */ #include <mln/core/point2d.hh> -#include <mln/core/queue_p_fast_priority.hh> +#include <mln/core/p_priority_queue_fast.hh> int main () { using namespace mln; - mln::queue_p_fast_priority<point2d, unsigned> q; + mln::p_priority_queue_fast<point2d, unsigned> q; point2d p1 (6, 9); point2d p2 (5, 1); point2d p3 (4, 2); Index: tests/convert_to_p_array.cc --- tests/convert_to_p_array.cc (revision 0) +++ tests/convert_to_p_array.cc (revision 0) @@ -0,0 +1,64 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// 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. + +/*! \file tests/convert_to_p_array.cc + * + * \brief Tests on mln::convert::to_p_array. + */ + +#include <mln/core/point1d.hh> +#include <mln/core/point2d.hh> +#include <mln/core/p_array.hh> + +#include <mln/win/segment1d.hh> +#include <mln/win/rectangle2d.hh> + +#include <mln/convert/to_p_array.hh> + +int main() +{ + using namespace mln; + + typedef p_array<point1d> vec1d; + point1d p1 = make::point1d(6); + win::segment1d win1d(5); + vec1d v1(convert::to_p_array(win1d, p1)); + + for (size_t i=0; i < v1.npoints(); i++) + std::cout << (v1[i]); + + std::cout << "\n"; + + typedef p_array<point2d> vec2d; + point2d p2 = make::point2d(10,10); + win::rectangle2d win2d(3, 3); + vec2d v2(convert::to_p_array(win2d, p2)); + + for (size_t i=0; i < v2.npoints(); i++) + std::cout << (v2[i]); + +} Index: tests/tree_fast_to_image.cc --- tests/tree_fast_to_image.cc (revision 1459) +++ tests/tree_fast_to_image.cc (working copy) @@ -34,7 +34,7 @@ #include <mln/core/contract.hh> #include <mln/core/image2d.hh> -#include <mln/core/set_p.hh> +#include <mln/core/p_set.hh> #include <mln/value/int_u8.hh> #include <mln/level/stretch.hh> #include <mln/io/pgm/save.hh> @@ -46,16 +46,16 @@ struct fllt_node { V value; - mln::set_p<P> points; - mln::set_p<P> holes; + mln::p_set<P> points; + mln::p_set<P> holes; }; template <typename P, typename V> -bool operator=(const mln::set_p<P>& lhs, const mln::set_p<P>& rhs) +bool operator=(const mln::p_set<P>& lhs, const mln::p_set<P>& rhs) { std::size_t n = lhs.npoints (); - mln::set_p<P> tmp; + mln::p_set<P> tmp; if (n != rhs.npoints ()) return false; @@ -87,7 +87,7 @@ using namespace mln; using value::int_u8; - typedef set_p<point2d > I; + typedef p_set<point2d > I; typedef fllt_node<point2d, int_u8> T; T s1; Index: tests/tree_to_image.cc --- tests/tree_to_image.cc (revision 1459) +++ tests/tree_to_image.cc (working copy) @@ -35,7 +35,7 @@ #include <mln/util/tree.hh> #include <mln/core/contract.hh> #include <mln/core/image2d.hh> -#include <mln/core/set_p.hh> +#include <mln/core/p_set.hh> #include <mln/value/int_u8.hh> #include <mln/level/stretch.hh> #include <mln/level/fill.hh> @@ -48,8 +48,8 @@ struct fllt_node { V value; - mln::set_p<P> points; - mln::set_p<P> holes; + mln::p_set<P> points; + mln::p_set<P> holes; }; Index: tests/show.cc --- tests/show.cc (revision 1459) +++ tests/show.cc (working copy) @@ -65,7 +65,7 @@ image2d<unsigned> tmp = geom::chamfer(input, w_win, max); // Call color_pretty for sub_image. - for (unsigned i = 2; i < 22; i += 2) + for (unsigned i = 2; i < 6; i += 2) { image_if_value<image2d<unsigned> > t = inplace (tmp | i); display::save (t); Index: tests/color_pretty.cc --- tests/color_pretty.cc (revision 1459) +++ tests/color_pretty.cc (working copy) @@ -41,7 +41,7 @@ # include <mln/core/w_window2d_int.hh> # include <mln/display/color_pretty.hh> # include <mln/io/ppm/save.hh> -# include <mln/core/set_p.hh> +# include <mln/core/p_set.hh> int main() @@ -62,9 +62,9 @@ // Call chamfer for a distance image. image2d<unsigned> tmp = geom::chamfer(input, w_win, max); - set_p<point2d > s1; - set_p<point2d > s2; - set_p<point2d > s3; + p_set<point2d > s1; + p_set<point2d > s2; + p_set<point2d > s3; // typedef image_if_value<image2d<unsigned> > I; Index: tests/morpho_dilation.cc --- tests/morpho_dilation.cc (revision 1459) +++ tests/morpho_dilation.cc (working copy) @@ -48,7 +48,7 @@ #include <mln/pw/cst.hh> #include <mln/fun/ops.hh> -#include <mln/convert/to_vec_p.hh> +#include <mln/convert/to_p_array.hh> #include <mln/convert/to_window.hh> @@ -76,7 +76,7 @@ } // { -// vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero); +// p_array<point2d> vec = convert::to_p_array(rec, point2d::zero); // window2d win = convert::to_window(vec); // image2d<int_u8> out(lena.domain()); Index: tests/core_p_queue_fast.cc --- tests/core_p_queue_fast.cc (revision 1451) +++ tests/core_p_queue_fast.cc (working copy) @@ -25,13 +25,13 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/queue_p_fast.cc +/*! \file tests/p_queue_fast.cc * - * \brief Tests on mln::queue_p_fast. + * \brief Tests on mln::p_queue_fast. */ #include <mln/core/point2d.hh> -#include <mln/core/queue_p_fast.hh> +#include <mln/core/p_queue_fast.hh> @@ -39,7 +39,7 @@ { using namespace mln; - queue_p_fast<point2d> q; + p_queue_fast<point2d> q; q .push(make::point2d(6, 9)) .push(make::point2d(5, 1)) Index: mln/core/p_queue.hh --- mln/core/p_queue.hh (revision 1451) +++ mln/core/p_queue.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_CORE_QUEUE_P_HH # define MLN_CORE_QUEUE_P_HH -/*! \file mln/core/queue_p.hh +/*! \file mln/core/p_queue.hh * * \brief Definition of a point set class based on std::deque. */ @@ -39,7 +39,7 @@ # include <iterator> # include <mln/core/internal/point_set_base.hh> -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> # include <mln/accu/bbox.hh> @@ -47,8 +47,8 @@ { // Fwd decls. - template <typename P> struct vec_p_fwd_piter_; - template <typename P> struct vec_p_bkd_piter_; + template <typename P> struct p_array_fwd_piter_; + template <typename P> struct p_array_bkd_piter_; /*! \brief Point queue class (based on std::deque). @@ -63,18 +63,18 @@ * a call to npoints() when this container is multiple. */ template <typename P> - class queue_p : public internal::point_set_base_< P, queue_p<P> > + class p_queue : public internal::point_set_base_< P, p_queue<P> > { public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - queue_p(); + p_queue(); /// Test is \p p belongs to this point set. bool has(const P& p) const; @@ -89,10 +89,10 @@ const box_<P>& bbox() const; /// Push force a point \p p in the queue. - queue_p<P>& push_force(const P& p); + p_queue<P>& push_force(const P& p); /// Push a point \p p in the queue. - queue_p<P>& push(const P& p); + p_queue<P>& push(const P& p); /// Pop (remove) the front point \p p from the queue; \p p is the /// least recently inserted point. @@ -130,7 +130,7 @@ # ifndef MLN_INCLUDE_ONLY template <typename P> - queue_p<P>::queue_p() + p_queue<P>::p_queue() { vect_needs_update_ = false; bb_needs_update_ = false; @@ -138,7 +138,7 @@ template <typename P> void - queue_p<P>::vect_update_() const + p_queue<P>::vect_update_() const { vect_.clear(); vect_.reserve(q_.size()); @@ -149,7 +149,7 @@ template <typename P> void - queue_p<P>::bb_update_() const + p_queue<P>::bb_update_() const { bb_.init(); for (unsigned i = 0; i < q_.size(); ++i) @@ -159,7 +159,7 @@ template <typename P> bool - queue_p<P>::has(const P& p) const + p_queue<P>::has(const P& p) const { for (unsigned i = 0; i < q_.size(); ++i) if (q_[i] = p) @@ -169,21 +169,21 @@ template <typename P> bool - queue_p<P>::empty() const + p_queue<P>::empty() const { return (q_.empty()); } template <typename P> std::size_t - queue_p<P>::npoints() const + p_queue<P>::npoints() const { return q_.size(); } template <typename P> const box_<P>& - queue_p<P>::bbox() const + p_queue<P>::bbox() const { mln_precondition(npoints() != 0); if (bb_needs_update_) @@ -192,8 +192,8 @@ } template <typename P> - queue_p<P>& - queue_p<P>::push_force(const P& p) + p_queue<P>& + p_queue<P>::push_force(const P& p) { q_.push_back(p); if (! vect_needs_update_) @@ -205,8 +205,8 @@ } template <typename P> - queue_p<P>& - queue_p<P>::push(const P& p) + p_queue<P>& + p_queue<P>::push(const P& p) { mln_precondition(! has(p)); // FIXME: Our choice is "error if multiple insertions" @@ -215,7 +215,7 @@ template <typename P> void - queue_p<P>::pop() + p_queue<P>::pop() { q_.pop_front(); if (! vect_needs_update_) @@ -227,7 +227,7 @@ template <typename P> const P& - queue_p<P>::front() const + p_queue<P>::front() const { mln_precondition(! q_.empty()); return q_.front(); @@ -235,7 +235,7 @@ template <typename P> void - queue_p<P>::clear() + p_queue<P>::clear() { q_.clear(); vect_.clear(); @@ -245,7 +245,7 @@ template <typename P> const std::vector<P>& - queue_p<P>::vect() const + p_queue<P>::vect() const { if (vect_needs_update_) vect_update_(); @@ -254,7 +254,7 @@ template <typename P> const P& - queue_p<P>::operator[](unsigned i) const + p_queue<P>::operator[](unsigned i) const { mln_precondition(i < npoints()); return q_[i]; Index: mln/core/p_priority_queue_fast.hh --- mln/core/p_priority_queue_fast.hh (revision 1451) +++ mln/core/p_priority_queue_fast.hh (working copy) @@ -28,9 +28,9 @@ #ifndef MLN_CORE_QUEUE_P_FAST_PRIORITY_HH # define MLN_CORE_QUEUE_P_FAST_PRIORITY_HH -/*! \file mln/core/queue_p_fast_priority.hh +/*! \file mln/core/p_priority_queue_fast.hh * - * \brief Definition of a point set class based on queue_p_fast with + * \brief Definition of a point set class based on p_queue_fast with * priority features. */ @@ -41,16 +41,16 @@ # include <iterator> # include <mln/core/internal/point_set_base.hh> -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> # include <mln/accu/bbox.hh> -# include <mln/core/queue_p_fast.hh> +# include <mln/core/p_queue_fast.hh> namespace mln { // Fwd decls. - template <typename P> struct vec_p_fwd_piter_; - template <typename P> struct vec_p_bkd_piter_; + template <typename P> struct p_array_fwd_piter_; + template <typename P> struct p_array_bkd_piter_; /*! \brief Point queue class (based on std::deque). @@ -65,18 +65,18 @@ * a call to npoints() when this container is multiple. */ template <typename P, typename T> - class queue_p_fast_priority : public internal::point_set_base_< P, queue_p_fast_priority<P, T> > + class p_priority_queue_fast : public internal::point_set_base_< P, p_priority_queue_fast<P, T> > { public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - queue_p_fast_priority(); + p_priority_queue_fast(); /// Test is \p p belongs to this point set. bool has(const P& p) const; @@ -91,10 +91,10 @@ const box_<P>& bbox() const; /// Push force a point \p p in the queue. - queue_p_fast_priority<P, T>& push_force(const P& p, T prio = 0); + p_priority_queue_fast<P, T>& push_force(const P& p, T prio = 0); /// Push a point \p p in the queue. - queue_p_fast_priority<P, T>& push(const P& p, T prio = 0); + p_priority_queue_fast<P, T>& push(const P& p, T prio = 0); /// Pop (remove) the front point \p p from the queue; \p p is the /// least recently inserted point. @@ -115,7 +115,7 @@ protected: - std::map<const T, queue_p_fast<P> > q_; + std::map<const T, p_queue_fast<P> > q_; mutable std::vector<P> vect_; mutable bool vect_needs_update_; @@ -132,7 +132,7 @@ # ifndef MLN_INCLUDE_ONLY template <typename P, typename T> - queue_p_fast_priority<P, T>::queue_p_fast_priority() + p_priority_queue_fast<P, T>::p_priority_queue_fast() { vect_needs_update_ = false; bb_needs_update_ = false; @@ -140,12 +140,12 @@ template <typename P, typename T> void - queue_p_fast_priority<P, T>::vect_update_() const + p_priority_queue_fast<P, T>::vect_update_() const { vect_.clear(); vect_.reserve(npoints()); - typename std::map<T, queue_p_fast<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) std::copy((*it).second.vect().begin(), (*it).second.vect().end(), @@ -155,11 +155,11 @@ template <typename P, typename T> void - queue_p_fast_priority<P, T>::bb_update_() const + p_priority_queue_fast<P, T>::bb_update_() const { bb_.init(); - typename std::map<T, queue_p_fast<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) for (unsigned i = 0; i < (*it).second.npoints (); ++i) @@ -170,9 +170,9 @@ template <typename P, typename T> bool - queue_p_fast_priority<P, T>::has(const P& p) const + p_priority_queue_fast<P, T>::has(const P& p) const { - typename std::map<T, queue_p_fast<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if ((*it).second.has (p)) @@ -182,9 +182,9 @@ template <typename P, typename T> bool - queue_p_fast_priority<P, T>::empty() const + p_priority_queue_fast<P, T>::empty() const { - typename std::map<T, queue_p_fast<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if (!(*it).second.empty ()) @@ -194,11 +194,11 @@ template <typename P, typename T> unsigned - queue_p_fast_priority<P, T>::npoints() const + p_priority_queue_fast<P, T>::npoints() const { unsigned res = 0; - typename std::map<T, queue_p_fast<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if (!(*it).second.empty ()) @@ -208,7 +208,7 @@ template <typename P, typename T> const box_<P>& - queue_p_fast_priority<P, T>::bbox() const + p_priority_queue_fast<P, T>::bbox() const { mln_precondition(npoints() != 0); if (bb_needs_update_) @@ -217,8 +217,8 @@ } template <typename P, typename T> - queue_p_fast_priority<P, T>& - queue_p_fast_priority<P, T>::push_force(const P& p, T prio) + p_priority_queue_fast<P, T>& + p_priority_queue_fast<P, T>::push_force(const P& p, T prio) { q_[prio].push_force (p); if (! vect_needs_update_) @@ -230,8 +230,8 @@ } template <typename P, typename T> - queue_p_fast_priority<P, T>& - queue_p_fast_priority<P, T>::push(const P& p, T prio) + p_priority_queue_fast<P, T>& + p_priority_queue_fast<P, T>::push(const P& p, T prio) { if (! has(p)) return this->push_force(p, prio); @@ -241,9 +241,9 @@ template <typename P, typename T> void - queue_p_fast_priority<P, T>::pop() + p_priority_queue_fast<P, T>::pop() { - typename std::map<T, queue_p_fast<P> >::reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue_fast<P> >::reverse_iterator it = q_.rbegin (); for (; it != q_.rend (); ++it) if (!(*it).second.empty ()) @@ -258,11 +258,11 @@ template <typename P, typename T> const P& - queue_p_fast_priority<P, T>::front() const + p_priority_queue_fast<P, T>::front() const { mln_precondition(! q_.empty()); - typename std::map<T, queue_p_fast<P> >::const_reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue_fast<P> >::const_reverse_iterator it = q_.rbegin (); for (; it != q_.rend (); ++it) if (!(*it).second.empty ()) @@ -272,9 +272,9 @@ template <typename P, typename T> void - queue_p_fast_priority<P, T>::clear() + p_priority_queue_fast<P, T>::clear() { - typename std::map<T, queue_p_fast<P> >::iterator it = q_.begin (); + typename std::map<T, p_queue_fast<P> >::iterator it = q_.begin (); for (; it != q_.end (); ++it) (*it).second.clear (); @@ -285,7 +285,7 @@ template <typename P, typename T> const std::vector<P>& - queue_p_fast_priority<P, T>::vect() const + p_priority_queue_fast<P, T>::vect() const { if (vect_needs_update_) vect_update_(); @@ -294,11 +294,11 @@ template <typename P, typename T> const P& - queue_p_fast_priority<P, T>::operator[](unsigned i) const + p_priority_queue_fast<P, T>::operator[](unsigned i) const { mln_precondition(i < npoints()); - typename std::map<T, queue_p_fast<P> >::const_reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue_fast<P> >::const_reverse_iterator it = q_.rbegin (); unsigned cpt = 0; for (; it != q_.rend (); ++it) Index: mln/core/p_priority_queue.hh --- mln/core/p_priority_queue.hh (revision 1459) +++ mln/core/p_priority_queue.hh (working copy) @@ -28,9 +28,9 @@ #ifndef MLN_CORE_QUEUE_P_PRIORITY_HH # define MLN_CORE_QUEUE_P_PRIORITY_HH -/*! \file mln/core/queue_p_priority.hh +/*! \file mln/core/p_queue_priority.hh * - * \brief Definition of a point set class based on queue_p with + * \brief Definition of a point set class based on p_queue with * priority features. */ @@ -41,16 +41,16 @@ # include <iterator> # include <mln/core/internal/point_set_base.hh> -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> # include <mln/accu/bbox.hh> -# include <mln/core/queue_p.hh> +# include <mln/core/p_queue.hh> namespace mln { // Fwd decls. - template <typename P> struct vec_p_fwd_piter_; - template <typename P> struct vec_p_bkd_piter_; + template <typename P> struct p_array_fwd_piter_; + template <typename P> struct p_array_bkd_piter_; /*! \brief Point queue class (based on std::deque). @@ -65,18 +65,18 @@ * a call to npoints() when this container is multiple. */ template <typename P, typename T> - class queue_p_priority : public internal::point_set_base_< P, queue_p_priority<P, T> > + class p_queue_priority : public internal::point_set_base_< P, p_queue_priority<P, T> > { public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - queue_p_priority(); + p_queue_priority(); /// Test is \p p belongs to this point set. bool has(const P& p) const; @@ -91,10 +91,10 @@ const box_<P>& bbox() const; /// Push force a point \p p in the queue. - queue_p_priority<P, T>& push_force(const P& p, T prio = 0); + p_queue_priority<P, T>& push_force(const P& p, T prio = 0); /// Push a point \p p in the queue. - queue_p_priority<P, T>& push(const P& p, T prio = 0); + p_queue_priority<P, T>& push(const P& p, T prio = 0); /// Pop (remove) the front point \p p from the queue; \p p is the /// least recently inserted point. @@ -115,7 +115,7 @@ protected: - std::map<const T, queue_p<P> > q_; + std::map<const T, p_queue<P> > q_; mutable std::vector<P> vect_; mutable bool vect_needs_update_; @@ -132,7 +132,7 @@ # ifndef MLN_INCLUDE_ONLY template <typename P, typename T> - queue_p_priority<P, T>::queue_p_priority() + p_queue_priority<P, T>::p_queue_priority() { vect_needs_update_ = false; bb_needs_update_ = false; @@ -140,12 +140,12 @@ template <typename P, typename T> void - queue_p_priority<P, T>::vect_update_() const + p_queue_priority<P, T>::vect_update_() const { vect_.clear(); vect_.reserve(npoints()); - typename std::map<T, queue_p<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) std::copy((*it).second.vect().begin(), (*it).second.vect().end(), @@ -155,11 +155,11 @@ template <typename P, typename T> void - queue_p_priority<P, T>::bb_update_() const + p_queue_priority<P, T>::bb_update_() const { bb_.init(); - typename std::map<T, queue_p<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) for (unsigned i = 0; i < (*it).second.npoints (); ++i) @@ -170,9 +170,9 @@ template <typename P, typename T> bool - queue_p_priority<P, T>::has(const P& p) const + p_queue_priority<P, T>::has(const P& p) const { - typename std::map<T, queue_p<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if ((*it).second.has (p)) @@ -182,9 +182,9 @@ template <typename P, typename T> bool - queue_p_priority<P, T>::empty() const + p_queue_priority<P, T>::empty() const { - typename std::map<T, queue_p<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if (!(*it).second.empty ()) @@ -194,11 +194,11 @@ template <typename P, typename T> unsigned - queue_p_priority<P, T>::npoints() const + p_queue_priority<P, T>::npoints() const { unsigned res = 0; - typename std::map<T, queue_p<P> >::const_iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::const_iterator it = q_.begin (); for (; it != q_.end (); ++it) if (!(*it).second.empty ()) @@ -208,7 +208,7 @@ template <typename P, typename T> const box_<P>& - queue_p_priority<P, T>::bbox() const + p_queue_priority<P, T>::bbox() const { mln_precondition(npoints() != 0); if (bb_needs_update_) @@ -217,8 +217,8 @@ } template <typename P, typename T> - queue_p_priority<P, T>& - queue_p_priority<P, T>::push_force(const P& p, T prio) + p_queue_priority<P, T>& + p_queue_priority<P, T>::push_force(const P& p, T prio) { q_[prio].push_force (p); if (! vect_needs_update_) @@ -230,8 +230,8 @@ } template <typename P, typename T> - queue_p_priority<P, T>& - queue_p_priority<P, T>::push(const P& p, T prio) + p_queue_priority<P, T>& + p_queue_priority<P, T>::push(const P& p, T prio) { if (! has(p)) return this->push_force(p, prio); @@ -241,9 +241,9 @@ template <typename P, typename T> void - queue_p_priority<P, T>::pop() + p_queue_priority<P, T>::pop() { - typename std::map<T, queue_p<P> >::reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue<P> >::reverse_iterator it = q_.rbegin (); for (; it != q_.rend (); ++it) if (!(*it).second.empty ()) @@ -258,11 +258,11 @@ template <typename P, typename T> const P& - queue_p_priority<P, T>::front() const + p_queue_priority<P, T>::front() const { mln_precondition(! q_.empty()); - typename std::map<T, queue_p<P> >::const_reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue<P> >::const_reverse_iterator it = q_.rbegin (); for (; it != q_.rend (); ++it) if (!(*it).second.empty ()) @@ -272,9 +272,9 @@ template <typename P, typename T> void - queue_p_priority<P, T>::clear() + p_queue_priority<P, T>::clear() { - typename std::map<T, queue_p<P> >::iterator it = q_.begin (); + typename std::map<T, p_queue<P> >::iterator it = q_.begin (); for (; it != q_.end (); ++it) (*it).second.clear (); @@ -285,7 +285,7 @@ template <typename P, typename T> const std::vector<P>& - queue_p_priority<P, T>::vect() const + p_queue_priority<P, T>::vect() const { if (vect_needs_update_) vect_update_(); @@ -294,11 +294,11 @@ template <typename P, typename T> const P& - queue_p_priority<P, T>::operator[](unsigned i) const + p_queue_priority<P, T>::operator[](unsigned i) const { mln_precondition(i < npoints()); - typename std::map<T, queue_p<P> >::const_reverse_iterator it = q_.rbegin (); + typename std::map<T, p_queue<P> >::const_reverse_iterator it = q_.rbegin (); unsigned cpt = 0; for (; it != q_.rend (); ++it) Index: mln/core/p_set.hh --- mln/core/p_set.hh (revision 1451) +++ mln/core/p_set.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_CORE_SET_P_HH # define MLN_CORE_SET_P_HH -/*! \file mln/core/set_p.hh +/*! \file mln/core/p_set.hh * * \brief Definition of a point set class based on std::set. */ @@ -36,7 +36,7 @@ # include <mln/core/internal/point_set_base.hh> # include <mln/core/internal/set_of.hh> # include <mln/accu/bbox.hh> -# include <mln/core/vec_p.hh> +# include <mln/core/p_array.hh> namespace mln @@ -50,7 +50,7 @@ * \todo Test if \p P being a Point_Site is ok. */ template <typename P> - class set_p : public internal::point_set_base_< P, set_p<P> >, + class p_set : public internal::point_set_base_< P, p_set<P> >, private internal::set_of_<P> { typedef internal::set_of_<P> super_; @@ -58,13 +58,13 @@ public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - set_p(); + p_set(); /// Test is \p p belongs to this point set. bool has(const P& p) const; @@ -76,11 +76,11 @@ std::size_t npoints() const; /// Insert a point \p p. - set_p<P>& insert(const P& p); + p_set<P>& insert(const P& p); // FIXME : doesn't compile // /// Remove a point \p p. - // set_p<P>& remove(P& p); + // p_set<P>& remove(P& p); /// Return the \p i-th point. const P& operator[](unsigned i) const; @@ -101,27 +101,27 @@ # ifndef MLN_INCLUDE_ONLY template <typename P> - set_p<P>::set_p() + p_set<P>::p_set() { } template <typename P> bool - set_p<P>::has(const P& p) const + p_set<P>::has(const P& p) const { return this->super_::has(p); } template <typename P> std::size_t - set_p<P>::npoints() const + p_set<P>::npoints() const { return this->super_::nelements(); } template <typename P> - set_p<P>& - set_p<P>::insert(const P& p) + p_set<P>& + p_set<P>::insert(const P& p) { this->super_::insert(p); bb_.take(p); @@ -131,8 +131,8 @@ // FIXME : finish it. // template <typename P> - // set_p<P>& - // set_p<P>::remove(P& p) + // p_set<P>& + // p_set<P>::remove(P& p) // { // this->super_::remove(p); // // FIXME: need to rebuild bb_ ? @@ -142,7 +142,7 @@ template <typename P> const P& - set_p<P>::operator[](unsigned i) const + p_set<P>::operator[](unsigned i) const { mln_precondition(i < npoints()); return this->super_::element(i); @@ -150,7 +150,7 @@ template <typename P> void - set_p<P>::clear() + p_set<P>::clear() { this->super_::clear(); bb_.init(); @@ -158,7 +158,7 @@ template <typename P> const box_<mln_point(P)>& - set_p<P>::bbox() const + p_set<P>::bbox() const { mln_precondition(npoints() != 0); return bb_.to_result(); Index: mln/core/line2d.hh --- mln/core/line2d.hh (revision 1459) +++ mln/core/line2d.hh (working copy) @@ -36,7 +36,7 @@ # include <vector> # include <mln/core/internal/point_set_base.hh> -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> # include <mln/core/box2d.hh> # include <mln/math/all.hh> @@ -52,10 +52,10 @@ public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<point2d> fwd_piter; + typedef p_array_fwd_piter_<point2d> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<point2d> bkd_piter; + typedef p_array_bkd_piter_<point2d> bkd_piter; /// Constructor from point \p beg to point \p end. Index: mln/core/p_queue_fast.hh --- mln/core/p_queue_fast.hh (revision 1451) +++ mln/core/p_queue_fast.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_CORE_QUEUE_P_FAST_HH # define MLN_CORE_QUEUE_P_FAST_HH -/*! \file mln/core/queue_p_fast.hh +/*! \file mln/core/p_queue_fast.hh * * \brief Definition of a point set class faster but needs more memory * space. @@ -40,7 +40,7 @@ # include <iterator> # include <mln/core/internal/point_set_base.hh> -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> # include <mln/accu/bbox.hh> @@ -48,8 +48,8 @@ { // Fwd decls. - template <typename P> struct vec_p_fwd_piter_; - template <typename P> struct vec_p_bkd_piter_; + template <typename P> struct p_array_fwd_piter_; + template <typename P> struct p_array_bkd_piter_; /*! \brief Point queue class (based on std::deque). @@ -64,18 +64,18 @@ * a call to npoints() when this container is multiple. */ template <typename P> - class queue_p_fast : public internal::point_set_base_< P, queue_p_fast<P> > + class p_queue_fast : public internal::point_set_base_< P, p_queue_fast<P> > { public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - queue_p_fast(); + p_queue_fast(); /// Test is \p p belongs to this point set. bool has(const P& p) const; @@ -90,10 +90,10 @@ const box_<P>& bbox() const; /// Push force a point \p p in the queue. - queue_p_fast<P>& push_force(const P& p); + p_queue_fast<P>& push_force(const P& p); /// Push a point \p p in the queue. - queue_p_fast<P>& push(const P& p); + p_queue_fast<P>& push(const P& p); /// Pop (remove) the front point \p p from the queue; \p p is the /// least recently inserted point. @@ -132,7 +132,7 @@ # ifndef MLN_INCLUDE_ONLY template <typename P> - queue_p_fast<P>::queue_p_fast() + p_queue_fast<P>::p_queue_fast() { // vect_needs_update_ = false; bb_needs_update_ = false; @@ -142,7 +142,7 @@ template <typename P> void - queue_p_fast<P>::vect_update_() const + p_queue_fast<P>::vect_update_() const { vect_.clear(); vect_.reserve(q_.size()); @@ -153,7 +153,7 @@ template <typename P> void - queue_p_fast<P>::bb_update_() const + p_queue_fast<P>::bb_update_() const { bb_.init(); for (std::size_t i = this->begin_; i < this->end_; ++i) @@ -163,7 +163,7 @@ template <typename P> bool - queue_p_fast<P>::has(const P& p) const + p_queue_fast<P>::has(const P& p) const { for (unsigned i = this->begin_; i < this->end_; ++i) if (q_[i] = p) @@ -173,14 +173,14 @@ template <typename P> bool - queue_p_fast<P>::empty() const + p_queue_fast<P>::empty() const { return (this->begin_ = this->end_); } template <typename P> std::size_t - queue_p_fast<P>::npoints() const + p_queue_fast<P>::npoints() const { mln_precondition(this->end_ >= this->begin_); return (this->end_ - this->begin_); @@ -188,7 +188,7 @@ template <typename P> const box_<P>& - queue_p_fast<P>::bbox() const + p_queue_fast<P>::bbox() const { mln_precondition(npoints() != 0); if (bb_needs_update_) @@ -197,8 +197,8 @@ } template <typename P> - queue_p_fast<P>& - queue_p_fast<P>::push_force(const P& p) + p_queue_fast<P>& + p_queue_fast<P>::push_force(const P& p) { q_.push_back(p); ++this->end_; @@ -211,8 +211,8 @@ } template <typename P> - queue_p_fast<P>& - queue_p_fast<P>::push(const P& p) + p_queue_fast<P>& + p_queue_fast<P>::push(const P& p) { mln_precondition(! this->has(p)); // FIXME: Our choice is "error if multiple insertions" @@ -221,7 +221,7 @@ template <typename P> void - queue_p_fast<P>::pop() + p_queue_fast<P>::pop() { ++this->begin_; // q_.pop_front(); @@ -234,7 +234,7 @@ template <typename P> const P& - queue_p_fast<P>::front() const + p_queue_fast<P>::front() const { mln_precondition(! this->empty()); return q_[begin_]; @@ -242,7 +242,7 @@ template <typename P> void - queue_p_fast<P>::clear() + p_queue_fast<P>::clear() { this->end_ = begin_; // q_.clear(); @@ -253,7 +253,7 @@ template <typename P> const std::vector<P>& - queue_p_fast<P>::vect() const + p_queue_fast<P>::vect() const { if (vect_needs_update_) vect_update_(); @@ -262,7 +262,7 @@ template <typename P> const P& - queue_p_fast<P>::operator[](unsigned i) const + p_queue_fast<P>::operator[](unsigned i) const { mln_precondition(i < npoints()); return q_[begin_ + i]; Index: mln/core/p_array.hh --- mln/core/p_array.hh (revision 1451) +++ mln/core/p_array.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_CORE_VEC_P_HH # define MLN_CORE_VEC_P_HH -/*! \file mln/core/vec_p.hh +/*! \file mln/core/p_array.hh * * \brief Definition of a point set class based on std::vector. */ @@ -43,8 +43,8 @@ { // Fwd decls. - template <typename P> struct vec_p_fwd_piter_; - template <typename P> struct vec_p_bkd_piter_; + template <typename P> struct p_array_fwd_piter_; + template <typename P> struct p_array_bkd_piter_; /*! \brief Point set class based on std::vector. @@ -57,21 +57,21 @@ * \todo Make it work with P being a Point_Site. */ template <typename P> - class vec_p : public internal::point_set_base_< P, vec_p<P> > + class p_array : public internal::point_set_base_< P, p_array<P> > { public: /// Forward Point_Iterator associated type. - typedef vec_p_fwd_piter_<P> fwd_piter; + typedef p_array_fwd_piter_<P> fwd_piter; /// Backward Point_Iterator associated type. - typedef vec_p_bkd_piter_<P> bkd_piter; + typedef p_array_bkd_piter_<P> bkd_piter; /// Constructor. - vec_p(); + p_array(); /// Constructor from a vector \p vect. - vec_p(const std::vector<P>& vect); + p_array(const std::vector<P>& vect); /// Reserve \p n cells. void reserve(std::size_t n); @@ -86,7 +86,7 @@ const box_<P>& bbox() const; /// Append a point \p p. - vec_p<P>& append(const P& p); + p_array<P>& append(const P& p); /// Clear this set. void clear(); @@ -115,13 +115,13 @@ # ifndef MLN_INCLUDE_ONLY template <typename P> - vec_p<P>::vec_p() + p_array<P>::p_array() { bb_needs_update_ = false; } template <typename P> - vec_p<P>::vec_p(const std::vector<P>& vect) + p_array<P>::p_array(const std::vector<P>& vect) : vect_(vect) { bb_needs_update_ = true; @@ -129,21 +129,21 @@ template <typename P> void - vec_p<P>::reserve(std::size_t n) + p_array<P>::reserve(std::size_t n) { vect_.reserve(n); } template <typename P> std::vector<P>& - vec_p<P>::hook_() + p_array<P>::hook_() { return vect_; } template <typename P> void - vec_p<P>::update_bb_() const + p_array<P>::update_bb_() const { bb_.init(); for (unsigned i = 0; i < vect_.size(); ++i) @@ -153,7 +153,7 @@ template <typename P> bool - vec_p<P>::has(const P& p) const + p_array<P>::has(const P& p) const { for (unsigned i = 0; i < vect_.size(); ++i) if (vect_[i] = p) @@ -163,14 +163,14 @@ template <typename P> std::size_t - vec_p<P>::npoints() const + p_array<P>::npoints() const { return vect_.size(); } template <typename P> const box_<P>& - vec_p<P>::bbox() const + p_array<P>::bbox() const { mln_precondition(npoints() != 0); if (bb_needs_update_) @@ -179,8 +179,8 @@ } template <typename P> - vec_p<P>& - vec_p<P>::append(const P& p) + p_array<P>& + p_array<P>::append(const P& p) { vect_.push_back(p); if (! bb_needs_update_) @@ -190,7 +190,7 @@ template <typename P> void - vec_p<P>::clear() + p_array<P>::clear() { vect_.clear(); bb_needs_update_ = false; @@ -198,14 +198,14 @@ template <typename P> const std::vector<P>& - vec_p<P>::vect() const + p_array<P>::vect() const { return vect_; } template <typename P> const P& - vec_p<P>::operator[](unsigned i) const + p_array<P>::operator[](unsigned i) const { mln_precondition(i < npoints()); return vect_[i]; @@ -216,7 +216,7 @@ } // end of namespace mln -# include <mln/core/vec_p_piter.hh> +# include <mln/core/p_array_piter.hh> #endif // ! MLN_CORE_VEC_P_HH Index: mln/core/p_array_piter.hh --- mln/core/p_array_piter.hh (revision 1451) +++ mln/core/p_array_piter.hh (working copy) @@ -28,24 +28,24 @@ #ifndef MLN_CORE_VEC_P_PITER_HH # define MLN_CORE_VEC_P_PITER_HH -/*! \file mln/core/vec_p_piter.hh +/*! \file mln/core/p_array_piter.hh * - * \brief Definition of point iterators on mln::vec_p. + * \brief Definition of point iterators on mln::p_array. */ -# include <mln/core/vec_p.hh> +# include <mln/core/p_array.hh> namespace mln { - /*! \brief Forward iterator on points of a vec_p<P>. + /*! \brief Forward iterator on points of a p_array<P>. * */ template <typename P> - struct vec_p_fwd_piter_ : public internal::point_iterator_base_< P, vec_p_fwd_piter_<P> > + struct p_array_fwd_piter_ : public internal::point_iterator_base_< P, p_array_fwd_piter_<P> > { - typedef vec_p_fwd_piter_<P> self_; + typedef p_array_fwd_piter_<P> self_; typedef internal::point_iterator_base_< P, self_ > super_; public: @@ -54,7 +54,7 @@ /// Coordinate associated type. template <typename S> - vec_p_fwd_piter_(const Point_Set<S>& s); + p_array_fwd_piter_(const Point_Set<S>& s); /// Reference of the corresponding point. const P& to_point() const; @@ -85,13 +85,13 @@ - /*! \brief Backward iterator on points of a vec_p<P>. + /*! \brief Backward iterator on points of a p_array<P>. * */ template <typename P> - struct vec_p_bkd_piter_ : public internal::point_iterator_base_< P, vec_p_bkd_piter_<P> > + struct p_array_bkd_piter_ : public internal::point_iterator_base_< P, p_array_bkd_piter_<P> > { - typedef vec_p_bkd_piter_<P> self_; + typedef p_array_bkd_piter_<P> self_; typedef internal::point_iterator_base_< P, self_ > super_; public: @@ -100,7 +100,7 @@ /// Coordinate associated type. template <typename S> - vec_p_bkd_piter_(const Point_Set<S>& s); + p_array_bkd_piter_(const Point_Set<S>& s); /// Reference of the corresponding point. const P& to_point() const; @@ -133,11 +133,11 @@ # ifndef MLN_INCLUDE_ONLY - // vec_p_fwd_piter_<P> + // p_array_fwd_piter_<P> template <typename P> template <typename S> - vec_p_fwd_piter_<P>::vec_p_fwd_piter_(const Point_Set<S>& s) + p_array_fwd_piter_<P>::p_array_fwd_piter_(const Point_Set<S>& s) : vect_(exact(s).vect()) { invalidate(); @@ -145,14 +145,14 @@ template <typename P> const P& - vec_p_fwd_piter_<P>::to_point() const + p_array_fwd_piter_<P>::to_point() const { return p_; } template <typename P> mln_coord(P) - vec_p_fwd_piter_<P>::operator[](unsigned i) const + p_array_fwd_piter_<P>::operator[](unsigned i) const { mln_precondition(i < dim); mln_precondition(is_valid()); @@ -161,21 +161,21 @@ template <typename P> bool - vec_p_fwd_piter_<P>::is_valid() const + p_array_fwd_piter_<P>::is_valid() const { return i_ < vect_.size(); } template <typename P> void - vec_p_fwd_piter_<P>::invalidate() + p_array_fwd_piter_<P>::invalidate() { i_ = vect_.size(); } template <typename P> void - vec_p_fwd_piter_<P>::start() + p_array_fwd_piter_<P>::start() { i_ = 0; if (is_valid()) @@ -184,7 +184,7 @@ template <typename P> void - vec_p_fwd_piter_<P>::next_() + p_array_fwd_piter_<P>::next_() { ++i_; if (is_valid()) @@ -192,18 +192,18 @@ } template <typename P> - vec_p_fwd_piter_<P>::operator P() const + p_array_fwd_piter_<P>::operator P() const { mln_precondition(is_valid()); return p_; } - // vec_p_bkd_piter_<P> + // p_array_bkd_piter_<P> template <typename P> template <typename S> - vec_p_bkd_piter_<P>::vec_p_bkd_piter_(const Point_Set<S>& s) + p_array_bkd_piter_<P>::p_array_bkd_piter_(const Point_Set<S>& s) : vect_(exact(s).vect()) { invalidate(); @@ -211,14 +211,14 @@ template <typename P> const P& - vec_p_bkd_piter_<P>::to_point() const + p_array_bkd_piter_<P>::to_point() const { return p_; } template <typename P> mln_coord(P) - vec_p_bkd_piter_<P>::operator[](unsigned i) const + p_array_bkd_piter_<P>::operator[](unsigned i) const { mln_precondition(i < dim); mln_precondition(is_valid()); @@ -227,21 +227,21 @@ template <typename P> bool - vec_p_bkd_piter_<P>::is_valid() const + p_array_bkd_piter_<P>::is_valid() const { return i_ >= 0; } template <typename P> void - vec_p_bkd_piter_<P>::invalidate() + p_array_bkd_piter_<P>::invalidate() { i_ = -1; } template <typename P> void - vec_p_bkd_piter_<P>::start() + p_array_bkd_piter_<P>::start() { i_ = vect_.size() - 1; if (is_valid()) @@ -250,7 +250,7 @@ template <typename P> void - vec_p_bkd_piter_<P>::next_() + p_array_bkd_piter_<P>::next_() { --i_; if (is_valid()) @@ -258,7 +258,7 @@ } template <typename P> - vec_p_bkd_piter_<P>::operator P() const + p_array_bkd_piter_<P>::operator P() const { mln_precondition(is_valid()); return p_; Index: mln/level/sort_points.hh --- mln/level/sort_points.hh (revision 1459) +++ mln/level/sort_points.hh (working copy) @@ -38,7 +38,7 @@ # include <algorithm> # include <mln/core/concept/image.hh> -# include <mln/convert/to_vec_p.hh> +# include <mln/convert/to_p_array.hh> # include <mln/histo/compute.hh> @@ -56,7 +56,7 @@ * \pre \p input.has_data */ template <typename I> - vec_p<mln_point(I)> sort_points_increasing(const Image<I>& input); + p_array<mln_point(I)> sort_points_increasing(const Image<I>& input); # ifndef MLN_INCLUDE_ONLY @@ -106,17 +106,17 @@ // increasing template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_increasing_(metal::false_, const I& input) // general case { - vec_p<mln_point(I)> v = convert::to_vec_p(input.domain()); + p_array<mln_point(I)> v = convert::to_p_array(input.domain()); std::sort(v.hook_().begin(), v.hook_().end(), value_point_less_<I>(input)); return v; } template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_increasing_(metal::true_, const I& input) // low quantization { typedef mln_vset(I) S; @@ -138,7 +138,7 @@ for_all(p) vec[loc[vset.index_of(input(p))]++] = p; - vec_p<mln_point(I)> v; + p_array<mln_point(I)> v; v.hook_() = vec; return v; } @@ -147,17 +147,17 @@ // decreasing template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_decreasing_(metal::false_, const I& input) // general case { - vec_p<mln_point(I)> v = convert::to_vec_p(input.domain()); + p_array<mln_point(I)> v = convert::to_p_array(input.domain()); std::sort(v.hook_().begin(), v.hook_().end(), value_point_greater_<I>(input)); return v; } template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_decreasing_(metal::true_, const I& input) // low quantization { typedef mln_vset(I) S; @@ -179,7 +179,7 @@ for_all(p) vec[loc[vset.index_of(input(p))]++] = p; - vec_p<mln_point(I)> v; + p_array<mln_point(I)> v; v.hook_() = vec; return v; } @@ -191,7 +191,7 @@ // Facades. template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_increasing(const Image<I>& input) { mln_precondition(exact(input).has_data()); @@ -199,7 +199,7 @@ } template <typename I> - vec_p<mln_point(I)> + p_array<mln_point(I)> sort_points_decreasing(const Image<I>& input) { mln_precondition(exact(input).has_data()); Index: mln/level/fill.hh --- mln/level/fill.hh (revision 1459) +++ mln/level/fill.hh (working copy) @@ -39,6 +39,7 @@ # include <mln/core/concept/image.hh> # include <mln/core/concept/function.hh> +# include <mln/core/inplace.hh> # include <mln/level/memset_.hh> @@ -89,6 +90,9 @@ template <typename I> void fill(Image<I>& ima, mln_value(I) (*(&f))(const mln_point(I)& p)); + template <typename I> + void fill_f(Image<I>& ima, mln_value(I) (*f)(const mln_point(I)& p)); + /*! Fill the image \p ima with the values given by the array \p arr. * @@ -181,8 +185,8 @@ // with: value f(const point&) template <typename I> - void fill(Image<I>& ima_, - mln_value(I) (*(&f))(const mln_point(I)& p)) + void fill_f(Image<I>& ima_, + mln_value(I) (*f)(const mln_point(I)& p)) { mln_precondition(f != 0); I& ima = exact(ima_); Index: mln/value/rgb.hh --- mln/value/rgb.hh (revision 1459) +++ mln/value/rgb.hh (working copy) @@ -275,9 +275,9 @@ template <unsigned n> std::ostream& operator<<(std::ostream& ostr, const rgb<n>& v) { - return ostr << "(r" << debug::format(v.red()) - << ", g" << debug::format(v.green()) - << ", b" << debug::format(v.blue()) + return ostr << "(" << debug::format(v.red()) + << ", " << debug::format(v.green()) + << ", " << debug::format(v.blue()) << ")"; } Index: mln/convert/all.hh --- mln/convert/all.hh (revision 1459) +++ mln/convert/all.hh (working copy) @@ -46,7 +46,7 @@ # include <mln/convert/to_rgb.hh> # include <mln/convert/to_std_set.hh> # include <mln/convert/to_tiles.hh> -# include <mln/convert/to_vec_p.hh> +# include <mln/convert/to_p_array.hh> # include <mln/convert/to_window.hh> # include <mln/convert/to_w_window.hh> Index: mln/convert/to_p_set.hh --- mln/convert/to_p_set.hh (revision 1451) +++ mln/convert/to_p_set.hh (working copy) @@ -28,16 +28,16 @@ #ifndef MLN_CONVERT_TO_SET_P_HH # define MLN_CONVERT_TO_SET_P_HH -/*! \file mln/convert/to_set_p.hh +/*! \file mln/convert/to_p_set.hh * - * \brief Conversions to mln::set_p. + * \brief Conversions to mln::p_set. */ # include <set> # include <mln/core/concept/neighborhood.hh> # include <mln/core/concept/point_site.hh> -# include <mln/core/set_p.hh> +# include <mln/core/p_set.hh> # include <mln/pw/image.hh> # include <mln/pw/cst.hh> # include <mln/metal/is_a.hh> @@ -51,30 +51,30 @@ /// Convert a neighborhood \p nbh into a point set. template <typename N> - set_p<mln_point(N)> to_set_p(const Neighborhood<N>& nbh); + p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh); /// Convert a binary image \p ima into a point set. template <typename I> - set_p<mln_point(I)> to_set_p(const Image<I>& ima); + p_set<mln_point(I)> to_p_set(const Image<I>& ima); /// Convert a Window \p win into a point set. template <typename W> - set_p<mln_point(W)> to_set_p(const Window<W>& win); + p_set<mln_point(W)> to_p_set(const Window<W>& win); /// Convert an std::set \p s of points into a point set. template <typename D> - set_p<D> to_set_p(const std::set<D>& s); + p_set<D> to_p_set(const std::set<D>& s); # ifndef MLN_INCLUDE_ONLY template <typename N> - set_p<mln_point(N)> to_set_p(const Neighborhood<N>& nbh_) + p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh_) { const N& nbh = exact(nbh_); typedef mln_dpoint(N) D; typedef mln_point(N) P; - set_p<P> pset; + p_set<P> pset; mln_niter(N) n(nbh, P::origin); for_all(n) pset.insert(n); @@ -82,14 +82,14 @@ } template <typename I> - set_p<mln_point(I)> to_set_p(const Image<I>& ima_) + p_set<mln_point(I)> to_p_set(const Image<I>& ima_) { const I& ima = exact(ima_); mln_precondition(ima.has_data()); // FIXME: Check that ima is binary! typedef mln_dpoint(I) D; typedef mln_point(I) P; - set_p<P> pset; + p_set<P> pset; mln_piter(I) p(ima.domain()); for_all(p) if (ima(p)) @@ -98,11 +98,11 @@ } template <typename W> - set_p<mln_point(W)> to_set_p(const Window<W>& win) + p_set<mln_point(W)> to_p_set(const Window<W>& win) { typedef mln_dpoint(W) D; typedef mln_point(W) P; - set_p<P> pset; + p_set<P> pset; mln_qiter(W) q(exact(win), P::origin); for_all(q) pset.insert(q); @@ -110,10 +110,10 @@ } template <typename P> - set_p<P> to_set_p(const std::set<P>& s) + p_set<P> to_p_set(const std::set<P>& s) { mln::metal::is_a<P, Point_Site>::check(); - set_p<P> pset; + p_set<P> pset; for (typename std::set<P>::const_iterator i = s.begin(); i != s.end(); ++i) pset.insert(*i); Index: mln/convert/to_p_array.hh --- mln/convert/to_p_array.hh (revision 1451) +++ mln/convert/to_p_array.hh (working copy) @@ -28,12 +28,12 @@ #ifndef MLN_CONVERT_TO_VEC_P_HH # define MLN_CONVERT_TO_VEC_P_HH -/*! \file mln/convert/to_vec_p.hh +/*! \file mln/convert/to_p_array.hh * - * \brief Conversions to mln::vec_p. + * \brief Conversions to mln::p_array. */ -# include <mln/core/vec_p.hh> +# include <mln/core/p_array.hh> # include <mln/core/concept/window.hh> @@ -43,23 +43,23 @@ namespace convert { - /// Convert a point set \p pset into a vec_p (point set vector). + /// Convert a point set \p pset into a p_array (point set vector). template <typename S> - vec_p<mln_point(S)> to_vec_p(const Point_Set<S>& pset); + p_array<mln_point(S)> to_p_array(const Point_Set<S>& pset); - /// Convert a window \p win centered at point \p p into a vec_p (point set vector). + /// Convert a window \p win centered at point \p p into a p_array (point set vector). template <typename W> - vec_p<mln_point(W)> to_vec_p(const Window<W>& win, const mln_point(W)& p); + p_array<mln_point(W)> to_p_array(const Window<W>& win, const mln_point(W)& p); # ifndef MLN_INCLUDE_ONLY template <typename S> - vec_p<mln_point(S)> to_vec_p(const Point_Set<S>& pset_) + p_array<mln_point(S)> to_p_array(const Point_Set<S>& pset_) { const S& pset = exact(pset_); - vec_p<mln_point(S)> v; + p_array<mln_point(S)> v; v.reserve(pset.npoints()); mln_fwd_piter(S) p(pset); for_all(p) @@ -68,9 +68,9 @@ } template <typename W> - vec_p<mln_point(W)> to_vec_p(const Window<W>& win, const mln_point(W)& p) + p_array<mln_point(W)> to_p_array(const Window<W>& win, const mln_point(W)& p) { - vec_p<mln_point(W)> v; + p_array<mln_point(W)> v; v.reserve(exact(win).ndpoints()); mln_qiter(W) q(win, p); for_all(q) Index: mln/geom/seeds2tiling.hh --- mln/geom/seeds2tiling.hh (revision 1459) +++ mln/geom/seeds2tiling.hh (working copy) @@ -36,7 +36,7 @@ # include <map> -# include <mln/core/queue_p.hh> +# include <mln/core/p_queue.hh> # include <mln/core/clone.hh> # include <mln/accu/mean.hh> # include <mln/estim/min_max.hh> @@ -61,7 +61,7 @@ { I& ima = exact(ima_); I out = clone(ima_); - queue_p<mln_psite(I)> q; + p_queue<mln_psite(I)> q; // Init. { Index: mln/geom/seeds2tiling_with_chamfer.hh --- mln/geom/seeds2tiling_with_chamfer.hh (revision 1459) +++ mln/geom/seeds2tiling_with_chamfer.hh (working copy) @@ -36,7 +36,7 @@ # include <map> -# include <mln/core/queue_p_fast_priority.hh> +# include <mln/core/p_priority_queue_fast.hh> # include <mln/core/clone.hh> # include <mln/accu/mean.hh> # include <mln/estim/min_max.hh> @@ -67,7 +67,7 @@ I& ima = exact(ima_); image2d<unsigned> dist = geom::chamfer(ima, w_win, max); I out = clone(ima_); - queue_p_fast_priority<mln_psite(I), unsigned> q; + p_priority_queue_fast<mln_psite(I), unsigned> q; // Init. { Index: mln/set/inter.hh --- mln/set/inter.hh (revision 1459) +++ mln/set/inter.hh (working copy) @@ -36,7 +36,7 @@ # include <mln/convert/to_std_set.hh> # include <mln/convert/to_window.hh> -# include <mln/convert/to_set_p.hh> +# include <mln/convert/to_p_set.hh> # include <mln/metal/equal.hh> @@ -60,7 +60,7 @@ * \relates mln::Point_Set */ template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> inter(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); # ifndef MLN_INCLUDE_ONLY @@ -82,7 +82,7 @@ } template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> inter(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); @@ -94,7 +94,7 @@ std::set_intersection(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); - return convert::to_set_p(s); + return convert::to_p_set(s); } # endif // ! MLN_INCLUDE_ONLY Index: mln/set/diff.hh --- mln/set/diff.hh (revision 1459) +++ mln/set/diff.hh (working copy) @@ -38,7 +38,7 @@ # include <mln/convert/to_std_set.hh> # include <mln/convert/to_window.hh> -# include <mln/convert/to_set_p.hh> +# include <mln/convert/to_p_set.hh> # include <mln/metal/equal.hh> @@ -56,7 +56,7 @@ /// Set theoretic difference of \p lhs and \p rhs. template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); @@ -80,7 +80,7 @@ /// Set theoretic difference of \p lhs and \p rhs. template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); @@ -92,7 +92,7 @@ std::set_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); - return convert::to_set_p(s); + return convert::to_p_set(s); } # endif // ! MLN_INCLUDE_ONLY Index: mln/set/uni.hh --- mln/set/uni.hh (revision 1459) +++ mln/set/uni.hh (working copy) @@ -35,7 +35,7 @@ # include <mln/convert/to_std_set.hh> # include <mln/convert/to_window.hh> -# include <mln/convert/to_set_p.hh> +# include <mln/convert/to_p_set.hh> # include <mln/metal/equal.hh> @@ -59,7 +59,7 @@ * \relates mln::Point_Set */ template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> uni(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); @@ -82,7 +82,7 @@ } template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> uni(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); @@ -94,7 +94,7 @@ std::set_union(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); - return convert::to_set_p(s); + return convert::to_p_set(s); } # endif // ! MLN_INCLUDE_ONLY Index: mln/set/sym_diff.hh --- mln/set/sym_diff.hh (revision 1459) +++ mln/set/sym_diff.hh (working copy) @@ -35,7 +35,7 @@ # include <mln/convert/to_std_set.hh> # include <mln/convert/to_window.hh> -# include <mln/convert/to_set_p.hh> +# include <mln/convert/to_p_set.hh> # include <mln/metal/equal.hh> @@ -53,7 +53,7 @@ /// Set theoretic symmetrical difference of \p lhs and \p rhs. template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> sym_diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); # ifndef MLN_INCLUDE_ONLY @@ -75,7 +75,7 @@ } template <typename Wl, typename Wr> - set_p<mln_point(Wl)> + p_set<mln_point(Wl)> sym_diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); @@ -87,7 +87,7 @@ std::set_symmetric_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); - return convert::to_set_p(s); + return convert::to_p_set(s); } # endif // ! MLN_INCLUDE_ONLY Index: mln/morpho/opening_attribute.hh --- mln/morpho/opening_attribute.hh (revision 1459) +++ mln/morpho/opening_attribute.hh (working copy) @@ -70,7 +70,7 @@ typedef I_ I; typedef N_ N; typedef O_ O; - typedef vec_p<P> S; + typedef p_array<P> S; typedef util::pix<I> pix_t; const I& input; Index: mln/morpho/erosion.spe.hh --- mln/morpho/erosion.spe.hh (revision 1459) +++ mln/morpho/erosion.spe.hh (working copy) @@ -162,12 +162,13 @@ O output; mln_pixter(const I) p(input); - mln_pixter(O) p_out(output); mln_qixter(const I, W) q(p, win); if (win.is_centered()) { output = clone(input); + + mln_pixter(O) p_out(output); for_all_2(p, p_out) if (p.val()) for_all(q) @@ -182,6 +183,7 @@ initialize(output, input); level::fill(output, input); + mln_pixter(O) p_out(output); for_all_2(p, p_out) for_all(q) if (! q.val()) Index: mln/display/color_pretty.hh --- mln/display/color_pretty.hh (revision 1459) +++ mln/display/color_pretty.hh (working copy) @@ -40,7 +40,7 @@ # include <mln/value/rgb8.hh> # include <mln/level/fill.hh> # include <mln/level/paste.hh> -# include <mln/core/set_p.hh> +# include <mln/core/p_set.hh> namespace mln { @@ -55,9 +55,9 @@ template <typename I> typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty_rgb(const Image<I>& input_, - const set_p<mln_point(I) >& s1_, - const set_p<mln_point(I) >& s2_, - const set_p<mln_point(I) >& s3_); + const p_set<mln_point(I) >& s1_, + const p_set<mln_point(I) >& s2_, + const p_set<mln_point(I) >& s3_); # ifndef MLN_INCLUDE_ONLY @@ -107,9 +107,9 @@ template <typename I> typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty_rgb(const Image<I>& input_, - const set_p<mln_point(I) >& s1_, - const set_p<mln_point(I) >& s2_, - const set_p<mln_point(I) >& s3_) + const p_set<mln_point(I) >& s1_, + const p_set<mln_point(I) >& s2_, + const p_set<mln_point(I) >& s3_) { const I& input = exact (input_); @@ -117,21 +117,21 @@ level::fill(output, value::rgb8(0, 0, 0)); { - mln_piter(set_p<mln_point(I) >) p(s1_); + mln_piter(p_set<mln_point(I) >) p(s1_); for_all(p) output(p).red() = 255; } { - mln_piter(set_p<mln_point(I) >) p(s2_); + mln_piter(p_set<mln_point(I) >) p(s2_); for_all(p) output(p).green() = 255; } { - mln_piter(set_p<mln_point(I) >) p(s3_); + mln_piter(p_set<mln_point(I) >) p(s3_); for_all(p) output(p).blue() = 255; @@ -153,9 +153,9 @@ template <typename I> typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty_rgb(const Image<I>& input_, - const set_p<mln_point(I) >& s1_, - const set_p<mln_point(I) >& s2_, - const set_p<mln_point(I) >& s3_) + const p_set<mln_point(I) >& s1_, + const p_set<mln_point(I) >& s2_, + const p_set<mln_point(I) >& s3_) { return impl::color_pretty_rgb(input_, s1_, s2_, s3_); } Index: mln/display/all.hh --- mln/display/all.hh (revision 1459) +++ mln/display/all.hh (working copy) @@ -47,6 +47,7 @@ } # include <mln/display/color_pretty.hh> +# include <mln/display/remove.hh> # include <mln/display/save.hh> # include <mln/display/show.hh> Index: mln/util/tree_to_image.hh --- mln/util/tree_to_image.hh (revision 1459) +++ mln/util/tree_to_image.hh (working copy) @@ -37,7 +37,7 @@ */ # include <mln/util/tree.hh> -# include <mln/core/set_p.hh> +# include <mln/core/p_set.hh> namespace mln { @@ -51,7 +51,7 @@ template <typename P, typename J> void - display_set(const Image<J>& ima_, set_p<P>& s); + display_set(const Image<J>& ima_, p_set<P>& s); template <typename I, typename J> void @@ -69,7 +69,7 @@ { I& output = exact(output_); - mln_piter(set_p<point2d>) p(node->elt().points); + mln_piter(p_set<point2d>) p(node->elt().points); for_all(p) output(p) = node->elt().value; @@ -96,13 +96,13 @@ template <typename P, typename J> void - display_set(const Image<J>& ima_, set_p<P>& s) + display_set(const Image<J>& ima_, p_set<P>& s) { const J& ima = exact(ima_); image2d<bool> out (ima.bbox ()); level::fill(out, false); - mln_piter(set_p<P>) p (s); + mln_piter(p_set<P>) p (s); for_all (p) out(p) = true; } @@ -144,7 +144,7 @@ K& output = exact(output_); const J& ima = exact(ima_); - mln_piter(set_p<point2d>) p(node->elt().points); + mln_piter(p_set<point2d>) p(node->elt().points); for_all (p) output(p) = true; typename mln::util::node<T>::children_t::iterator it = node->children().begin(); Index: mln/labeling/regional_minima.hh --- mln/labeling/regional_minima.hh (revision 1459) +++ mln/labeling/regional_minima.hh (working copy) @@ -71,7 +71,7 @@ // requirements from mln::canvas::labeling: - typedef vec_p<P> S; + typedef p_array<P> S; S s; void init() { mln::level::fill(this->output, 0); Index: mln/labeling/regional_maxima.hh --- mln/labeling/regional_maxima.hh (revision 1459) +++ mln/labeling/regional_maxima.hh (working copy) @@ -71,7 +71,7 @@ // requirements from mln::canvas::labeling: - typedef vec_p<P> S; + typedef p_array<P> S; S s; void init() { mln::level::fill(this->output, 0);
participants (1)
-
Thierry Geraud