Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
May 2008
- 11 participants
- 115 discussions
#137: Write more attribute (connected) filters
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: task | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
For instance,
* a volume opening/closing;
* a filter based on the height of a component;
* etc.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/137>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
1
1986: Add an extra test on Meyer's WST on a synthetic line graph image.
by Roland Levillain 30 May '08
by Roland Levillain 30 May '08
30 May '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add an extra test on Meyer's WST on a synthetic line graph image.
* tests/morpho/artificial_line_graph_image_wst.cc: New test.
* tests/morpho/Makefile.am (check_PROGRAMS): Add
artificial_line_graph_image_wst.
(artificial_line_graph_image_wst_SOURCES)
(artificial_line_graph_image_wst_CXXFLAGS):
New.
(lena_line_graph_image_wst2_CXXFLAGS): Typo.
Makefile.am | 6 -
artificial_line_graph_image_wst.cc | 222 +++++++++++++++++++++++++++++++++++++
2 files changed, 227 insertions(+), 1 deletion(-)
Index: tests/morpho/artificial_line_graph_image_wst.cc
--- tests/morpho/artificial_line_graph_image_wst.cc (revision 0)
+++ tests/morpho/artificial_line_graph_image_wst.cc (revision 0)
@@ -0,0 +1,222 @@
+// 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.
+
+/* FIXME: We should factor as much things as possible between
+ tests/morpho/lena_line_graph_image_wst1.cc,
+ tests/morpho/lena_line_graph_image_wst2.cc and this file, starting
+ with conversion routines. */
+
+/** \file tests/morpho/artificial_line_graph_image_wst.cc
+ \brief Tests on the Watershed Transform (WST) on an artificial
+ mln::line_graph_image.
+
+ The scenario is as follows:
+ \li create an artificial (checkboard) 2-D image ;
+ \li convert this 2-D image into a line graph-based one, where values
+ on edges are computed as the absolute value of the difference
+ between the values on the nodes adjacent to the edge, so as to
+ create a (norm of the) gradient ``between the pixels'' of the
+ input image;
+ \li perform a WST on this line graph image;
+ \li create a 2-D, color output image with height and width double
+ the size the original one, and copy the data of the input image
+ in it, interpolating inter-pixel points;
+ \li print the watershed on lines into that same image, and save it. */
+
+#include <vector>
+
+#include <mln/core/image2d.hh>
+#include <mln/core/point2d.hh>
+#include <mln/core/window2d.hh>
+#include <mln/core/neighb2d.hh>
+
+#include <mln/core/line_graph_image.hh>
+#include <mln/core/line_graph_elt_neighborhood.hh>
+#include <mln/core/line_graph_neighborhood_piter.hh>
+
+#include <mln/morpho/line_gradient.hh>
+#include <mln/morpho/closing_area_on_vertices.hh>
+#include <mln/morpho/meyer_wst.hh>
+#include <mln/level/stretch.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/value/int_u16.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/literal/black.hh>
+#include <mln/literal/colors.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/io/ppm/save.hh>
+
+#include <mln/math/max.hh>
+#include <mln/math/abs.hh>
+
+#include "tests/data.hh"
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+ using value::int_u16;
+ using value::rgb8;
+
+ /*--------.
+ | Input. |
+ `--------*/
+
+ // Dimensions.
+ const unsigned nrows = 100;
+ const unsigned ncols = 100;
+ const unsigned square_length = 3;
+ typedef int_u8 input_val_t;
+ // Create a checkboard image.
+ image2d<input_val_t> input (nrows, ncols);
+ for (unsigned r = 0; r < nrows; ++r)
+ for (unsigned c = 0; c < ncols; ++c)
+ input.at(r,c) =
+ ((r / square_length) % 2 == (c / square_length) % 2)
+ ? mln_min(input_val_t)
+ : mln_max(input_val_t);
+ std::cout << "nvertices = " << nrows * ncols << std::endl
+ << "nedges = " << 2 * nrows * ncols - (nrows + ncols) << std::endl;
+
+ /*----------------.
+ | Line gradient. |
+ `----------------*/
+
+ // Line graph image.
+ typedef line_graph_image<point2d, input_val_t> ima_t;
+ ima_t lg_ima = morpho::line_gradient(input);
+
+ /*------.
+ | WST. |
+ `------*/
+
+ typedef line_graph_elt_neighborhood<point2d> nbh_t;
+ nbh_t nbh;
+
+ // Perform a Watershed Transform.
+ typedef unsigned wst_val_t;
+ wst_val_t nbasins;
+ typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
+ wst_ima_t wshed = morpho::meyer_wst(lg_ima, nbh, nbasins);
+ std::cout << "nbasins = " << nbasins << std::endl;
+
+ /*---------.
+ | Output. |
+ `---------*/
+
+ // FIXME: Inlined conversion, to be reifed into a routine.
+
+ // Save the result in gray levels (data) + color (wshed).
+
+ // Data.
+ typedef rgb8 output_val_t;
+ typedef image2d<output_val_t> output_t;
+ point2d output_pmin = input.domain().pmin();
+ point2d output_pmax(input.domain().pmax()[0] * 2,
+ input.domain().pmax()[1] * 2);
+ output_t output(box2d(output_pmin, output_pmax));
+ level::fill(output, literal::black);
+ mln_fwd_piter_(image2d<input_val_t>) p(input.domain());
+ for_all(p)
+ {
+ // Equivalent of P in OUTPUT.
+ point2d q(p[0] * 2, p[1] * 2);
+ input_val_t v = input(p);
+ /* FIXME: Use a conversion function from input_val_t to
+ output_val_t instead of an explicit construction. */
+ output(q) = output_val_t(v, v, v);
+ }
+ // Interpolate missing points in OUTPUT.
+ mln_piter_(output_t) p_out(output.domain());
+ for_all(p_out)
+ {
+ // Process points on even rows and odd columns
+ if (p_out[0] % 2 == 0 && p_out[1] % 2 == 1)
+ output(p_out) = (output(p_out + left) + output(p_out + right)) / 2;
+ // Process points on odd rows and even columns
+ if (p_out[0] % 2 == 1 && p_out[1] % 2 == 0)
+ output(p_out) = (output(p_out + up) + output(p_out + down)) / 2;
+ // Process points on odd rows and odd columns
+ if (p_out[0] % 2 == 1 && p_out[1] % 2 == 1)
+ output(p_out) =
+ (output(p_out + make::dpoint2d(-1, -1)) +
+ output(p_out + make::dpoint2d(-1, +1)) +
+ output(p_out + make::dpoint2d(+1, -1)) +
+ output(p_out + make::dpoint2d(+1, +1))) / 4;
+ }
+ // Draw the watershed.
+ /* FIXME: We should draw the watershed on another image and
+ superimpose it on OUTPUT instead of drawing it directly into
+ OUTPUT. */
+ mln_piter_(wst_ima_t) pw(wshed.domain());
+ for_all(pw)
+ {
+ if (wshed(pw) == 0)
+ {
+ mln_psite_(wst_ima_t) pp(pw);
+ // Equivalent of the line (edge) PP in OUTPUT.
+ int row1 = pp.first()[0] * 2;
+ int col1 = pp.first()[1] * 2;
+ int row2 = pp.second()[0] * 2;
+ int col2 = pp.second()[1] * 2;
+ point2d q((row1 + row2) / 2, (col1 + col2) / 2);
+ // Print the watershed in red.
+ output(q) = literal::red;
+ }
+ }
+ // Fill the holes, so that the watershed looks connected.
+ /* FIXME: This approach is bad: it creates thick lines of watershed.
+ We should probably solve this when we ``paint'' the watershed
+ over the ``doubled'' image.
+
+ A better approach is probably to iterate over the set of nodes,
+ and ``connect'' edges according to patterns (vertically or
+ horizontally connected egdes member of the watershed, etc.). */
+ // Reuse the piter on OUTPUT.
+ for_all (p_out)
+ // Only handle points on odd rows and columns.
+ if (p_out[0] % 2 == 1 && p_out[1] % 2 == 1)
+ {
+ // Count the number of adjacent watershed points. If there are
+ // two or more, consider, create a watershed point.
+ /* FIXME: Iterating over a c4 window would be more elegant, of
+ course. */
+ unsigned nwsheds =
+ (output.has(p_out + up ) && output(p_out + up ) == literal::red) +
+ (output.has(p_out + down ) && output(p_out + down ) == literal::red) +
+ (output.has(p_out + left ) && output(p_out + right) == literal::red) +
+ (output.has(p_out + right) && output(p_out + left ) == literal::red);
+ if (nwsheds >= 2)
+ output(p_out) = literal::red;
+ }
+ io::ppm::save(output, "out.ppm");
+}
Index: tests/morpho/Makefile.am
--- tests/morpho/Makefile.am (revision 1985)
+++ tests/morpho/Makefile.am (working copy)
@@ -3,6 +3,7 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
+ artificial_line_graph_image_wst \
closing_area \
combined \
contrast \
@@ -47,6 +48,9 @@
# Complex tests. #
# --------------- #
+artificial_line_graph_image_wst_SOURCES = artificial_line_graph_image_wst.cc
+artificial_line_graph_image_wst_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
+
dilation_SOURCES = dilation.cc
dilation_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
@@ -54,7 +58,7 @@
lena_line_graph_image_wst1_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
lena_line_graph_image_wst2_SOURCES = lena_line_graph_image_wst2.cc
-lena_line_graph_image_wst2_CXXFLAGS = $(TESTSCXXFLAGS_SPEED)
+lena_line_graph_image_wst2_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
meyer_wst_long_SOURCES = meyer_wst_long.cc
meyer_wst_long_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
1
0
cleanup-2008 1987: Clean Site_Iterator design and propagate to p_array and box.
by Thierry Geraud 30 May '08
by Thierry Geraud 30 May '08
30 May '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Clean Site_Iterator design and propagate to p_array and box.
* doc/tutorial/examples/box.cc: New.
* mln/core/internal/site_iterator_base.hh (P): Change into...
(S): ...this; it is now a site set type (no more a psite).
(site): Change into...
(mln_site(S)): ...this; more readable.
(unproxy, target_): New.
* mln/core/concept/site_iterator.hh
(is_valid, invalidate, start): New methods. Now concrete classes
should implement the 'underscored' version.
(target_): New expected method in concrete classes.
(change_target): New.
(Site_Iterator): Update the constructor.
* mln/core/box_piter.hh: Update inheritance.
(operator P, to_point, operator[]): Remove; obsolete.
(is_valid, invalidate, start): Rename as...
(is_valid_, invalidate_, start_): ...these and update.
(p_): Change from attribute to 'using' (thru inheritance).
(b_): Turn into a pointer.
(nop_): Remove; it was overkill.
(target_): New.
(dim): Rely on P.
(box_bounds_piter_): Remove this dead class.
* mln/core/p_array_piter.hh
(is_valid, invalidate, start): Rename as...
(is_valid_, invalidate_, start_): ...these and update.
(p_): Change from attribute to 'using' (thru inheritance).
(unproxy, site, to_site): Remove; now inherited.
(index_of_in): New overload for bkd piter.
(p_array_bkd_piter_): Uncomment and update likewise.
* mln/core/point2d.hh (operator[]): New.
* mln/core/concept/site_proxy.hh (to_site): New.
For use in site_iterator_base_<S, E>::to_site().
* mln/core/p_array.hh (target): New method in psite.
(bkd_piter): Reactivate.
doc/tutorial/examples/box.cc | 30 +++
mln/core/box_piter.hh | 296 ++++++-------------------------
mln/core/concept/site_iterator.hh | 67 ++++++-
mln/core/concept/site_proxy.hh | 39 ++++
mln/core/internal/site_iterator_base.hh | 76 ++++++--
mln/core/p_array.hh | 10 -
mln/core/p_array_piter.hh | 303 ++++++++++++--------------------
mln/core/point2d.hh | 5
8 files changed, 372 insertions(+), 454 deletions(-)
Index: doc/tutorial/examples/box.cc
--- doc/tutorial/examples/box.cc (revision 0)
+++ doc/tutorial/examples/box.cc (revision 0)
@@ -0,0 +1,30 @@
+# include <mln/core/image2d.hh>
+# include <mln/debug/println.hh>
+# include <mln/level/fill.hh>
+
+
+template <typename B>
+void picture(const B& b)
+{
+ using namespace mln;
+
+ image2d<char> ima(5, 5);
+ level::fill(ima, '-');
+
+ unsigned i = 0;
+ mln_piter(B) p(b);
+ for_all(p)
+ ima(p) = '0' + i++;
+
+ debug::println(ima);
+}
+
+
+
+int main()
+{
+ using namespace mln;
+
+ box2d b = make::box2d(1,1, 3,2);
+ picture(b);
+}
Index: mln/core/internal/site_iterator_base.hh
--- mln/core/internal/site_iterator_base.hh (revision 1985)
+++ mln/core/internal/site_iterator_base.hh (working copy)
@@ -44,56 +44,94 @@
/*! \internal A base class for site iterators.
*
- * Parameter \c P is FIXME: a point site type.
+ * Parameter \c S is the targeted site set type.
*/
- template <typename P, typename E>
+ template <typename S, typename E>
struct site_iterator_base_ : Site_Iterator<E>,
- proxy_impl<P, E>,
+ proxy_impl< mln_psite(S), E>,
site_impl< false, // Constant access to site / subject.
- typename site_from<P>::ret,
+ mln_site(S), // HOT: typename site_from< >::ret,
E >
{
- // The associated site type.
- typedef typename internal::site_from<P>::ret site;
+ /// The associated site type (as a Site_Proxy).
+ typedef mln_site(S) site; // typename internal::site_from<P>::ret site;
- // The associated subject type (as a Proxy).
- typedef P subject;
+ /// Return the site it points to (as a Site_Proxy).
+ const mln_site(S)& to_site() const;
- // The associated q_subject type (as a Proxy).
- typedef const P& q_subject;
-
- /*! \brief Conversion towards the site it designates.
+ /*! \brief Conversion towards the site it designates (as a Site_Proxy).
*
* \warning This is a final method; iterator classes should not
* re-defined this method.
*
* \pre The iterator is valid.
*/
- operator site() const;
+ operator mln_site(S)() const;
+
+ /// The associated subject type (as a Proxy).
+ typedef mln_psite(S) subject;
+
+ /// The associated q_subject type (as a Proxy).
+ typedef const mln_psite(S)& q_subject;
+
+ /// Give the subject (required by the Proxy interface).
+ const mln_psite(S)& unproxy() const;
+
+ /// Access to the target address; default impl.
+ const S*& target_();
protected:
+
site_iterator_base_();
+
+ /// The site designated by this iterator.
+ mln_psite(S) p_;
};
#ifndef MLN_INCLUDE_ONLY
- template <typename P, typename E>
+ template <typename S, typename E>
inline
- site_iterator_base_<P, E>::site_iterator_base_()
+ site_iterator_base_<S, E>::site_iterator_base_()
{
}
- template <typename P, typename E>
+ template <typename S, typename E>
inline
- site_iterator_base_<P, E>::operator site() const
+ site_iterator_base_<S, E>::operator mln_site(S)() const
{
- typedef proxy_impl<P, E> super;
+ typedef proxy_impl<mln_psite(S), E> super;
mln_precondition(exact(this)->is_valid());
- return this->super::operator site();
+ return this->super::operator site(); // Featured by internal::proxy_impl<*>.
+ }
+
+ template <typename S, typename E>
+ inline
+ const mln_site(S)&
+ site_iterator_base_<S, E>::to_site() const
+ {
+ mln_precondition(exact(*this).is_valid()); // FIXME: OK?
+ return internal::to_site(p_);
+ }
+
+ template <typename S, typename E>
+ inline
+ const mln_psite(S)&
+ site_iterator_base_<S, E>::unproxy() const
+ {
+ return p_;
+ }
+
+ template <typename S, typename E>
+ inline
+ const S*&
+ site_iterator_base_<S, E>::target_()
+ {
+ return this->p_.target();
}
#endif // ! MLN_INCLUDE_ONLY
Index: mln/core/box_piter.hh
--- mln/core/box_piter.hh (revision 1985)
+++ mln/core/box_piter.hh (working copy)
@@ -47,14 +47,16 @@
* \see mln::box_
*/
template <typename P>
- class box_fwd_piter_ : public internal::site_iterator_base_< P, box_fwd_piter_<P> >
+ class box_fwd_piter_ : public internal::site_iterator_base_< box_<P>,
+ box_fwd_piter_<P> >
{
typedef box_fwd_piter_<P> self_;
- typedef internal::site_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< box_<P>, self_ > super_;
+
public:
// Make definitions from super class available.
- enum { dim = super_::dim };
+ enum { dim = P::dim };
/*! \brief Constructor.
*
@@ -62,30 +64,25 @@
*/
box_fwd_piter_(const box_<P>& b);
- /// Conversion to point.
- operator P() const;
-
- /// Reference to the corresponding point.
- const P& to_point() const;
-
- /// Give the i-th coordinate.
- mln_coord(P) operator[](unsigned i) const;
-
/// Test the iterator validity.
- bool is_valid() const;
+ bool is_valid_() const;
/// Invalidate the iterator.
- void invalidate();
+ void invalidate_();
/// Start an iteration.
- void start();
+ void start_();
/// Go to the next point.
void next_();
+ /// Give the site set target address.
+ const box_<P>*& target_();
+
private:
- const box_<P>& b_;
- P p_, nop_;
+
+ using super_::p_;
+ const box_<P>* b_;
};
@@ -97,14 +94,16 @@
* \see mln::box_
*/
template <typename P>
- class box_bkd_piter_ : public internal::site_iterator_base_< P, box_bkd_piter_<P> >
+ class box_bkd_piter_ : public internal::site_iterator_base_< box_<P>,
+ box_bkd_piter_<P> >
{
typedef box_bkd_piter_<P> self_;
- typedef internal::site_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< box_<P>, self_ > super_;
+
public:
// Make definitions from super class available.
- enum { dim = super_::dim };
+ enum { dim = P::dim };
/*! \brief Constructor.
*
@@ -112,83 +111,25 @@
*/
box_bkd_piter_(const box_<P>& b);
- /// Conversion to point.
- operator P() const;
-
- /// Reference to the corresponding point.
- const P& to_point() const;
-
- /// Give the i-th coordinate.
- mln_coord(P) operator[](unsigned i) const;
-
/// Test the iterator validity.
- bool is_valid() const;
+ bool is_valid_() const;
/// Invalidate the iterator.
- void invalidate();
+ void invalidate_();
/// Start an iteration.
- void start();
+ void start_();
/// Go to the next point.
void next_();
- private:
- const box_<P>& b_;
- P p_, nop_;
- };
-
-
- /*! \brief A iterator on points of bounds of a boxes 2d.
- *
- * The parameter \c P is the type of points.
- *
- * \see mln::box_
- *
- * \todo change it to n dimensions
- */
-
- template <typename P>
- class box_bounds_piter_ : public internal::site_iterator_base_< P, box_bounds_piter_<P> >
- {
- typedef box_bounds_piter_<P> self_;
- typedef internal::site_iterator_base_< P, self_ > super_;
- public:
-
- // Make definitions from super class available.
- enum { dim = super_::dim };
-
- /*! \brief Constructor.
- *
- * \param[in] b A box.
- */
- box_bounds_piter_(const box_<P>& b);
-
- /// Conversion to point.
- operator P() const;
-
- /// Reference to the corresponding point.
- const P& to_point() const;
-
- /// Give the i-th coordinate.
- mln_coord(P) operator[](unsigned i) const;
-
- /// Test the iterator validity.
- bool is_valid() const;
-
- /// Invalidate the iterator.
- void invalidate();
-
- /// Start an iteration.
- void start();
-
- /// Go to the next point.
- void next_();
+ /// Give the site set target address.
+ const box_<P>*& target_();
private:
- const box_<P>& b_;
- P p_, nop_;
- unsigned step_;
+
+ using super_::p_;
+ const box_<P>* b_;
};
@@ -202,59 +143,32 @@
template <typename P>
inline
box_fwd_piter_<P>::box_fwd_piter_(const box_<P>& b)
- : b_(b)
- {
- nop_ = b_.pmax();
- ++nop_[0];
- invalidate();
- }
-
- template <typename P>
- inline
- box_fwd_piter_<P>::operator P() const
- {
- return p_;
- }
-
- template <typename P>
- inline
- const P&
- box_fwd_piter_<P>::to_point() const
- {
- return p_;
- }
-
- template <typename P>
- inline
- mln_coord(P)
- box_fwd_piter_<P>::operator[](unsigned i) const
{
- assert(i < dim);
- return p_[i];
+ change_target(b);
}
template <typename P>
inline
bool
- box_fwd_piter_<P>::is_valid() const
+ box_fwd_piter_<P>::is_valid_() const
{
- return p_ != nop_;
+ return p_[0] != b_->pmax()[0] + 1;
}
template <typename P>
inline
void
- box_fwd_piter_<P>::invalidate()
+ box_fwd_piter_<P>::invalidate_()
{
- p_ = nop_;
+ p_[0] = b_->pmax()[0] + 1;
}
template <typename P>
inline
void
- box_fwd_piter_<P>::start()
+ box_fwd_piter_<P>::start_()
{
- p_ = b_.pmin();
+ p_ = b_->pmin();
}
template <typename P>
@@ -263,77 +177,57 @@
box_fwd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p_[i] == b_.pmax()[i])
- p_[i] = b_.pmin()[i];
+ if (p_[i] == b_->pmax()[i])
+ p_[i] = b_->pmin()[i];
else
{
++p_[i];
break;
}
- if (p_ == b_.pmin())
- p_ = nop_;
+ if (p_ == b_->pmin())
+ invalidate_();
}
-
- // box_bkd_piter_<P>
-
template <typename P>
inline
- box_bkd_piter_<P>::box_bkd_piter_(const box_<P>& b)
- : b_(b)
+ const box_<P>*&
+ box_fwd_piter_<P>::target_()
{
- nop_ = b_.pmin();
- --nop_[0];
- invalidate();
- }
-
- template <typename P>
- inline
- box_bkd_piter_<P>::operator P() const
- {
- return p_;
+ return b_;
}
- template <typename P>
- inline
- const P&
- box_bkd_piter_<P>::to_point() const
- {
- return p_;
- }
+ // box_bkd_piter_<P>
template <typename P>
inline
- mln_coord(P)
- box_bkd_piter_<P>::operator[](unsigned i) const
+ box_bkd_piter_<P>::box_bkd_piter_(const box_<P>& b)
{
- assert(i < dim);
- return p_[i];
+ change_target(&b);
}
template <typename P>
inline
bool
- box_bkd_piter_<P>::is_valid() const
+ box_bkd_piter_<P>::is_valid_() const
{
- return p_ != nop_;
+ return p_[0] != b_->pmin()[0] - 1;
}
template <typename P>
inline
void
- box_bkd_piter_<P>::invalidate()
+ box_bkd_piter_<P>::invalidate_()
{
- p_ = nop_;
+ p_[0] = b_->pmin()[0] - 1;
}
template <typename P>
inline
void
- box_bkd_piter_<P>::start()
+ box_bkd_piter_<P>::start_()
{
- p_ = b_.pmax();
+ p_ = b_->pmax();
}
template <typename P>
@@ -342,99 +236,23 @@
box_bkd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p_[i] == b_.pmin()[i])
- p_[i] = b_.pmax()[i];
+ if (p_[i] == b_->pmin()[i])
+ p_[i] = b_->pmax()[i];
else
{
--p_[i];
break;
}
- if (p_ == b_.pmax())
- p_ = nop_;
- }
-
-
- // box_bounds_piter_<P>
-
- template <typename P>
- inline
- box_bounds_piter_<P>::box_bounds_piter_(const box_<P>& b)
- : b_(b)
- {
- nop_ = b_.pmax();
- ++nop_[0];
- invalidate();
- }
-
- template <typename P>
- inline
- box_bounds_piter_<P>::operator P() const
- {
- return p_;
- }
-
- template <typename P>
- inline
- const P&
- box_bounds_piter_<P>::to_point() const
- {
- return p_;
+ if (p_ == b_->pmax())
+ invalidate_();
}
template <typename P>
inline
- mln_coord(P)
- box_bounds_piter_<P>::operator[](unsigned i) const
+ const box_<P>*&
+ box_bkd_piter_<P>::target_()
{
- assert(i < dim);
- return p_[i];
- }
-
- template <typename P>
- inline
- bool
- box_bounds_piter_<P>::is_valid() const
- {
- return p_ != nop_;
- }
-
- template <typename P>
- inline
- void
- box_bounds_piter_<P>::invalidate()
- {
- p_ = nop_;
- }
-
- template <typename P>
- inline
- void
- box_bounds_piter_<P>::start()
- {
- p_ = b_.pmin();
- step_ = 1;
- }
-
- template <typename P>
- inline
- void
- box_bounds_piter_<P>::next_()
- {
- if (step_ <= 2)
- p_[step_ - 1]++;
- if (step_ > 2)
- p_[step_ - 3]--;
-
- if (step_ > 2)
- if (p_[step_ - 3] == b_.pmin()[step_ - 3])
- step_++;
-
- if (step_ <= 2)
- if (p_[step_ - 1] == b_.pmax()[step_ - 1])
- step_++;
-
- if (step_ == 5)
- invalidate();
+ return b_;
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/p_array_piter.hh
--- mln/core/p_array_piter.hh (revision 1985)
+++ mln/core/p_array_piter.hh (working copy)
@@ -38,15 +38,18 @@
namespace mln
{
- /// \brief Forward iterator on points of a p_array<P>.
+ /// \brief Forward iterator on sites of a p_array<P>.
template <typename P>
class p_array_fwd_piter_
:
- public internal::site_iterator_base_< p_array_psite<P>,
+ public internal::site_iterator_base_< p_array<P>,
p_array_fwd_piter_<P> >
{
typedef p_array_fwd_piter_<P> self;
- typedef internal::site_iterator_base_<p_array_psite<P>, self> super;
+ typedef internal::site_iterator_base_<p_array<P>, self> super;
+
+ protected:
+ using super::p_;
public:
@@ -56,101 +59,68 @@
/// Constructor.
p_array_fwd_piter_(const p_array<P>& arr);
- /// Change of site set target.
- void change_target(const p_array<P>& arr);
-
/// Test if the iterator is valid.
- bool is_valid() const;
+ bool is_valid_() const;
/// Invalidate the iterator.
- void invalidate();
+ void invalidate_();
/// Start an iteration.
- void start();
+ void start_();
/// Go to the next point.
void next_();
- /// Return the subject.
- const p_array_psite<P>& unproxy() const;
+ /// Return the current index.
+ int index() const;
+ };
+
- // As a Site_Proxy:
+ template <typename P, typename A>
+ int index_of_in(const p_array_fwd_piter_<P>& p, const A& arr);
- typedef typename super::site site;
- const site& to_site() const;
- /// Return the current index.
- int index() const;
+
+ /// \brief Backward iterator on sites of a p_array<P>.
+ template <typename P>
+ class p_array_bkd_piter_
+ :
+ public internal::site_iterator_base_< p_array<P>,
+ p_array_bkd_piter_<P> >
+ {
+ typedef p_array_bkd_piter_<P> self;
+ typedef internal::site_iterator_base_<p_array<P>, self> super;
protected:
+ using super::p_;
- p_array_psite<P> p_;
- };
+ public:
+ /// Constructor with no argument.
+ p_array_bkd_piter_();
- template <typename P, typename A>
- int index_of_in(const p_array_fwd_piter_<P>& p, const A& arr)
- {
- return index_of_in(p.unproxy(), arr);
- }
+ /// Constructor.
+ p_array_bkd_piter_(const p_array<P>& arr);
+
+ /// Test if the iterator is valid.
+ bool is_valid_() const;
+
+ /// Invalidate the iterator.
+ void invalidate_();
+
+ /// Start an iteration.
+ void start_();
+
+ /// Go to the next point.
+ void next_();
+ /// Return the current index.
+ int index() const;
+ };
-// /// \brief Backward iterator on points of a p_array<P>.
-// template <typename P>
-// struct p_array_bkd_piter_
-// : public internal::site_iterator_base_< P, p_array_bkd_piter_<P> >
-// {
-// typedef p_array_bkd_piter_<P> self_;
-// typedef internal::site_iterator_base_< P, self_ > super_;
-// public:
-// /// The associated psite type.
-// typedef P psite;
-
-// /// The associated point type.
-// typedef mln_point(P) point;
-
-// enum { dim = super_::dim };
-
-// /// Coordinate associated type.
-// template <typename S>
-// p_array_bkd_piter_(const Site_Set<S>& s);
-
-// /// Reference of the corresponding psite.
-// const psite& to_psite() const;
-
-// /// Reference of the corresponding point.
-// const point& to_point() const;
-
-// /// Read-only access to the \p i-th coordinate.
-// mln_coord(point) operator[](unsigned i) const;
-
-// /// Test if the iterator is valid.
-// bool is_valid() const;
-
-// /// Invalidate the iterator.
-// void invalidate();
-
-// /// Start an iteration.
-// void start();
-
-// /// Go to the next point.
-// void next_();
-
-// /// Convert the iterator into a psite.
-// operator psite() const;
-
-// protected:
-// const std::vector<P>& vect_;
-// /* FIXME: See the comment on p_array_fwd_piter_<P>::i_ above. We
-// could turn this `int' into an `unsigned'. Then,
-// - setting the value of i_ to -1 (== UINT_MAX) in invalidate(),
-// - and having valid() test whether i_ is strictly smaller than
-// vect_.size()
-// should work in both iterators (fwd and bkd). */
-// int i_;
-// psite p_;
-// };
+ template <typename P, typename A>
+ int index_of_in(const p_array_bkd_piter_<P>& p, const A& arr);
# ifndef MLN_INCLUDE_ONLY
@@ -169,160 +139,125 @@
inline
p_array_fwd_piter_<P>::p_array_fwd_piter_(const p_array<P>& arr)
{
- change_target(arr);
+ this->change_target(arr);
}
template <typename P>
inline
- void
- p_array_fwd_piter_<P>::change_target(const p_array<P>& arr)
+ bool
+ p_array_fwd_piter_<P>::is_valid_() const
{
- p_.change_target(arr);
- invalidate();
+ mln_invariant(p_.index() >= 0);
+ return p_.index() < int(p_.target()->nsites());
}
template <typename P>
inline
- bool
- p_array_fwd_piter_<P>::is_valid() const
+ void
+ p_array_fwd_piter_<P>::invalidate_()
{
- return p_.target() != 0 && p_.index() < int(p_.target()->nsites());
+ p_.index() = int(p_.target()->nsites());
}
template <typename P>
inline
void
- p_array_fwd_piter_<P>::invalidate()
+ p_array_fwd_piter_<P>::start_()
{
- if (p_.target() != 0)
- p_.index() = p_.target()->nsites();
+ p_.index() = 0;
}
template <typename P>
inline
void
- p_array_fwd_piter_<P>::start()
+ p_array_fwd_piter_<P>::next_()
{
- mln_precondition(p_.target() != 0);
- p_.index() = 0;
+ ++p_.index();
+ }
+
+ template <typename P>
+ inline
+ int
+ p_array_fwd_piter_<P>::index() const
+ {
+ return p_.index();
+ }
+
+
+ /*------------------------.
+ | p_array_bkd_piter_<P>. |
+ `------------------------*/
+
+ template <typename P>
+ inline
+ p_array_bkd_piter_<P>::p_array_bkd_piter_()
+ {
+ }
+
+ template <typename P>
+ inline
+ p_array_bkd_piter_<P>::p_array_bkd_piter_(const p_array<P>& arr)
+ {
+ this->change_target(arr);
+ }
+
+ template <typename P>
+ inline
+ bool
+ p_array_bkd_piter_<P>::is_valid_() const
+ {
+ mln_invariant(p_.index() < int(p_.target()->nsites()));
+ return p_.index() >= 0;
}
template <typename P>
inline
void
- p_array_fwd_piter_<P>::next_()
+ p_array_bkd_piter_<P>::invalidate_()
{
- ++p_.index();
+ p_.index() = -1;
}
template <typename P>
inline
- const p_array_psite<P>&
- p_array_fwd_piter_<P>::unproxy() const
+ void
+ p_array_bkd_piter_<P>::start_()
{
- return p_;
+ p_.index() = int(p_.target()->nsites()) - 1;
}
template <typename P>
inline
- const typename p_array_fwd_piter_<P>::site&
- p_array_fwd_piter_<P>::to_site() const
+ void
+ p_array_bkd_piter_<P>::next_()
{
- mln_precondition(p_.target() != 0);
- return p_.to_site();
+ --p_.index();
}
template <typename P>
inline
int
- p_array_fwd_piter_<P>::index() const
+ p_array_bkd_piter_<P>::index() const
{
- mln_precondition(p_.target() != 0);
return p_.index();
}
- /*------------------------.
- | p_array_bkd_piter_<P>. |
- `------------------------*/
-// template <typename P>
-// template <typename S>
-// inline
-// p_array_bkd_piter_<P>::p_array_bkd_piter_(const Site_Set<S>& s)
-// : vect_(exact(s).vect())
-// {
-// invalidate();
-// }
-
-// template <typename P>
-// inline
-// const P&
-// p_array_bkd_piter_<P>::to_psite() const
-// {
-// return p_;
-// }
-
-// template <typename P>
-// inline
-// const mln_point(P)&
-// p_array_bkd_piter_<P>::to_point() const
-// {
-// return p_.to_point();
-// }
-
-// template <typename P>
-// inline
-// mln_coord(mln_point_(P))
-// p_array_bkd_piter_<P>::operator[](unsigned i) const
-// {
-// mln_precondition(i < dim);
-// mln_precondition(is_valid());
-// return p_.to_point()[i];
-// }
-
-// template <typename P>
-// inline
-// bool
-// p_array_bkd_piter_<P>::is_valid() const
-// {
-// return i_ >= 0;
-// }
-
-// template <typename P>
-// inline
-// void
-// p_array_bkd_piter_<P>::invalidate()
-// {
-// i_ = -1;
-// }
-
-// template <typename P>
-// inline
-// void
-// p_array_bkd_piter_<P>::start()
-// {
-// i_ = vect_.size() - 1;
-// if (is_valid())
-// p_ = vect_[i_];
-// }
-
-// template <typename P>
-// inline
-// void
-// p_array_bkd_piter_<P>::next_()
-// {
-// --i_;
-// if (is_valid())
-// p_ = vect_[i_];
-// }
-
-// template <typename P>
-// inline
-// p_array_bkd_piter_<P>::operator P() const
-// {
-// mln_precondition(is_valid());
-// return p_;
-// }
+ // Procedure.
+
+ template <typename P, typename A>
+ int
+ index_of_in(const p_array_fwd_piter_<P>& p, const A& arr)
+ {
+ return index_of_in(p.unproxy(), arr);
+ }
+
+ template <typename P, typename A>
+ int
+ index_of_in(const p_array_bkd_piter_<P>& p, const A& arr)
+ {
+ return index_of_in(p.unproxy(), arr);
+ }
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/point2d.hh
--- mln/core/point2d.hh (revision 1985)
+++ mln/core/point2d.hh (working copy)
@@ -61,6 +61,11 @@
{
return internal::force_exact<const E>(*this).to_site().col();
}
+ C operator[](unsigned i) const
+ {
+ mln_precondition(i < 2);
+ return internal::force_exact<const E>(*this).to_site()[i];
+ }
};
Index: mln/core/concept/site_proxy.hh
--- mln/core/concept/site_proxy.hh (revision 1985)
+++ mln/core/concept/site_proxy.hh (working copy)
@@ -107,6 +107,12 @@
};
+ // Access to site reference.
+
+ template <typename P>
+ const typename site_from<P>::ret&
+ to_site(const Object<P>& p);
+
} // end of namespace internal
@@ -160,6 +166,39 @@
m2 = 0;
}
+ namespace internal
+ {
+
+ // Access to site reference.
+
+ namespace deep
+ {
+
+ template <typename P>
+ const typename site_from<P>::ret&
+ to_site(const Site_Proxy<P>& p)
+ {
+ return exact(p).to_site();
+ }
+
+ template <typename P>
+ const typename site_from<P>::ret&
+ to_site(const Object<P>& p)
+ {
+ return exact(p);
+ }
+
+ } // end of namespace internal::deep
+
+ template <typename P>
+ const typename site_from<P>::ret&
+ to_site(const Object<P>& p)
+ {
+ return deep::to_site(exact(p));
+ }
+
+ } // end of namespace mln::internal
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/concept/site_iterator.hh
--- mln/core/concept/site_iterator.hh (revision 1985)
+++ mln/core/concept/site_iterator.hh (working copy)
@@ -55,10 +55,11 @@
struct Site_Iterator : public Site_Proxy<E>
{
/*
- bool is_valid() const;
- void invalidate();
- void start();
+ bool is_valid_() const;
+ void invalidate_();
+ void start_();
void next_();
+ const ..& target_() const;
*/
/*! \brief Go to the next element.
@@ -71,6 +72,15 @@
*/
void next(); // final
+ // FIXME: Doc!!!
+ bool is_valid() const;
+ void invalidate();
+ void start();
+
+ /// Change of site set target.
+ template <typename T>
+ void change_target(const T& the);
+
protected:
Site_Iterator();
};
@@ -80,8 +90,9 @@
# ifndef MLN_INCLUDE_ONLY
template <typename E>
+ inline
void
- Site_Iterator<E>::next() // final
+ Site_Iterator<E>::next()
{
mln_precondition(exact(this)->is_valid());
exact(this)->next_();
@@ -89,13 +100,55 @@
template <typename E>
inline
+ bool
+ Site_Iterator<E>::is_valid() const
+ {
+ E *const this_ = const_cast<E*const>(exact(this)); // Unconst.
+ if (this_->target_() == 0)
+ return false;
+ return exact(this)->is_valid_();
+ }
+
+ template <typename E>
+ inline
+ void
+ Site_Iterator<E>::invalidate()
+ {
+ if (exact(this)->target_() == 0)
+ return; // No-op.
+ exact(this)->invalidate_();
+ }
+
+ template <typename E>
+ inline
+ void
+ Site_Iterator<E>::start()
+ {
+ mln_precondition(exact(this)->target_() != 0);
+ exact(this)->start_();
+ }
+
+ template <typename E>
+ template <typename T>
+ inline
+ void
+ Site_Iterator<E>::change_target(const T& the)
+ {
+ exact(this)->target_() = & the;
+ exact(this)->invalidate_();
+ }
+
+ template <typename E>
+ inline
Site_Iterator<E>::Site_Iterator()
{
- bool (E::*m1)() const = & E::is_valid;
+ bool m0 = (& E::target_) == (& E::target_); // FIXME: Find a better test.
+ m0 = 0;
+ bool (E::*m1)() const = & E::is_valid_;
m1 = 0;
- void (E::*m2)() = & E::invalidate;
+ void (E::*m2)() = & E::invalidate_;
m2 = 0;
- void (E::*m3)() = & E::start;
+ void (E::*m3)() = & E::start_;
m3 = 0;
void (E::*m4)() = & E::next_;
m4 = 0;
Index: mln/core/p_array.hh
--- mln/core/p_array.hh (revision 1985)
+++ mln/core/p_array.hh (working copy)
@@ -83,7 +83,7 @@
const p_array<P>* target() const;
- void change_target(const p_array<P>& arr);
+ const p_array<P>*& target();
private:
@@ -136,7 +136,7 @@
typedef p_array_fwd_piter_<P> fwd_piter;
/// Backward Site_Iterator associated type.
- typedef p_array_fwd_piter_<P> bkd_piter; // HOT: FIXME
+ typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
p_array();
@@ -357,10 +357,10 @@
template <typename P>
inline
- void
- p_array_psite<P>::change_target(const p_array<P>& arr)
+ const p_array<P>*&
+ p_array_psite<P>::target()
{
- arr_ = & arr;
+ return arr_;
}
template <typename P>
1
0
cleanup-2008 1984: Change 'point' into 'site' in point-set-related tokens.
by Thierry Geraud 30 May '08
by Thierry Geraud 30 May '08
30 May '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Change 'point' into 'site' in point-set-related tokens.
Get rid of obsolete files / filenames.
* mln/core/internal/point_iterator_base.hh: Remove.
* mln/core/internal/point_set_base.hh: Rename as...
* mln/core/internal/site_set_base.hh: ...this.
* mln/core/concept/point_set.hh: Remove.
* mln/core/concept/doc/point_set.hh: Rename as...
* mln/core/concept/doc/site_set.hh: ...this.
* mln/core/concept/point_iterator.hh: Rename as...
* mln/core/concept/site_set.hh: ...this.
Rename 'point' as 'site' in some tokens.
* mln/core/line_graph_elt_neighborhood.hh,
* mln/core/window.hh,
* mln/core/pset_array.hh,
* mln/core/internal/graph_vicinity_piter.hh,
* mln/core/internal/line_graph_vicinity_piter.hh,
* mln/core/internal/piter_adaptor.hh,
* mln/core/internal/set_of.hh,
* mln/core/p_priority_queue_fast.hh,
* mln/core/p_bgraph_piter.hh,
* mln/core/neighb.hh,
* mln/core/p_priority_queue_fast_with_array.hh,
* mln/core/box_piter.hh,
* mln/core/dp_array.hh,
* mln/core/p_queue_fast.hh,
* mln/core/p_graph_piter.hh,
* mln/core/graph_elt_window.hh,
* mln/core/pset_if_piter.hh,
* mln/core/p_array_bb.hh,
* mln/core/p_array_piter.hh,
* mln/core/dpoints_piter.hh,
* mln/core/p_line_graph.hh,
* mln/core/p_image2d.hh,
* mln/core/p_image2d_piter.hh,
* mln/core/p_line_graph_piter.hh,
* mln/core/w_window.hh,
* mln/core/line_graph_elt_window.hh,
* mln/core/p_queue.hh,
* mln/core/clock_neighb.hh,
* mln/core/p_graph.hh,
* mln/core/hexa.hh,
* mln/core/line_piter.hh,
* mln/core/graph_elt_neighborhood.hh,
* mln/core/p_priority_queue.hh,
* mln/core/p_set.hh,
* mln/core/line2d.hh,
* mln/core/p_bgraph.hh,
* mln/core/p_run.hh,
* mln/core/p_run_piter.hh,
* mln/core/pset_if.hh,
* mln/core/p_array.hh,
* mln/core/concept/proxy.hh,
* mln/core/concept/box.hh,
* mln/core/concept/doc/image.hh,
* mln/core/concept/doc/weighted_window.hh,
* mln/core/concept/doc/point_iterator.hh,
* mln/core/concept/doc/window.hh,
* mln/core/concept/doc/neighborhood.hh,
* mln/core/concept/image.hh,
* mln/core/p_runs.hh,
* mln/test/predicate.hh,
* mln/convert/to_image.hh,
* mln/geom/pmin_pmax.hh,
* mln/geom/bbox.hh,
* mln/set/is_subset_of.hh,
* mln/win/cube3d.hh,
* mln/win/line.hh,
* mln/win/rectangle2d.hh,
* mln/win/diag2d.hh,
* mln/win/backdiag2d.hh,
* mln/win/cuboid3d.hh,
* mln/win/octagon2d.hh,
* mln/win/disk2d.hh,
* mln/util/lazy_set.hh,
* sandbox/duhamel/mesh_p.hh,
* sandbox/duhamel/queue_p_fast.hh,
* sandbox/duhamel/queue_p_priority.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast.hh,
* sandbox/pellegrin/set/core/p_bgraph.hh,
* sandbox/pellegrin/set/core/p_run.hh,
* sandbox/pellegrin/set/core/p_line_graph.hh,
* sandbox/pellegrin/set/core/pset_if.hh,
* sandbox/pellegrin/set/core/concept/point_set.hh,
* sandbox/pellegrin/set/core/p_array.hh,
* sandbox/pellegrin/set/core/p_queue.hh,
* sandbox/pellegrin/set/core/p_priority_queue.hh,
* sandbox/pellegrin/set/core/p_runs.hh,
* sandbox/pellegrin/set/core/p_set.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh,
* sandbox/pellegrin/set/core/line2d.hh,
* sandbox/pellegrin/set/core/internal/multi_set.hh,
* sandbox/pellegrin/set/core/internal/uni_set.hh,
* sandbox/pellegrin/set/core/p_graph.hh,
* sandbox/pellegrin/set/core/p_queue_fast.hh,
* sandbox/nivault/dyn_line.hh,
* sandbox/garrigues/fllt/types.hh
(Point_Iterator, point_iterator_base_): Rename as...
(Site_Iterator, site_iterator_base_): ...these.
(Point_Set, point_set_base_): Rename as...
(Site_Set, site_set_base_): ...these.
Clean-up.
* doc/tutorial/examples/p_array.cc (ima): Remove; unused.
Swap two lines.
doc/tutorial/examples/p_array.cc | 5 ---
mln/convert/to_image.hh | 2 -
mln/core/box_piter.hh | 14 +++++-----
mln/core/clock_neighb.hh | 4 +-
mln/core/concept/box.hh | 2 -
mln/core/concept/doc/image.hh | 4 +-
mln/core/concept/doc/neighborhood.hh | 6 ++--
mln/core/concept/doc/point_iterator.hh | 10 +++----
mln/core/concept/doc/site_set.hh | 2 -
mln/core/concept/doc/weighted_window.hh | 4 +-
mln/core/concept/doc/window.hh | 6 ++--
mln/core/concept/image.hh | 2 -
mln/core/concept/proxy.hh | 1
mln/core/concept/site_set.hh | 10 +++----
mln/core/dp_array.hh | 6 ++--
mln/core/dpoints_piter.hh | 6 ++--
mln/core/graph_elt_neighborhood.hh | 8 ++---
mln/core/graph_elt_window.hh | 8 ++---
mln/core/hexa.hh | 4 +-
mln/core/internal/graph_vicinity_piter.hh | 6 ++--
mln/core/internal/line_graph_vicinity_piter.hh | 6 ++--
mln/core/internal/piter_adaptor.hh | 6 ++--
mln/core/internal/set_of.hh | 4 +-
mln/core/internal/site_set_base.hh | 10 +++----
mln/core/line2d.hh | 6 ++--
mln/core/line_graph_elt_neighborhood.hh | 8 ++---
mln/core/line_graph_elt_window.hh | 8 ++---
mln/core/line_piter.hh | 6 ++--
mln/core/neighb.hh | 4 +-
mln/core/p_array.hh | 6 ++--
mln/core/p_array_bb.hh | 6 ++--
mln/core/p_array_piter.hh | 4 +-
mln/core/p_bgraph.hh | 6 ++--
mln/core/p_bgraph_piter.hh | 6 ++--
mln/core/p_graph.hh | 6 ++--
mln/core/p_graph_piter.hh | 10 +++----
mln/core/p_image2d.hh | 6 ++--
mln/core/p_image2d_piter.hh | 8 ++---
mln/core/p_line_graph.hh | 6 ++--
mln/core/p_line_graph_piter.hh | 10 +++----
mln/core/p_priority_queue.hh | 6 ++--
mln/core/p_priority_queue_fast.hh | 6 ++--
mln/core/p_priority_queue_fast_with_array.hh | 6 ++--
mln/core/p_queue.hh | 6 ++--
mln/core/p_queue_fast.hh | 6 ++--
mln/core/p_run.hh | 6 ++--
mln/core/p_run_piter.hh | 8 ++---
mln/core/p_runs.hh | 6 ++--
mln/core/p_set.hh | 6 ++--
mln/core/pset_array.hh | 6 ++--
mln/core/pset_if.hh | 6 ++--
mln/core/pset_if_piter.hh | 2 -
mln/core/w_window.hh | 4 +-
mln/core/window.hh | 4 +-
mln/geom/bbox.hh | 2 -
mln/geom/pmin_pmax.hh | 10 +++----
mln/set/is_subset_of.hh | 2 -
mln/test/predicate.hh | 2 -
mln/util/lazy_set.hh | 2 -
mln/win/backdiag2d.hh | 4 +-
mln/win/cube3d.hh | 4 +-
mln/win/cuboid3d.hh | 4 +-
mln/win/diag2d.hh | 4 +-
mln/win/disk2d.hh | 4 +-
mln/win/line.hh | 4 +-
mln/win/octagon2d.hh | 4 +-
mln/win/rectangle2d.hh | 4 +-
sandbox/duhamel/mesh_p.hh | 10 +++----
sandbox/duhamel/queue_p_fast.hh | 4 +-
sandbox/duhamel/queue_p_priority.hh | 4 +-
sandbox/garrigues/fllt/types.hh | 4 +-
sandbox/nivault/dyn_line.hh | 4 +-
sandbox/pellegrin/set/core/concept/point_set.hh | 2 -
sandbox/pellegrin/set/core/internal/multi_set.hh | 4 +-
sandbox/pellegrin/set/core/internal/uni_set.hh | 4 +-
sandbox/pellegrin/set/core/line2d.hh | 4 +-
sandbox/pellegrin/set/core/p_array.hh | 4 +-
sandbox/pellegrin/set/core/p_bgraph.hh | 4 +-
sandbox/pellegrin/set/core/p_graph.hh | 4 +-
sandbox/pellegrin/set/core/p_line_graph.hh | 4 +-
sandbox/pellegrin/set/core/p_priority_queue.hh | 4 +-
sandbox/pellegrin/set/core/p_priority_queue_fast.hh | 4 +-
sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh | 4 +-
sandbox/pellegrin/set/core/p_queue.hh | 4 +-
sandbox/pellegrin/set/core/p_queue_fast.hh | 4 +-
sandbox/pellegrin/set/core/p_run.hh | 4 +-
sandbox/pellegrin/set/core/p_runs.hh | 4 +-
sandbox/pellegrin/set/core/p_set.hh | 4 +-
sandbox/pellegrin/set/core/pset_if.hh | 4 +-
89 files changed, 230 insertions(+), 232 deletions(-)
Index: doc/tutorial/examples/p_array.cc
--- doc/tutorial/examples/p_array.cc (revision 1982)
+++ doc/tutorial/examples/p_array.cc (working copy)
@@ -2,7 +2,6 @@
# include <mln/core/p_array.hh>
# include <mln/debug/println.hh>
# include <mln/level/fill.hh>
-# include <mln/value/int_u8.hh>
template <typename A>
@@ -30,12 +29,10 @@
typedef p_array<point2d> Arr1;
Arr1 arr1;
- image2d<value::int_u8> ima(5, 5);
-
{
point2d p(1,1);
- dpoint2d dp[] = { right, right, down, down, left, left, up };
arr1.append(p);
+ dpoint2d dp[] = { right, right, down, down, left, left, up };
for (unsigned i = 0; i < 7; ++i)
p += dp[i], arr1.append(p);
Index: mln/core/line_graph_elt_neighborhood.hh
--- mln/core/line_graph_elt_neighborhood.hh (revision 1982)
+++ mln/core/line_graph_elt_neighborhood.hh (working copy)
@@ -79,11 +79,11 @@
// FIXME: This is a dummy value.
typedef void dpoint;
- /// \brief Point_Iterator type to browse the psites of the
+ /// \brief Site_Iterator type to browse the psites of the
/// neighborhood w.r.t. the ordering of edges.
typedef line_graph_neighborhood_fwd_piter<P, self_> fwd_niter;
- /// \brief Point_Iterator type to browse the psites of the
+ /// \brief Site_Iterator type to browse the psites of the
/// neighborhood w.r.t. the reverse ordering of edges.
typedef line_graph_neighborhood_bkd_piter<P, self_> bkd_niter;
@@ -95,7 +95,7 @@
/// \{
/// Compute the set of sites for this neighborhood around \a piter.
template <typename Piter>
- void compute_sites_(Point_Iterator<Piter>& piter) const;
+ void compute_sites_(Site_Iterator<Piter>& piter) const;
/// \}
};
@@ -107,7 +107,7 @@
template <typename Piter>
inline
void
- line_graph_elt_neighborhood<P>::compute_sites_(Point_Iterator<Piter>& piter_) const
+ line_graph_elt_neighborhood<P>::compute_sites_(Site_Iterator<Piter>& piter_) const
{
Piter& piter = exact(piter_);
util::edge_id ref_edge_id = piter.p_ref().id();
Index: mln/core/window.hh
--- mln/core/window.hh (revision 1982)
+++ mln/core/window.hh (working copy)
@@ -67,12 +67,12 @@
typedef internal::dpoints_base_<D, window<D> > super_;
public:
- /*! \brief Point_Iterator type to browse the points of a generic window
+ /*! \brief Site_Iterator type to browse the points of a generic window
* w.r.t. the ordering of delta-points.
*/
typedef dpoints_fwd_piter<D> fwd_qiter;
- /*! \brief Point_Iterator type to browse the points of a generic window
+ /*! \brief Site_Iterator type to browse the points of a generic window
* w.r.t. the reverse ordering of delta-points.
*/
typedef dpoints_bkd_piter<D> bkd_qiter;
Index: mln/core/pset_array.hh
--- mln/core/pset_array.hh (revision 1982)
+++ mln/core/pset_array.hh (working copy)
@@ -34,8 +34,8 @@
* \brief Definition of the pset array class.
*/
-# include <mln/core/internal/point_set_base.hh>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_set_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <vector>
# include <mln/accu/bbox.hh>
@@ -198,7 +198,7 @@
*/
template <typename Pset>
class pset_array_fwd_piter_ : public
- internal::point_iterator_base_<pset_array_psite<typename Pset::psite>,
+ internal::site_iterator_base_<pset_array_psite<typename Pset::psite>,
pset_array_fwd_piter_<Pset> >
{
public:
Index: mln/core/internal/graph_vicinity_piter.hh
--- mln/core/internal/graph_vicinity_piter.hh (revision 1982)
+++ mln/core/internal/graph_vicinity_piter.hh (working copy)
@@ -37,7 +37,7 @@
- mln::internal::graph_vicinity_piter.hh
- mln::internal::line_graph_vicinity_piter.hh */
-# include <mln/core/concept/point_iterator.hh>
+# include <mln/core/concept/site_iterator.hh>
# include <mln/core/p_graph.hh>
# include <mln/core/graph_psite.hh>
@@ -61,10 +61,10 @@
/// \brief Base for iterator on a graph vicinity.
template <typename P, typename E>
- class graph_vicinity_piter_ : public Point_Iterator< E >
+ class graph_vicinity_piter_ : public Site_Iterator< E >
{
typedef graph_vicinity_piter_<P, E> self_;
- typedef Point_Iterator< self_ > super_;
+ typedef Site_Iterator< self_ > super_;
public:
enum { dim = P::dim };
Index: mln/core/internal/line_graph_vicinity_piter.hh
--- mln/core/internal/line_graph_vicinity_piter.hh (revision 1982)
+++ mln/core/internal/line_graph_vicinity_piter.hh (working copy)
@@ -39,7 +39,7 @@
# include <set>
-# include <mln/core/concept/point_iterator.hh>
+# include <mln/core/concept/site_iterator.hh>
# include <mln/core/p_line_graph.hh>
# include <mln/core/line_graph_psite.hh>
@@ -59,10 +59,10 @@
/// \brief Base for iterator on a line graph vicinity.
template <typename P, typename E>
- class line_graph_vicinity_piter_ : public Point_Iterator< E >
+ class line_graph_vicinity_piter_ : public Site_Iterator< E >
{
typedef line_graph_vicinity_piter_<P, E> self_;
- typedef Point_Iterator< self_ > super_;
+ typedef Site_Iterator< self_ > super_;
public:
enum { dim = P::dim };
Index: mln/core/internal/piter_adaptor.hh
--- mln/core/internal/piter_adaptor.hh (revision 1982)
+++ mln/core/internal/piter_adaptor.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of iterators on points of boxes.
*/
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/concept/box.hh>
@@ -48,9 +48,9 @@
* parameter E is the exact type.
*/
template <typename Pi, typename E>
- class piter_adaptor_ : public internal::point_iterator_base_< mln_psite(Pi), E >
+ class piter_adaptor_ : public internal::site_iterator_base_< mln_psite(Pi), E >
{
- typedef internal::point_iterator_base_< mln_psite(Pi), E > super_;
+ typedef internal::site_iterator_base_< mln_psite(Pi), E > super_;
public:
// Make dim definition from super class available.
Index: mln/core/internal/site_set_base.hh
--- mln/core/internal/site_set_base.hh (revision 1981)
+++ mln/core/internal/site_set_base.hh (working copy)
@@ -25,15 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_INTERNAL_POINT_SET_BASE_HH
-# define MLN_CORE_INTERNAL_POINT_SET_BASE_HH
+#ifndef MLN_CORE_INTERNAL_SITE_SET_BASE_HH
+# define MLN_CORE_INTERNAL_SITE_SET_BASE_HH
-/*! \file mln/core/internal/point_set_base.hh
+/*! \file mln/core/internal/site_set_base.hh
*
* \brief Definition of a base class for site set classes.
*/
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/site_proxy.hh>
# include <mln/core/grids.hh>
# include <mln/metal/is_a.hh>
@@ -77,4 +77,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_INTERNAL_POINT_SET_BASE_HH
+#endif // ! MLN_CORE_INTERNAL_SITE_SET_BASE_HH
Index: mln/core/internal/set_of.hh
--- mln/core/internal/set_of.hh (revision 1982)
+++ mln/core/internal/set_of.hh (working copy)
@@ -175,7 +175,7 @@
*
* \relates mln::internal::set_of_
*/
- // FIXME : ambiguous with point_set operator <<
+ // FIXME : ambiguous with site_set operator <<
// template <typename E>
// std::ostream& operator<<(std::ostream& ostr, const set_of_<E>& s);
@@ -285,7 +285,7 @@
needs_update_ = false;
}
- // FIXME : ambiguous with point_set operator <<
+ // FIXME : ambiguous with site_set operator <<
// template <typename E>
// std::ostream& operator<<(std::ostream& ostr,
// const set_of_<E>& s)
Index: mln/core/p_priority_queue_fast.hh
--- mln/core/p_priority_queue_fast.hh (revision 1982)
+++ mln/core/p_priority_queue_fast.hh (working copy)
@@ -40,7 +40,7 @@
# include <algorithm>
# include <iterator>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/accu/bbox.hh>
# include <mln/core/p_queue_fast.hh>
@@ -67,10 +67,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/p_bgraph_piter.hh
--- mln/core/p_bgraph_piter.hh (revision 1982)
+++ mln/core/p_bgraph_piter.hh (working copy)
@@ -30,7 +30,7 @@
# include <utility>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/p_bgraph.hh>
# include <mln/core/bgraph_psite.hh>
@@ -49,10 +49,10 @@
// FIXME: check the constraint due to the boost iterators
template<typename P>
class p_bgraph_piter_
- : public internal::point_iterator_base_< P, p_bgraph_piter_<P> >
+ : public internal::site_iterator_base_< P, p_bgraph_piter_<P> >
{
typedef p_bgraph_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
typedef std::pair<typename p_bgraph<P>::node_iterator,
typename p_bgraph<P>::node_iterator> iterators_type_;
Index: mln/core/neighb.hh
--- mln/core/neighb.hh (revision 1982)
+++ mln/core/neighb.hh (working copy)
@@ -61,12 +61,12 @@
/// Point associated type.
typedef mln_point(D) point;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the ordering of delta-points.
*/
typedef dpoints_fwd_piter<D> fwd_niter;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the reverse ordering of delta-points.
*/
typedef dpoints_bkd_piter<D> bkd_niter;
Index: mln/core/p_priority_queue_fast_with_array.hh
--- mln/core/p_priority_queue_fast_with_array.hh (revision 1982)
+++ mln/core/p_priority_queue_fast_with_array.hh (working copy)
@@ -40,7 +40,7 @@
# include <algorithm>
# include <iterator>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/accu/bbox.hh>
# include <mln/core/p_queue_fast.hh>
@@ -67,10 +67,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/box_piter.hh
--- mln/core/box_piter.hh (revision 1982)
+++ mln/core/box_piter.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of iterators on points of boxes.
*/
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/concept/box.hh>
@@ -47,10 +47,10 @@
* \see mln::box_
*/
template <typename P>
- class box_fwd_piter_ : public internal::point_iterator_base_< P, box_fwd_piter_<P> >
+ class box_fwd_piter_ : public internal::site_iterator_base_< P, box_fwd_piter_<P> >
{
typedef box_fwd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
@@ -97,10 +97,10 @@
* \see mln::box_
*/
template <typename P>
- class box_bkd_piter_ : public internal::point_iterator_base_< P, box_bkd_piter_<P> >
+ class box_bkd_piter_ : public internal::site_iterator_base_< P, box_bkd_piter_<P> >
{
typedef box_bkd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
@@ -149,10 +149,10 @@
*/
template <typename P>
- class box_bounds_piter_ : public internal::point_iterator_base_< P, box_bounds_piter_<P> >
+ class box_bounds_piter_ : public internal::site_iterator_base_< P, box_bounds_piter_<P> >
{
typedef box_bounds_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
Index: mln/core/dp_array.hh
--- mln/core/dp_array.hh (revision 1982)
+++ mln/core/dp_array.hh (working copy)
@@ -35,7 +35,7 @@
# include <vector>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/accu/bbox.hh>
@@ -67,12 +67,12 @@
/// Point associated type.
typedef mln_point(D) point;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the ordering of delta-points.
*/
typedef dpoints_fwd_piter<D> fwd_niter;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the reverse ordering of delta-points.
*/
typedef dpoints_bkd_piter<D> bkd_niter;
Index: mln/core/p_queue_fast.hh
--- mln/core/p_queue_fast.hh (revision 1982)
+++ mln/core/p_queue_fast.hh (working copy)
@@ -39,7 +39,7 @@
# include <algorithm>
# include <iterator>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/accu/bbox.hh>
@@ -66,10 +66,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/p_graph_piter.hh
--- mln/core/p_graph_piter.hh (revision 1982)
+++ mln/core/p_graph_piter.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_P_GRAPH_PITER_HH
# define MLN_CORE_P_GRAPH_PITER_HH
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/p_graph.hh>
# include <mln/core/graph_psite.hh>
@@ -49,10 +49,10 @@
/// \brief Forward iterator on point sites of a mln::p_graph<P>.
template<typename P>
class p_graph_fwd_piter_
- : public internal::point_iterator_base_< P, p_graph_fwd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_graph_fwd_piter_<P> >
{
typedef p_graph_fwd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
@@ -125,10 +125,10 @@
/// \brief Backward iterator on point sites of a mln::p_graph<P>.
template<typename P>
class p_graph_bkd_piter_
- : public internal::point_iterator_base_< P, p_graph_bkd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_graph_bkd_piter_<P> >
{
typedef p_graph_bkd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
Index: mln/core/graph_elt_window.hh
--- mln/core/graph_elt_window.hh (revision 1982)
+++ mln/core/graph_elt_window.hh (working copy)
@@ -76,11 +76,11 @@
// FIXME: This is a dummy value.
typedef void dpoint;
- /// \brief Point_Iterator type to browse the psites of the window
+ /// \brief Site_Iterator type to browse the psites of the window
/// w.r.t. the ordering of vertices.
typedef graph_window_fwd_piter<P, self_> fwd_qiter;
- /// \brief Point_Iterator type to browse the psites of the window
+ /// \brief Site_Iterator type to browse the psites of the window
/// w.r.t. the reverse ordering of vertices.
typedef graph_window_bkd_piter<P, self_> bkd_qiter;
@@ -92,7 +92,7 @@
/// \{
/// Compute the set of sites for this window around \a piter.
template <typename Piter>
- void compute_sites_(Point_Iterator<Piter>& piter) const;
+ void compute_sites_(Site_Iterator<Piter>& piter) const;
/// \}
/// Interface of the concept Window.
@@ -129,7 +129,7 @@
template <typename Piter>
inline
void
- graph_elt_window<P>::compute_sites_(Point_Iterator<Piter>& piter_) const
+ graph_elt_window<P>::compute_sites_(Site_Iterator<Piter>& piter_) const
{
Piter& piter = exact(piter_);
util::node_id ref_node_id = piter.p_ref().id();
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 1982)
+++ mln/core/pset_if_piter.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of iterators on points of pset_ifes.
*/
-# include <mln/core/concept/point_iterator.hh>
+# include <mln/core/concept/site_iterator.hh>
# include <mln/core/internal/piter_adaptor.hh>
# include <mln/core/pset_if.hh>
Index: mln/core/p_array_bb.hh
--- mln/core/p_array_bb.hh (revision 1982)
+++ mln/core/p_array_bb.hh (working copy)
@@ -35,7 +35,7 @@
# include <vector>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/accu/bbox.hh>
@@ -66,10 +66,10 @@
/// The associated point type.
typedef mln_point(P) point;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/p_array_piter.hh
--- mln/core/p_array_piter.hh (revision 1982)
+++ mln/core/p_array_piter.hh (working copy)
@@ -98,10 +98,10 @@
// /// \brief Backward iterator on points of a p_array<P>.
// template <typename P>
// struct p_array_bkd_piter_
-// : public internal::point_iterator_base_< P, p_array_bkd_piter_<P> >
+// : public internal::site_iterator_base_< P, p_array_bkd_piter_<P> >
// {
// typedef p_array_bkd_piter_<P> self_;
-// typedef internal::point_iterator_base_< P, self_ > super_;
+// typedef internal::site_iterator_base_< P, self_ > super_;
// public:
// /// The associated psite type.
// typedef P psite;
Index: mln/core/dpoints_piter.hh
--- mln/core/dpoints_piter.hh (revision 1982)
+++ mln/core/dpoints_piter.hh (working copy)
@@ -35,7 +35,7 @@
*/
# include <vector>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/concept/point_site.hh>
@@ -48,7 +48,7 @@
* The parameter \c D is the type of delta-points.
*/
template <typename D>
- class dpoints_fwd_piter : public internal::point_iterator_base_< mln_point(D), dpoints_fwd_piter<D> >
+ class dpoints_fwd_piter : public internal::site_iterator_base_< mln_point(D), dpoints_fwd_piter<D> >
{
public:
@@ -106,7 +106,7 @@
* The parameter \c D is the type of delta-points.
*/
template <typename D>
- class dpoints_bkd_piter : public internal::point_iterator_base_< mln_point(D), dpoints_bkd_piter<D> >
+ class dpoints_bkd_piter : public internal::site_iterator_base_< mln_point(D), dpoints_bkd_piter<D> >
{
public:
Index: mln/core/p_line_graph.hh
--- mln/core/p_line_graph.hh (revision 1982)
+++ mln/core/p_line_graph.hh (working copy)
@@ -29,7 +29,7 @@
# define MLN_CORE_LINE_GRAPH_P_HH
# include <mln/core/concept/point_site.hh>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/accu/bbox.hh>
# include <mln/util/graph.hh>
# include <mln/util/tracked_ptr.hh>
@@ -68,10 +68,10 @@
/// Point_Site associated type.
typedef line_graph_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_line_graph_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_line_graph_bkd_piter_<P> bkd_piter;
/// Return The number of points (sites) of the set, i.e., the
Index: mln/core/p_image2d.hh
--- mln/core/p_image2d.hh (revision 1982)
+++ mln/core/p_image2d.hh (working copy)
@@ -34,7 +34,7 @@
* \brief Definition of a point set class based on a image of booleans.
*/
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/box2d.hh>
# include <mln/core/image2d.hh>
# include <mln/core/sub_image.hh>
@@ -61,10 +61,10 @@
typedef image2d<bool> image_type;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_image2d_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_image2d_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/p_image2d_piter.hh
--- mln/core/p_image2d_piter.hh (revision 1982)
+++ mln/core/p_image2d_piter.hh (working copy)
@@ -41,10 +41,10 @@
/// \brief Forward iterator on points of a p_array<P>.
template <typename P>
struct p_image2d_fwd_piter_
- : public internal::point_iterator_base_< P, p_image2d_fwd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_image2d_fwd_piter_<P> >
{
typedef p_image2d_fwd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
/// The associated psite type.
typedef P psite;
@@ -92,10 +92,10 @@
/// \brief Backward iterator on points of a p_array<P>.
template <typename P>
struct p_image2d_bkd_piter_
- : public internal::point_iterator_base_< P, p_image2d_bkd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_image2d_bkd_piter_<P> >
{
typedef p_image2d_bkd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
/// The associated psite type.
typedef P psite;
Index: mln/core/p_line_graph_piter.hh
--- mln/core/p_line_graph_piter.hh (revision 1982)
+++ mln/core/p_line_graph_piter.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_P_LINE_GRAPH_PITER_HH
# define MLN_CORE_P_LINE_GRAPH_PITER_HH
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/p_line_graph.hh>
# include <mln/core/line_graph_psite.hh>
@@ -49,10 +49,10 @@
/// \brief Forward iterator on point sites of a mln::p_line_graph<P>.
template<typename P>
class p_line_graph_fwd_piter_
- : public internal::point_iterator_base_< P, p_line_graph_fwd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_line_graph_fwd_piter_<P> >
{
typedef p_line_graph_fwd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
@@ -129,10 +129,10 @@
/// \brief Backward iterator on point sites of a mln::p_line_graph<P>.
template<typename P>
class p_line_graph_bkd_piter_
- : public internal::point_iterator_base_< P, p_line_graph_bkd_piter_<P> >
+ : public internal::site_iterator_base_< P, p_line_graph_bkd_piter_<P> >
{
typedef p_line_graph_bkd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
Index: mln/core/w_window.hh
--- mln/core/w_window.hh (revision 1982)
+++ mln/core/w_window.hh (working copy)
@@ -69,10 +69,10 @@
typedef mln::window<D> window;
- /// Point_Iterator type to browse (forward) the points of a generic w_window.
+ /// Site_Iterator type to browse (forward) the points of a generic w_window.
typedef with_w_< dpoints_fwd_piter<D>, W > fwd_qiter;
- /// Point_Iterator type to browse (backward) the points of a generic w_window.
+ /// Site_Iterator type to browse (backward) the points of a generic w_window.
typedef with_w_< dpoints_bkd_piter<D>, W > bkd_qiter;
Index: mln/core/line_graph_elt_window.hh
--- mln/core/line_graph_elt_window.hh (revision 1982)
+++ mln/core/line_graph_elt_window.hh (working copy)
@@ -76,11 +76,11 @@
// FIXME: This is a dummy value.
typedef void dpoint;
- /// \brief Point_Iterator type to browse the psites of the window
+ /// \brief Site_Iterator type to browse the psites of the window
/// w.r.t. the ordering of edges.
typedef line_graph_window_fwd_piter<P, self_> fwd_qiter;
- /// \brief Point_Iterator type to browse the psites of the window
+ /// \brief Site_Iterator type to browse the psites of the window
/// w.r.t. the reverse ordering of edges.
typedef line_graph_window_bkd_piter<P, self_> bkd_qiter;
@@ -92,7 +92,7 @@
/// \{
/// Compute the set of sites for this window around \a piter.
template <typename Piter>
- void compute_sites_(Point_Iterator<Piter>& piter) const;
+ void compute_sites_(Site_Iterator<Piter>& piter) const;
/// \}
/// Interface of the concept Window.
@@ -129,7 +129,7 @@
template <typename Piter>
inline
void
- line_graph_elt_window<P>::compute_sites_(Point_Iterator<Piter>& piter_) const
+ line_graph_elt_window<P>::compute_sites_(Site_Iterator<Piter>& piter_) const
{
Piter& piter = exact(piter_);
sites_t& sites = piter.sites();
Index: mln/core/p_queue.hh
--- mln/core/p_queue.hh (revision 1982)
+++ mln/core/p_queue.hh (working copy)
@@ -38,7 +38,7 @@
# include <algorithm>
# include <iterator>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/accu/bbox.hh>
@@ -67,10 +67,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/clock_neighb.hh
--- mln/core/clock_neighb.hh (revision 1982)
+++ mln/core/clock_neighb.hh (working copy)
@@ -60,12 +60,12 @@
/// Point associated type.
typedef mln_point(D) point;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the ordering of delta-points.
*/
typedef dpoints_fwd_piter<D> fwd_niter;
- /*! \brief Point_Iterator type to browse the points of a generic
+ /*! \brief Site_Iterator type to browse the points of a generic
* neighborhood w.r.t. the reverse ordering of delta-points.
*
* !!! Be careful the start delta point become the last now.
Index: mln/core/p_graph.hh
--- mln/core/p_graph.hh (revision 1982)
+++ mln/core/p_graph.hh (working copy)
@@ -29,7 +29,7 @@
# define MLN_CORE_P_GRAPH_HH
# include <mln/core/concept/point_site.hh>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/accu/bbox.hh>
# include <mln/util/tracked_ptr.hh>
# include <mln/util/graph.hh>
@@ -62,10 +62,10 @@
/// Point_Site associated type.
typedef graph_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_graph_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_graph_bkd_piter_<P> bkd_piter;
/// Return The number of points (sites) of the set, i.e., the
Index: mln/core/hexa.hh
--- mln/core/hexa.hh (revision 1982)
+++ mln/core/hexa.hh (working copy)
@@ -134,11 +134,11 @@
typedef point2d_h psite;
/// FIXME : should it be in box2d_h?
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef hexa_fwd_piter_<box2d> fwd_piter;
/// FIXME : should it be in box2d_h?
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef hexa_bkd_piter_<box2d> bkd_piter;
Index: mln/core/line_piter.hh
--- mln/core/line_piter.hh (revision 1982)
+++ mln/core/line_piter.hh (working copy)
@@ -35,7 +35,7 @@
* \todo Rename as box_line_piter.
*/
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/box.hh>
namespace mln
@@ -47,10 +47,10 @@
*/
template <typename P>
class line_piter_ :
- public internal::point_iterator_base_< P, line_piter_<P> >
+ public internal::site_iterator_base_< P, line_piter_<P> >
{
typedef line_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
Index: mln/core/graph_elt_neighborhood.hh
--- mln/core/graph_elt_neighborhood.hh (revision 1982)
+++ mln/core/graph_elt_neighborhood.hh (working copy)
@@ -77,11 +77,11 @@
// FIXME: This is a dummy value.
typedef void dpoint;
- /// \brief Point_Iterator type to browse the psites of the
+ /// \brief Site_Iterator type to browse the psites of the
/// neighborhood w.r.t. the ordering of vertices.
typedef graph_neighborhood_fwd_piter<P, self_> fwd_niter;
- /// \brief Point_Iterator type to browse the psites of the
+ /// \brief Site_Iterator type to browse the psites of the
/// neighborhood w.r.t. the reverse ordering of vertices.
typedef graph_neighborhood_bkd_piter<P, self_> bkd_niter;
@@ -93,7 +93,7 @@
/// \{
/// Compute the set of sites for this neighborhood around \a piter.
template <typename Piter>
- void compute_sites_(Point_Iterator<Piter>& piter) const;
+ void compute_sites_(Site_Iterator<Piter>& piter) const;
/// \}
};
@@ -104,7 +104,7 @@
template <typename Piter>
inline
void
- graph_elt_neighborhood<P>::compute_sites_(Point_Iterator<Piter>& piter_) const
+ graph_elt_neighborhood<P>::compute_sites_(Site_Iterator<Piter>& piter_) const
{
Piter& piter = exact(piter_);
util::node_id ref_node_id = piter.p_ref().id();
Index: mln/core/p_priority_queue.hh
--- mln/core/p_priority_queue.hh (revision 1982)
+++ mln/core/p_priority_queue.hh (working copy)
@@ -40,7 +40,7 @@
# include <algorithm>
# include <iterator>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/accu/bbox.hh>
# include <mln/core/p_queue.hh>
@@ -67,10 +67,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/p_set.hh
--- mln/core/p_set.hh (revision 1982)
+++ mln/core/p_set.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of a point set class based on std::set.
*/
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/internal/set_of.hh>
# include <mln/accu/bbox.hh>
# include <mln/core/p_array.hh>
@@ -57,10 +57,10 @@
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: mln/core/line2d.hh
--- mln/core/line2d.hh (revision 1982)
+++ mln/core/line2d.hh (working copy)
@@ -35,7 +35,7 @@
# include <vector>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/core/box2d.hh>
# include <mln/math/all.hh>
@@ -51,10 +51,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<point2d> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<point2d> bkd_piter;
Index: mln/core/p_bgraph.hh
--- mln/core/p_bgraph.hh (revision 1982)
+++ mln/core/p_bgraph.hh (working copy)
@@ -31,7 +31,7 @@
# include <utility>
# include <mln/core/concept/point_site.hh>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/accu/bbox.hh>
# include <mln/util/internal/boost_graph.hh>
# include <mln/core/bgraph_psite.hh>
@@ -56,10 +56,10 @@
/// Point_Site associated type.
typedef bgraph_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_bgraph_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_bgraph_piter_<P> bkd_piter;
/// Graph vertex/edge identifier
Index: mln/core/p_run.hh
--- mln/core/p_run.hh (revision 1982)
+++ mln/core/p_run.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of a point set class based on std::set.
*/
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/internal/set_of.hh>
# include <mln/accu/bbox.hh>
@@ -57,10 +57,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_run_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_run_bkd_piter_<P> bkd_piter;
/// Constructor without argument.
Index: mln/core/p_run_piter.hh
--- mln/core/p_run_piter.hh (revision 1982)
+++ mln/core/p_run_piter.hh (working copy)
@@ -43,10 +43,10 @@
*
*/
template <typename P>
- struct p_run_fwd_piter_ : public internal::point_iterator_base_< P, p_run_fwd_piter_<P> >
+ struct p_run_fwd_piter_ : public internal::site_iterator_base_< P, p_run_fwd_piter_<P> >
{
typedef p_run_fwd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
@@ -98,10 +98,10 @@
*
*/
template <typename P>
- struct p_run_bkd_piter_ : public internal::point_iterator_base_< P, p_run_bkd_piter_<P> >
+ struct p_run_bkd_piter_ : public internal::site_iterator_base_< P, p_run_bkd_piter_<P> >
{
typedef p_run_bkd_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
// Make definitions from super class available.
Index: mln/core/pset_if.hh
--- mln/core/pset_if.hh (revision 1982)
+++ mln/core/pset_if.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of the restriction of a point set w.r.t. a predicate.
*/
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/concept/function.hh>
@@ -73,10 +73,10 @@
typedef mln_psite(super_) psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef pset_if_fwd_piter_<S,F> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef mln::internal::fixme bkd_piter;
Index: mln/core/p_array.hh
--- mln/core/p_array.hh (revision 1982)
+++ mln/core/p_array.hh (working copy)
@@ -35,7 +35,7 @@
# include <vector>
-# include <mln/core/internal/point_set_base.hh>
+# include <mln/core/internal/site_set_base.hh>
# include <mln/core/internal/pseudo_site_base.hh>
# include <mln/accu/bbox.hh>
@@ -132,10 +132,10 @@
/// The associated site type.
typedef typename super::site site;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> bkd_piter; // HOT: FIXME
/// Constructor.
Index: mln/core/concept/proxy.hh
--- mln/core/concept/proxy.hh (revision 1982)
+++ mln/core/concept/proxy.hh (working copy)
@@ -34,6 +34,7 @@
*/
# include <mln/core/concept/object.hh>
+# include <mln/core/internal/force_exact.hh>
# include <mln/trait/all.hh>
Index: mln/core/concept/box.hh
--- mln/core/concept/box.hh (revision 1982)
+++ mln/core/concept/box.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of the concept of mln::Box.
*/
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
namespace mln
Index: mln/core/concept/doc/image.hh
--- mln/core/concept/doc/image.hh (revision 1982)
+++ mln/core/concept/doc/image.hh (working copy)
@@ -143,12 +143,12 @@
/*! \brief Forward point iterator associated type.
- * \invariant This type has to derive from mln::Point_Iterator.
+ * \invariant This type has to derive from mln::Site_Iterator.
*/
typedef void fwd_piter;
/*! \brief Backward point iterator associated type.
- * \invariant This type has to derive from mln::Point_Iterator.
+ * \invariant This type has to derive from mln::Site_Iterator.
*/
typedef void bkd_piter;
Index: mln/core/concept/doc/weighted_window.hh
--- mln/core/concept/doc/weighted_window.hh (revision 1982)
+++ mln/core/concept/doc/weighted_window.hh (working copy)
@@ -46,12 +46,12 @@
struct Weighted_Window : public Object<E>
{
- /*! \brief Point_Iterator type associated to this weighted_window to browse its
+ /*! \brief Site_Iterator type associated to this weighted_window to browse its
* points in a forward way.
*/
typedef void fwd_qiter;
- /*! \brief Point_Iterator type associated to this weighted_window to browse its
+ /*! \brief Site_Iterator type associated to this weighted_window to browse its
* points in a backward way.
*/
typedef void bkd_qiter;
Index: mln/core/concept/doc/point_iterator.hh
--- mln/core/concept/doc/point_iterator.hh (revision 1982)
+++ mln/core/concept/doc/point_iterator.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file mln/core/concept/doc/point_iterator.hh
- * \brief This file documents the concept of mln::Point_Iterator.
+/*! \file mln/core/concept/doc/site_iterator.hh
+ * \brief This file documents the concept of mln::Site_Iterator.
*/
namespace mln
@@ -35,12 +35,12 @@
namespace doc
{
- /*! \brief Documentation class for mln::Point_Iterator.
+ /*! \brief Documentation class for mln::Site_Iterator.
*
- * \see mln::Point_Iterator
+ * \see mln::Site_Iterator
*/
template <typename E>
- struct Point_Iterator : public Iterator<E>,
+ struct Site_Iterator : public Iterator<E>,
public Generalized_Point<E>
{
/*! \brief Point_Site associated type.
Index: mln/core/concept/doc/window.hh
--- mln/core/concept/doc/window.hh (revision 1982)
+++ mln/core/concept/doc/window.hh (working copy)
@@ -45,17 +45,17 @@
template <typename E>
struct Window : public Object<E>
{
- /*! \brief Point_Iterator type associated to this window to browse its
+ /*! \brief Site_Iterator type associated to this window to browse its
* points.
*/
typedef void qiter;
- /*! \brief Point_Iterator type associated to this window to browse its
+ /*! \brief Site_Iterator type associated to this window to browse its
* points in a forward way.
*/
typedef void fwd_qiter;
- /*! \brief Point_Iterator type associated to this window to browse its
+ /*! \brief Site_Iterator type associated to this window to browse its
* points in a backward way.
*/
typedef void bkd_qiter;
Index: mln/core/concept/doc/neighborhood.hh
--- mln/core/concept/doc/neighborhood.hh (revision 1982)
+++ mln/core/concept/doc/neighborhood.hh (working copy)
@@ -42,17 +42,17 @@
template <typename E>
struct Neighborhood : public Object<E>
{
- /*! \brief Point_Iterator type associated to this neighborhood to browse
+ /*! \brief Site_Iterator type associated to this neighborhood to browse
* neighbors.
*/
typedef void niter;
- /*! \brief Point_Iterator type associated to this neighborhood to browse
+ /*! \brief Site_Iterator type associated to this neighborhood to browse
* neighbors in a forward way.
*/
typedef void fwd_niter;
- /*! \brief Point_Iterator type associated to this neighborhood to browse
+ /*! \brief Site_Iterator type associated to this neighborhood to browse
* neighbors in a backward way.
*/
typedef void bkd_niter;
Index: mln/core/concept/doc/site_set.hh
--- mln/core/concept/doc/site_set.hh (revision 1981)
+++ mln/core/concept/doc/site_set.hh (working copy)
@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file mln/core/concept/doc/point_set.hh
+/*! \file mln/core/concept/doc/site_set.hh
* \brief This file documents the concept of mln::Site_Set.
*/
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 1982)
+++ mln/core/concept/image.hh (working copy)
@@ -32,7 +32,7 @@
* \brief Definition of the concept of mln::Image.
*/
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/mesh.hh>
# include <mln/core/trait/all.hh> // FIXME: Move out of core!
Index: mln/core/concept/site_set.hh
--- mln/core/concept/site_set.hh (revision 1981)
+++ mln/core/concept/site_set.hh (working copy)
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_CONCEPT_POINT_SET_HH
-# define MLN_CORE_CONCEPT_POINT_SET_HH
+#ifndef MLN_CORE_CONCEPT_SITE_SET_HH
+# define MLN_CORE_CONCEPT_SITE_SET_HH
-/*! \file mln/core/concept/point_set.hh
+/*! \file mln/core/concept/site_set.hh
*
* \brief Definition of the concept of mln::Site_Set.
*
@@ -36,7 +36,7 @@
*/
# include <mln/core/concept/point_site.hh>
-# include <mln/core/concept/point_iterator.hh>
+# include <mln/core/concept/site_iterator.hh>
# include <mln/trait/site_sets.hh>
# include <mln/metal/not_equal.hh>
# include <mln/metal/is_a.hh>
@@ -238,4 +238,4 @@
# include <mln/core/ops.hh>
-#endif // ! MLN_CORE_CONCEPT_POINT_SET_HH
+#endif // ! MLN_CORE_CONCEPT_SITE_SET_HH
Index: mln/core/p_runs.hh
--- mln/core/p_runs.hh (revision 1982)
+++ mln/core/p_runs.hh (working copy)
@@ -34,8 +34,8 @@
* (for internal use only).
*/
-# include <mln/core/internal/point_set_base.hh>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_set_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/runs_psite.hh>
# include <mln/core/p_run.hh>
# include <mln/accu/bbox.hh>
@@ -256,7 +256,7 @@
* Parameter \c E is the exact type of the iterator
*/
template <typename P, typename E>
- class p_runs_piter_ : public internal::point_iterator_base_< runs_psite<P>, E >
+ class p_runs_piter_ : public internal::site_iterator_base_< runs_psite<P>, E >
{
public:
Index: mln/test/predicate.hh
--- mln/test/predicate.hh (revision 1982)
+++ mln/test/predicate.hh (working copy)
@@ -35,7 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
namespace mln
Index: mln/convert/to_image.hh
--- mln/convert/to_image.hh (revision 1982)
+++ mln/convert/to_image.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/image2d.hh>
# include <mln/core/image3d.hh>
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/window.hh>
# include <mln/core/concept/weighted_window.hh>
# include <mln/core/concept/neighborhood.hh>
Index: mln/geom/pmin_pmax.hh
--- mln/geom/pmin_pmax.hh (revision 1982)
+++ mln/geom/pmin_pmax.hh (working copy)
@@ -36,7 +36,7 @@
# include <utility>
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/box.hh>
@@ -65,14 +65,14 @@
/// iterator \p p.
template <typename I>
std::pair<mln_point(I), mln_point(I)>
- pmin_pmax(const Point_Iterator<I>& p);
+ pmin_pmax(const Site_Iterator<I>& p);
/// Compute the minimum and maximum points, \p pmin and \p max,
/// when browsing with iterator \p p.
template <typename I>
void
- pmin_pmax(const Point_Iterator<I>& p, mln_point(I)& pmin, mln_point(I)& pmax);
+ pmin_pmax(const Site_Iterator<I>& p, mln_point(I)& pmin, mln_point(I)& pmax);
@@ -84,7 +84,7 @@
template <typename I>
inline
void
- pmin_pmax(const Point_Iterator<I>& p_, mln_point(I)& pmin, mln_point(I)& pmax)
+ pmin_pmax(const Site_Iterator<I>& p_, mln_point(I)& pmin, mln_point(I)& pmax)
{
I p = exact(p_); // a copy of p_
@@ -106,7 +106,7 @@
template <typename I>
inline
std::pair<mln_point(I), mln_point(I)>
- pmin_pmax(const Point_Iterator<I>& p)
+ pmin_pmax(const Site_Iterator<I>& p)
{
typedef mln_point(I) P;
std::pair<P, P> tmp;
Index: mln/geom/bbox.hh
--- mln/geom/bbox.hh (revision 1982)
+++ mln/geom/bbox.hh (working copy)
@@ -35,7 +35,7 @@
*/
# include <mln/core/concept/image.hh>
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/box.hh>
# include <mln/core/concept/window.hh>
# include <mln/core/concept/weighted_window.hh>
Index: mln/set/is_subset_of.hh
--- mln/set/is_subset_of.hh (revision 1982)
+++ mln/set/is_subset_of.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Routine to test if a set is a subset of another.
*/
-# include <mln/core/concept/point_set.hh>
+# include <mln/core/concept/site_set.hh>
namespace mln
{
Index: mln/win/cube3d.hh
--- mln/win/cube3d.hh (revision 1982)
+++ mln/win/cube3d.hh (working copy)
@@ -73,12 +73,12 @@
/// Dpoint associated type.
typedef dpoint3d dpoint;
- /*! \brief Point_Iterator type to browse a cube such as: "for each row
+ /*! \brief Site_Iterator type to browse a cube such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint3d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a cube such as: "for each row
+ /*! \brief Site_Iterator type to browse a cube such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
Index: mln/win/line.hh
--- mln/win/line.hh (revision 1982)
+++ mln/win/line.hh (working copy)
@@ -66,10 +66,10 @@
/// Dpoint associated type.
typedef dpoint_<M, int> dpoint;
- /// Point_Iterator type to browse a line forward
+ /// Site_Iterator type to browse a line forward
typedef dpoints_fwd_piter<dpoint> fwd_qiter;
- /// Point_Iterator type to browse a line backward
+ /// Site_Iterator type to browse a line backward
typedef dpoints_bkd_piter<dpoint> bkd_qiter;
/// Same as fwd_qiter
Index: mln/win/rectangle2d.hh
--- mln/win/rectangle2d.hh (revision 1982)
+++ mln/win/rectangle2d.hh (working copy)
@@ -68,12 +68,12 @@
/// Dpoint associated type.
typedef dpoint2d dpoint;
- /*! \brief Point_Iterator type to browse a rectangle such as: "for each row
+ /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a rectangle such as: "for each row
+ /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
Index: mln/win/diag2d.hh
--- mln/win/diag2d.hh (revision 1982)
+++ mln/win/diag2d.hh (working copy)
@@ -67,12 +67,12 @@
/// Dpoint associated type.
typedef dpoint2d dpoint;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
Index: mln/win/backdiag2d.hh
--- mln/win/backdiag2d.hh (revision 1982)
+++ mln/win/backdiag2d.hh (working copy)
@@ -67,12 +67,12 @@
/// Dpoint associated type.
typedef dpoint2d dpoint;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
Index: mln/win/cuboid3d.hh
--- mln/win/cuboid3d.hh (revision 1982)
+++ mln/win/cuboid3d.hh (working copy)
@@ -86,12 +86,12 @@
/// Dpoint associated type.
typedef dpoint3d dpoint;
- /// \brief Point_Iterator type to browse a cuboid such as: "for
+ /// \brief Site_Iterator type to browse a cuboid such as: "for
/// each slice (increasing), for each row (increasing), for each
/// column (increasing)."
typedef dpoints_fwd_piter<dpoint3d> fwd_qiter;
- /// \brief Point_Iterator type to browse a cuboid such as: "for
+ /// \brief Site_Iterator type to browse a cuboid such as: "for
/// each slice (decreasing), for each row (decreasing), for each
/// column (decreasing)."
typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
Index: mln/win/octagon2d.hh
--- mln/win/octagon2d.hh (revision 1982)
+++ mln/win/octagon2d.hh (working copy)
@@ -71,12 +71,12 @@
/// Dpoint associated type.
typedef dpoint2d dpoint;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
Index: mln/win/disk2d.hh
--- mln/win/disk2d.hh (revision 1982)
+++ mln/win/disk2d.hh (working copy)
@@ -59,12 +59,12 @@
/// Dpoint associated type.
typedef dpoint2d dpoint;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (increasing), for each column (increasing)."
*/
typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
- /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ /*! \brief Site_Iterator type to browse a hline such as: "for each row
* (decreasing), for each column (decreasing)."
*/
typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
Index: mln/util/lazy_set.hh
--- mln/util/lazy_set.hh (revision 1982)
+++ mln/util/lazy_set.hh (working copy)
@@ -357,7 +357,7 @@
needs_update_ = false;
}
- // FIXME : ambiguous with point_set operator <<
+ // FIXME : ambiguous with site_set operator <<
// template <typename E>
// std::ostream& operator<<(std::ostream& ostr,
// const lazy_set_<E>& s)
Index: sandbox/duhamel/mesh_p.hh
--- sandbox/duhamel/mesh_p.hh (revision 1982)
+++ sandbox/duhamel/mesh_p.hh (working copy)
@@ -3,7 +3,7 @@
# include <mln/core/concept/point.hh>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/accu/bbox.hh>
# include <mln/util/graph.hh>
# include "mesh_psite.hh"
@@ -22,10 +22,10 @@
/// Point_Site associated type.
typedef mesh_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef mesh_p_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef mesh_p_piter_<P> bkd_piter;
std::size_t npoints() const;
@@ -43,10 +43,10 @@
template<typename P>
- class mesh_p_piter_ : public internal::point_iterator_base_< P, mesh_p_piter_<P> >
+ class mesh_p_piter_ : public internal::site_iterator_base_< P, mesh_p_piter_<P> >
{
typedef mesh_p_piter_<P> self_;
- typedef internal::point_iterator_base_< P, self_ > super_;
+ typedef internal::site_iterator_base_< P, self_ > super_;
public:
Index: sandbox/duhamel/queue_p_fast.hh
--- sandbox/duhamel/queue_p_fast.hh (revision 1982)
+++ sandbox/duhamel/queue_p_fast.hh (working copy)
@@ -67,10 +67,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef vec_p_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef vec_p_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/duhamel/queue_p_priority.hh
--- sandbox/duhamel/queue_p_priority.hh (revision 1982)
+++ sandbox/duhamel/queue_p_priority.hh (working copy)
@@ -68,10 +68,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef vec_p_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef vec_p_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_priority_queue_fast.hh
--- sandbox/pellegrin/set/core/p_priority_queue_fast.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_priority_queue_fast.hh (working copy)
@@ -82,10 +82,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_bgraph.hh
--- sandbox/pellegrin/set/core/p_bgraph.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_bgraph.hh (working copy)
@@ -70,10 +70,10 @@
/// Point_Site associated type.
typedef bgraph_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_bgraph_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_bgraph_piter_<P> bkd_piter;
/// Graph vertex/edge identifier
Index: sandbox/pellegrin/set/core/p_run.hh
--- sandbox/pellegrin/set/core/p_run.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_run.hh (working copy)
@@ -71,10 +71,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_run_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_run_bkd_piter_<P> bkd_piter;
/// Constructor without argument.
Index: sandbox/pellegrin/set/core/p_line_graph.hh
--- sandbox/pellegrin/set/core/p_line_graph.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_line_graph.hh (working copy)
@@ -86,10 +86,10 @@
/// Point associated type.
typedef point_pair<P> point;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_line_graph_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_line_graph_piter_<P> bkd_piter;
/// Return The number of points (i.e., nodes) in the graph.
Index: sandbox/pellegrin/set/core/pset_if.hh
--- sandbox/pellegrin/set/core/pset_if.hh (revision 1982)
+++ sandbox/pellegrin/set/core/pset_if.hh (working copy)
@@ -84,10 +84,10 @@
typedef mln_psite(super_) psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef pset_if_fwd_piter_<S,F> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef mln::internal::fixme bkd_piter;
Index: sandbox/pellegrin/set/core/concept/point_set.hh
--- sandbox/pellegrin/set/core/concept/point_set.hh (revision 1982)
+++ sandbox/pellegrin/set/core/concept/point_set.hh (working copy)
@@ -37,7 +37,7 @@
*/
# include <mln/core/concept/point_site.hh>
-# include <mln/core/concept/point_iterator.hh>
+# include <mln/core/concept/site_iterator.hh>
# include <trait/point_set.hh>
Index: sandbox/pellegrin/set/core/p_array.hh
--- sandbox/pellegrin/set/core/p_array.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_array.hh (working copy)
@@ -74,10 +74,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_queue.hh
--- sandbox/pellegrin/set/core/p_queue.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_queue.hh (working copy)
@@ -80,10 +80,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_priority_queue.hh
--- sandbox/pellegrin/set/core/p_priority_queue.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_priority_queue.hh (working copy)
@@ -82,10 +82,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_runs.hh
--- sandbox/pellegrin/set/core/p_runs.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_runs.hh (working copy)
@@ -37,7 +37,7 @@
# include <utility>
# include <mln/core/internal/point_set_base.hh>
-# include <mln/core/internal/point_iterator_base.hh>
+# include <mln/core/internal/site_iterator_base.hh>
# include <mln/core/runs_psite.hh>
# include <mln/core/p_run.hh>
# include <mln/accu/bbox.hh>
@@ -269,7 +269,7 @@
* Parameter \c E is the exact type of the iterator
*/
template <typename P, typename E>
- class p_runs_piter_ : public internal::point_iterator_base_< runs_psite<P>, E >
+ class p_runs_piter_ : public internal::site_iterator_base_< runs_psite<P>, E >
{
public:
Index: sandbox/pellegrin/set/core/p_set.hh
--- sandbox/pellegrin/set/core/p_set.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_set.hh (working copy)
@@ -73,10 +73,10 @@
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh
--- sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (working copy)
@@ -82,10 +82,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/line2d.hh
--- sandbox/pellegrin/set/core/line2d.hh (revision 1982)
+++ sandbox/pellegrin/set/core/line2d.hh (working copy)
@@ -66,10 +66,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<point2d> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<point2d> bkd_piter;
Index: sandbox/pellegrin/set/core/internal/multi_set.hh
--- sandbox/pellegrin/set/core/internal/multi_set.hh (revision 1982)
+++ sandbox/pellegrin/set/core/internal/multi_set.hh (working copy)
@@ -55,9 +55,9 @@
typedef internal::set_of_<P> super_;
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef multi_set_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef multi_set_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/internal/uni_set.hh
--- sandbox/pellegrin/set/core/internal/uni_set.hh (revision 1982)
+++ sandbox/pellegrin/set/core/internal/uni_set.hh (working copy)
@@ -55,9 +55,9 @@
typedef internal::set_of_<P> super_;
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef uni_set_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef uni_set_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/pellegrin/set/core/p_graph.hh
--- sandbox/pellegrin/set/core/p_graph.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_graph.hh (working copy)
@@ -71,10 +71,10 @@
/// Point_Site associated type.
typedef graph_psite<P> psite;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_graph_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_graph_piter_<P> bkd_piter;
/// Return The number of points (i.e., nodes) in the graph.
Index: sandbox/pellegrin/set/core/p_queue_fast.hh
--- sandbox/pellegrin/set/core/p_queue_fast.hh (revision 1982)
+++ sandbox/pellegrin/set/core/p_queue_fast.hh (working copy)
@@ -79,10 +79,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
Index: sandbox/nivault/dyn_line.hh
--- sandbox/nivault/dyn_line.hh (revision 1982)
+++ sandbox/nivault/dyn_line.hh (working copy)
@@ -55,10 +55,10 @@
/// Dpoint associated type.
typedef dpoint_<M, int> dpoint;
- /// Point_Iterator type to browse a dyn_line forward
+ /// Site_Iterator type to browse a dyn_line forward
typedef dpoints_fwd_piter<dpoint> fwd_qiter;
- /// Point_Iterator type to browse a dyn_line backward
+ /// Site_Iterator type to browse a dyn_line backward
typedef dpoints_bkd_piter<dpoint> bkd_qiter;
/// Same as fwd_qiter
Index: sandbox/garrigues/fllt/types.hh
--- sandbox/garrigues/fllt/types.hh (revision 1982)
+++ sandbox/garrigues/fllt/types.hh (working copy)
@@ -68,10 +68,10 @@
{
public:
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef mln_fwd_piter_(box2d) fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef mln_bkd_piter_(box2d) bkd_piter;
/// Constructor.
1
0
1983: Add some comments on mln::canvas::morpho::algebraic_union_find<F>.
by Roland Levillain 30 May '08
by Roland Levillain 30 May '08
30 May '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add some comments on mln::canvas::morpho::algebraic_union_find<F>.
* mln/canvas/morpho/algebraic_union_find.hh
(mln::canvas::morpho::algebraic_union_find<F>::make_set)
(mln::canvas::morpho::algebraic_union_find<F>::do_union): Add
FIXMEs on the non genericity of this canvas w.r.t. the type of the
attribute.
algebraic_union_find.hh | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
Index: mln/canvas/morpho/algebraic_union_find.hh
--- mln/canvas/morpho/algebraic_union_find.hh (revision 1982)
+++ mln/canvas/morpho/algebraic_union_find.hh (working copy)
@@ -120,6 +120,28 @@
void make_set(const psite& p)
{
parent(p) = p;
+ /* FIXME: What if the value_type of DATA (i.e., A) were not
+ based on a accu::count_<mln::pix>? Currently, nothing
+ enforces this, but the code below expects this line to be
+ valid:
+
+ data(p).take_as_init(make::pix(f.input, p))
+
+ which probably restricts the kind of input images.
+
+ If we want to be more generic, the initialization should
+ read something like:
+
+ init_data(p);
+
+ i.e., the functor for the initialization of data should
+ be passed as an argument to the canvas' ctor.
+
+ Of course, we might want to restrict attributes to the
+ accumulator accu::count_<mln::pix> (which is perfectly
+ acceptable), but then this class should statically check
+ the conformance of the template parameter A to this
+ constraint. */
data(p).take_as_init(make::pix(f.input, p)); // FIXME: algebraic so p!
}
@@ -149,6 +171,18 @@
{
if (equiv(r, p))
{
+ /* FIXME: Same remark as above concerning the
+ initialization of data(p); instead of
+
+ data(p).take(data(r));
+
+ we should (or could) have
+
+ unite_data(p, r);
+
+ so as to keep the generic aspect of this canvas
+ (as long as the set of acceptable types for the
+ template parameter A is not bound). */
data(p).take(data(r));
parent(r) = p;
}
1
0
30 May '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Those files were in my working copy for ages... I'll try to finish the
conversion from Olena proto-1.0 to Milena someday.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add some morphological routines to Roland's sandbox.
* levillain/morpho/: New directory.
* levillain/morpho/lower_completion.hh,
* levillain/morpho/shortest_path_watershed.hh:
New (imported from Olena proto-1.0).
lower_completion.hh | 29 +++++++++++------
shortest_path_watershed.hh | 76 +++++++++++++++++----------------------------
2 files changed, 49 insertions(+), 56 deletions(-)
Index: levillain/morpho/lower_completion.hh
--- levillain/morpho/lower_completion.hh (revision 0)
+++ levillain/morpho/lower_completion.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 EPITA Research and Development Laboratory
+// Copyright (C) 2005, 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,15 +25,26 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLENA_MORPHO_LOWER_COMPLETION_HH
-# define OLENA_MORPHO_LOWER_COMPLETION_HH
+#ifndef MLN_MORPHO_LOWER_COMPLETION_HH
+# define MLN_MORPHO_LOWER_COMPLETION_HH
+
+/* FIXME: This file comes from Olena proto-1.0, and needs some
+ adjustments.
+
+ Translate it into the Milena dialect, e.g.,
+ - replace `oln_' and `oln::' by `mln_' and `mln::';
+ - replace `internal::' by `impl::';
+ - adjust the names of interfaces and types;
+ - adjust other names;
+ - adjust calling conventions;
+ - adjust contracts (static/dynamic pre-/postconditions, etc.);
+ - etc. */
# include <queue>
-# include <oln/basics.hh>
-# include <oln/level/fill.hh>
+# include <mln/level/fill.hh>
-namespace oln {
+namespace mln {
namespace morpho {
@@ -133,8 +144,8 @@
return output;
}
- } // end of namespace oln::morpho
+ } // end of namespace mln::morpho
-} // end of namespace oln
+} // end of namespace mln
-#endif // ! OLENA_MORPHO_LOWER_COMPLETION_HH
+#endif // ! MLN_MORPHO_LOWER_COMPLETION_HH
Index: levillain/morpho/shortest_path_watershed.hh
--- levillain/morpho/shortest_path_watershed.hh (revision 0)
+++ levillain/morpho/shortest_path_watershed.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 EPITA Research and Development Laboratory
+// Copyright (C) 2005, 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,52 +25,34 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLENA_MORPHO_SHORTEST_PATH_WATERSHED_HH
-# define OLENA_MORPHO_SHORTEST_PATH_WATERSHED_HH
+#ifndef MLN_MORPHO_SHORTEST_PATH_WATERSHED_HH
+# define MLN_MORPHO_SHORTEST_PATH_WATERSHED_HH
+
+/* FIXME: This file comes from Olena proto-1.0, and needs some
+ adjustments.
+
+ Translate it into the Milena dialect, e.g.,
+ - replace `oln_' and `oln::' by `mln_' and `mln::';
+ - replace `internal::' by `impl::';
+ - adjust the names of interfaces and types;
+ - adjust other names;
+ - adjust calling conventions;
+ - adjust contracts (static/dynamic pre-/postconditions, etc.);
+ - etc. */
# include <queue>
-# include "oln/level/fill.hh"
-# include "oln/level/extrema_components.hh"
-# include "oln/morpho/lower_completion.hh"
+# include <mln/level/fill.hh>
+# include <mln/level/extrema_components.hh>
+# include <mln/morpho/lower_completion.hh>
+# include <mln/trait/value_.hh>
-namespace oln {
+namespace mln {
namespace morpho {
namespace internal {
- /// Functor used in ordered queues of points.
- template <typename I>
- class greater_point_type
- {
- public:
- typedef oln_type_of(I, point) point_type;
-
- greater_point_type(const abstract::image<I>& im) :
- im_ (im)
- {
- }
-
- /// Is \a x greater than \a y?
- bool operator()(const point_type& x, const point_type& y)
- {
- return im_[x] > im_[y];
- }
-
- private:
- const abstract::image<I>& im_;
- };
-
- /// Facade to build a oln::level::greater_point_type.
- template <typename I>
- greater_point_type<I>
- greater_point(const abstract::image<I>& im)
- {
- return greater_point_type<I>(im);
- }
-
-
// FIXME: To be rewritten. Moreover, the distance d(p, q) is not
// taken into account in this version of cost (but it should not
// bother us as long as we are using first-order neighborhoods).
@@ -107,16 +89,16 @@
typename ch_value_type<I, DestValue>::ret
shortest_path_watershed_(const abstract::image_with_nbh<I>& input)
{
- mlc_is_a(I, abstract::scalar_valued_image)::ensure();
+ // FIXME: Ensure the input image has scalar values.
- const DestValue wshed = ntg_min_val(DestValue);
+ const DestValue wshed = min_val(DestValue);
// We keep a track of already processed points.
typename ch_value_type<I, bool>::ret processed (input.size(),
input.nbh_get());
level::fill (processed, false);
- // Initialise output with the minima components.
+ // Initialize output with the minima components.
typename ch_value_type<I, DestValue>::ret output =
level::minima_components<DestValue>(input);
@@ -139,9 +121,9 @@
typedef
std::priority_queue<point_type,
std::vector<point_type>,
- internal::greater_point_type<dist_type> >
+ util::greater_point<dist_type> >
ordered_queue_type;
- ordered_queue_type q(internal::greater_point(dist));
+ ordered_queue_type q(util::make_greater_point(dist));
// Fill the ordered queue with the points of the border of the
// minima of the (lower complete) input.
for_all_p (p)
@@ -197,7 +179,7 @@
return output;
}
- } // End of namespace oln::morpho::internal.
+ } // End of namespace mln::morpho::internal.
/*! Watershed transform w.r.t. topographical distance based on
@@ -231,8 +213,8 @@
return internal::shortest_path_watershed_<DestValue>(input);
}
- } // end of namespace oln::morpho
+ } // end of namespace mln::morpho
-} // end of namespace oln
+} // end of namespace mln
-#endif // ! OLENA_MORPHO_SHORTEST_PATH_WATERSHED_HH
+#endif // ! MLN_MORPHO_SHORTEST_PATH_WATERSHED_HH
1
0
30 May '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add a tutorial example of use of p_array.
* tests/core/p_array.cc: Clean up (no more stdout).
* doc/tutorial/examples: New directory.
* doc/tutorial/examples/p_array.cc: New.
* mln/core/internal/image_base.hh (mesh, bbox): Remove.
(point, npoints): Rename as...
(site, nsites): ...these.
* mln/core/concept/image.hh: Likewise.
* mln/core/p_array_piter.hh (index): New method.
(index_of_in): New overload.
* mln/core/concept/proxy.hh
(get_adr): Make it work when no match is found.
(operator Subject): Change into a more reliable version.
* mln/core/p_array.hh (index_of_in): New procedures.
(insert, change): New methods.
(print): Remove.
* mln/core/image2d.hh (bbox): New.
(npoints): Rename as...
(nsites): ...this.
doc/tutorial/examples/p_array.cc | 68 +++++++++++++++++++++++++++++++++++++++
mln/core/concept/image.hh | 8 ----
mln/core/concept/proxy.hh | 17 ++++++---
mln/core/image2d.hh | 14 +++++++-
mln/core/internal/image_base.hh | 33 +++++-------------
mln/core/p_array.hh | 55 +++++++++++++++++++++++++------
mln/core/p_array_piter.hh | 19 ++++++++++
tests/core/p_array.cc | 36 +++++---------------
8 files changed, 177 insertions(+), 73 deletions(-)
Index: tests/core/p_array.cc
--- tests/core/p_array.cc (revision 1980)
+++ tests/core/p_array.cc (working copy)
@@ -30,44 +30,26 @@
* \brief Tests on mln::p_array.
*/
-#include <iterator>
-
#include <mln/core/point2d.hh>
#include <mln/core/p_array.hh>
-
int main()
{
using namespace mln;
typedef p_array<point2d> Arr;
- Arr pa;
- pa
- .append(make::point2d(6, 9))
- .append(make::point2d(4, 2))
- .append(make::point2d(4, 2))
- .append(make::point2d(5, 1));
- mln_assertion(pa.nsites() == 4);
-
- mlc_equal( mln_psite_(Arr)::site, point2d )::check();
-
- mln_psite_(Arr) p(pa, 0);
- std::cout << p.to_site() << ' '
- << p.row() << ' '
- << point2d(p) << ' '
- << std::endl;
+ point2d x(5, 1);
+ Arr arr;
+ arr.append(x).append(x);
+ mln_assertion(arr.nsites() == 2);
- std::copy(pa.vect().begin(), pa.vect().end(),
- std::ostream_iterator<point2d>(std::cout, " "));
- std::cout << std::endl;
+ mlc_equal( mln_psite_(Arr)::site, point2d )::check();
- {
- mln_piter_(Arr) p(pa);
- for_all(p)
- std::cout << p << ' ';
- std::cout << std::endl;
- }
+ mln_psite_(Arr) p(arr, 0);
+ mln_assertion(p.to_site() == x);
+ mln_assertion(p.row() == 5);
+ mln_assertion(point2d(p) == x);
}
Index: doc/tutorial/examples/p_array.cc
--- doc/tutorial/examples/p_array.cc (revision 0)
+++ doc/tutorial/examples/p_array.cc (revision 0)
@@ -0,0 +1,68 @@
+# include <mln/core/image2d.hh>
+# include <mln/core/p_array.hh>
+# include <mln/debug/println.hh>
+# include <mln/level/fill.hh>
+# include <mln/value/int_u8.hh>
+
+
+template <typename A>
+void picture(const A& arr)
+{
+ using namespace mln;
+
+ image2d<char> ima(5, 5);
+ level::fill(ima, '-');
+
+ unsigned i = 0;
+ mln_piter(A) p(arr);
+ for_all(p)
+ ima(p) = '0' + i++;
+
+ debug::println(ima);
+}
+
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef p_array<point2d> Arr1;
+ Arr1 arr1;
+
+ image2d<value::int_u8> ima(5, 5);
+
+ {
+ point2d p(1,1);
+ dpoint2d dp[] = { right, right, down, down, left, left, up };
+ arr1.append(p);
+ for (unsigned i = 0; i < 7; ++i)
+ p += dp[i], arr1.append(p);
+
+ std::cout << "arr1 = " << arr1 << std::endl;
+ picture(arr1);
+ }
+
+ {
+ typedef p_array< mln_psite_(Arr1) > Arr2;
+ Arr2 arr2;
+
+ mln_piter_(Arr1) p(arr1);
+ for_all(p)
+ if (p.row() % 2 && p.col() % 2)
+ arr2.append(p);
+
+ std::cout << "arr2 = " << arr2 << std::endl;
+ picture(arr2);
+
+ {
+ mln_piter_(Arr2) p(arr2);
+ for_all(p)
+ std::cout << "point " << p << ": #"
+ << index_of_in(p, arr2) << " in arr2, #"
+ << index_of_in(p, arr1) << " in arr1" << std::endl;
+ }
+
+ }
+
+}
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 1980)
+++ mln/core/internal/image_base.hh (working copy)
@@ -100,27 +100,23 @@
/// Site_Set associated type.
typedef S pset;
-
- /// Mesh associated type.
- typedef mln_mesh(S) mesh;
-
/// Point_Site associated type.
typedef mln_psite(S) psite;
/// Point associated type.
- typedef mln_point(S) point;
+ typedef mln_site(S) site;
/// Dpoint associated type.
- typedef mln_dpoint(point) dpoint;
+ typedef mln_dpoint(site) dpoint;
/// Coordinate associated type.
- typedef mln_coord(point) coord;
+ typedef mln_coord(site) coord;
- /// Forward Point_Iterator associated type.
+ /// Forward Site_Iterator associated type.
typedef mln_fwd_piter(S) fwd_piter;
- /// Backward Point_Iterator associated type.
+ /// Backward Site_Iterator associated type.
typedef mln_bkd_piter(S) bkd_piter;
@@ -131,10 +127,10 @@
bool owns_(const psite& p) const;
/// Give a bounding box of the image domain.
- const box_<point>& bbox() const;
+ const box_<site>& bbox() const;
- /// Give the number of points of the image domain.
- std::size_t npoints() const;
+ /// Give the number of sites of the image domain.
+ std::size_t nsites() const;
/// Test if this image has been initialized; default impl.
bool has_data() const;
@@ -221,20 +217,11 @@
template <typename S, typename E>
inline
- const box_<mln_point(S)>&
- image_base_<S,E>::bbox() const
- {
- mln_precondition(exact(this)->has_data());
- return exact(this)->domain().bbox();
- }
-
- template <typename S, typename E>
- inline
std::size_t
- image_base_<S,E>::npoints() const
+ image_base_<S,E>::nsites() const
{
mln_precondition(exact(this)->has_data());
- return exact(this)->domain().npoints();
+ return exact(this)->domain().nsites();
}
template <typename S, typename E>
Index: mln/core/p_array_piter.hh
--- mln/core/p_array_piter.hh (revision 1980)
+++ mln/core/p_array_piter.hh (working copy)
@@ -75,15 +75,25 @@
const p_array_psite<P>& unproxy() const;
// As a Site_Proxy:
+
typedef typename super::site site;
const site& to_site() const;
+ /// Return the current index.
+ int index() const;
+
protected:
p_array_psite<P> p_;
};
+ template <typename P, typename A>
+ int index_of_in(const p_array_fwd_piter_<P>& p, const A& arr)
+ {
+ return index_of_in(p.unproxy(), arr);
+ }
+
// /// \brief Backward iterator on points of a p_array<P>.
// template <typename P>
@@ -222,6 +232,15 @@
return p_.to_site();
}
+ template <typename P>
+ inline
+ int
+ p_array_fwd_piter_<P>::index() const
+ {
+ mln_precondition(p_.target() != 0);
+ return p_.index();
+ }
+
/*------------------------.
| p_array_bkd_piter_<P>. |
`------------------------*/
Index: mln/core/concept/proxy.hh
--- mln/core/concept/proxy.hh (revision 1980)
+++ mln/core/concept/proxy.hh (working copy)
@@ -150,12 +150,15 @@
// Case 3: Fail to found!
template <typename T, typename O>
- void get_adr(const T *& ptr, const Object<O>& obj);
+ void get_adr(const T *& ptr, const Object<O>& obj)
+ {
+ ptr = 0;
+ }
template <typename T, typename O>
void get_adr( T *& ptr, Object<O>& obj)
{
- return 0;
+ ptr = 0;
}
@@ -183,9 +186,13 @@
{
operator Subject() const
{
- const Subject* adr;
- get_adr(adr, mln::internal::force_exact<const E>(*this));
- return *adr;
+ return mln::internal::force_exact<const E>(*this).unproxy();
+ // The code above seems more effective than the one below:
+ //
+ // const Subject* adr;
+ // get_adr(adr, mln::internal::force_exact<const E>(*this));
+ // mln_postcondition(adr != 0);
+ // return *adr;
}
};
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 1980)
+++ mln/core/concept/image.hh (working copy)
@@ -106,8 +106,7 @@
typedef bkd_piter;
bool has(const psite& p) const;
- const box_<point>& bbox() const;
- std::size_t npoints() const;
+ std::size_t nsites() const;
bool has_data() const;
*/
@@ -137,14 +136,9 @@
bool (E::*m1)(const psite& p) const = & E::has;
m1 = 0;
- const box_<point>& (E::*m2)() const = & E::bbox;
- m2 = 0;
// to be provided in concrete image classes:
- typedef mln_mesh(E) mesh;
- metal::is_a<mesh, Mesh>::check(); // FIXME: Add other checks.
-
typedef mln_value(E) value;
typedef mln_rvalue(E) rvalue;
typedef mln_lvalue(E) lvalue;
Index: mln/core/p_array.hh
--- mln/core/p_array.hh (revision 1980)
+++ mln/core/p_array.hh (working copy)
@@ -85,8 +85,6 @@
void change_target(const p_array<P>& arr);
- void print() const;
-
private:
const p_array<P>* arr_;
@@ -94,6 +92,11 @@
};
+ template <typename P, typename A>
+ int index_of_in(const P&, const A&);
+
+ template <typename P, typename A>
+ int index_of_in(const p_array_psite<P>& p, const A& arr);
namespace trait
@@ -149,6 +152,9 @@
// FIXME: Add an overload "has(index)".
+ /// Change site \p p into \p new_p.
+ void change(const psite& p, const P& new_p);
+
/// Give the number of sites.
std::size_t nsites() const;
@@ -158,6 +164,9 @@
/// Append an array \p other of points.
p_array<P>& append(const p_array<P>& other);
+ /// Insert a point \p p (equivalent as 'append').
+ void insert(const P& p);
+
/// Clear this set.
void clear();
@@ -235,6 +244,14 @@
template <typename P>
inline
+ void
+ p_array<P>::insert(const P& p)
+ {
+ vect_.push_back(p);
+ }
+
+ template <typename P>
+ inline
p_array<P>&
p_array<P>::append(const p_array<P>& other)
{
@@ -277,6 +294,14 @@
return vect_[i];
}
+ template <typename P>
+ inline
+ void
+ p_array<P>::change(const psite& p, const P& new_p)
+ {
+ mln_precondition(has(p));
+ vect_[p.index()] = new_p;
+ }
// p_array_psite<P>
@@ -340,14 +365,6 @@
template <typename P>
inline
- void
- p_array_psite<P>::print() const
- {
- std::cout << i_ << "-th site of " << arr_ << " => site " << to_site() << std::endl;
- }
-
- template <typename P>
- inline
const P&
p_array_psite<P>::unproxy() const
{
@@ -355,6 +372,24 @@
return (*arr_)[i_];
}
+
+ // Procedures
+
+ template <typename P, typename A>
+ int index_of_in(const P&, const A&)
+ {
+ return -1;
+ }
+
+ template <typename P, typename A>
+ int index_of_in(const p_array_psite<P>& p, const A& arr)
+ {
+ if ((void*)(p.target()) == (void*)(&arr))
+ return p.index();
+ else
+ return index_of_in(p.unproxy(), arr);
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/image2d.hh
--- mln/core/image2d.hh (revision 1980)
+++ mln/core/image2d.hh (working copy)
@@ -168,6 +168,9 @@
/// Give the definition domain.
const box2d& domain() const;
+ /// Give the bounding box domain.
+ const box2d& bbox() const;
+
/// Give the border thickness.
unsigned border() const;
@@ -391,6 +394,15 @@
template <typename T>
inline
+ const box2d&
+ image2d<T>::bbox() const
+ {
+ mln_precondition(this->has_data());
+ return this->data_->b_;
+ }
+
+ template <typename T>
+ inline
unsigned
image2d<T>::border() const
{
@@ -404,7 +416,7 @@
image2d<T>::ncells() const
{
mln_precondition(this->has_data());
- return this->data_->vb_.npoints();
+ return this->data_->vb_.nsites();
}
template <typename T>
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Thierry Géraud <thierry.geraud(a)lrde.epita.fr>
Test (sorry).
* milena/sandbox/geraud/toto: New.
0 files changed
Index: milena/sandbox/geraud/toto
2
1
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Géraud <thierry.geraud(a)lrde.epita.fr>
Fix some details in morpho and labeling.
* mln/morpho/erosion.hh
(erosion_on_function_, erosion_on_set_): Change 'has' to 'owns_'.
* mln/morpho/dilation.hh
(dilation_on_function_, dilation_on_set_): Likewise.
* mln/labeling/regional_minima.hh
(regional_minima_functor): Fix initialization of 'attr'; use
the proper command instead of ctor call.
* mln/labeling/regional_maxima.hh: Likewise.
labeling/regional_maxima.hh | 4 ++--
labeling/regional_minima.hh | 4 ++--
morpho/dilation.hh | 4 ++--
morpho/erosion.hh | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
Index: mln/morpho/erosion.hh
--- mln/morpho/erosion.hh (revision 1967)
+++ mln/morpho/erosion.hh (working copy)
@@ -76,7 +76,7 @@
for_all(p)
{
min.init();
- for_all(q) if (input.has(q))
+ for_all(q) if (input.owns_(q))
min.take(input(q));
output(p) = min;
}
@@ -103,7 +103,7 @@
output = clone(input);
for_all(p)
if (input(p))
- for_all(q) if (input.has(q))
+ for_all(q) if (input.owns_(q))
if (! input(q))
{
output(p) = false;
@@ -115,7 +115,7 @@
initialize(output, input);
for_all(p)
{
- for_all(q) if (input.has(q))
+ for_all(q) if (input.owns_(q))
if (! input(q))
break;
// If there was no break (so q is not valid) then
Index: mln/morpho/dilation.hh
--- mln/morpho/dilation.hh (revision 1967)
+++ mln/morpho/dilation.hh (working copy)
@@ -117,7 +117,7 @@
for_all(p)
{
max.init();
- for_all(q) if (input.has(q))
+ for_all(q) if (input.owns_(q))
max.take(input(q));
output(p) = max.to_result();
}
@@ -140,7 +140,7 @@
mln_qiter(W) q(win, p);
for_all(p)
if (!input(p))
- for_all(q) if (input.has(q))
+ for_all(q) if (input.owns_(q))
if (input(q))
{
output(p) = true;
Index: mln/labeling/regional_minima.hh
--- mln/labeling/regional_minima.hh (revision 1967)
+++ mln/labeling/regional_minima.hh (working copy)
@@ -104,9 +104,9 @@
regional_minima_functor(const I_& input, const N_& nbh)
: input(input),
nbh(nbh),
- s(level::sort_psites_increasing(input)),
- attr(input.domain())
+ s(level::sort_psites_increasing(input))
{
+ initialize(attr, input);
}
};
Index: mln/labeling/regional_maxima.hh
--- mln/labeling/regional_maxima.hh (revision 1967)
+++ mln/labeling/regional_maxima.hh (working copy)
@@ -105,9 +105,9 @@
regional_maxima_functor(const I_& input, const N_& nbh)
: input(input),
nbh(nbh),
- s(level::sort_psites_decreasing(input)),
- attr(input.domain())
+ s(level::sort_psites_decreasing(input))
{
+ initialize(attr, input);
}
};
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Sandbox: ICP: Materials for report.
Add/Update scripts:
* jardonnet/test/bench.rb: Minor fix.
* jardonnet/test/test.rb: New: Bench times.
* jardonnet/test/plotscript: Auto Update.
* jardonnet/test/script_latex.plot: Latex output.
* jardonnet/test/Makefile: Add test rule.
Add few images to the test set:
* jardonnet/test/img/c4.pbm,
* jardonnet/test/img/c6.pbm,
* jardonnet/test/img/c7.pbm,
* jardonnet/test/img/c8.pbm,
* jardonnet/test/img/c9.pbm,
* jardonnet/test/img/x3.pbm,
* jardonnet/test/img/x6.pbm,
* jardonnet/test/img/x7.pbm,
* jardonnet/test/img/x8.pbm,
* jardonnet/test/img/x9.pbm: New.
Update test set:
* jardonnet/test/img/01.pbm: Rename as ...
* jardonnet/test/img/c0.pbm ... this.
* jardonnet/test/img/02.pbm: Rename as ...
* jardonnet/test/img/x0.pbm: ... this.
Update code so as to produce report's results.
* jardonnet/test/icp_ref.cc: Modify output image.
* jardonnet/test/icp.cc: Modify output image.
* jardonnet/registration/final_qk.hh: Cleanup.
* jardonnet/registration/interpolation.hh: Update (const).
* jardonnet/registration/tools.hh: Fix buffer.
* jardonnet/registration/cloud.hh: Cleanup.
* jardonnet/registration/icp_ref.hh: Fix.
* jardonnet/registration/icp.hh: Minor Fix, Make use of buffer.
* jardonnet/registration/update_qk.hh: Cleanup code.
* jardonnet/registration/icp_map.hh: Remove.
registration/cloud.hh | 23 ++++++++++++++++++
registration/final_qk.hh | 2 +
registration/icp.hh | 47
+++++++++++++-------------------------
registration/icp_ref.hh | 50
+++++++++--------------------------------
registration/interpolation.hh | 2 -
registration/tools.hh | 8 ++++--
registration/update_qk.hh | 9 +++----
test/Makefile | 16 +++++++++----
test/bench.rb | 2 -
test/icp.cc | 26 ++++++++++-----------
test/icp_ref.cc | 23 +++++++++---------
test/plotscript | 3 --
test/script_latex.plot | 8 ++++++
test/test.rb | 51
++++++++++++++++++++++++++++++++++++++++++
14 files changed, 157 insertions(+), 113 deletions(-)
Index: jardonnet/test/bench.rb
--- jardonnet/test/bench.rb (revision 1978)
+++ jardonnet/test/bench.rb (working copy)
@@ -8,7 +8,7 @@
for e in 1..10 do
t1 = Time.new
- system("./icp 01.pbm 02.pbm #{q} #{e}")
+ system("./icp img/01.pbm img/02.pbm #{q} #{e}")
t2 = Time.new
print "#{q} #{e} #{t2-t1}\n"
Index: jardonnet/test/test.rb
--- jardonnet/test/test.rb (revision 0)
+++ jardonnet/test/test.rb (revision 0)
@@ -0,0 +1,51 @@
+#!/usr/bin/ruby
+
+print "# icp_ref \t icp\n"
+print "-------------------------\n"
+
+q = 1
+e = 1
+
+for i in 0..9 do
+
+ # icp_ref
+
+ t1 = Time.new
+ system("./icp_ref img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ t2 = Time.new
+ t = t2 - t1
+
+ ta1 = Time.new
+ system("./icp_ref img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ ta2 = Time.new
+ ta = ta2 - ta1
+
+ tb1 = Time.new
+ system("./icp_ref img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ tb2 = Time.new
+ tb = tb2 - tb1
+
+ # icp
+
+ tt1 = Time.new
+ system("./icp img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ tt2 = Time.new
+ tt = tt2 - tt1
+
+ tta1 = Time.new
+ system("./icp img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ tta2 = Time.new
+ tta = tta2 - tta1
+
+ ttb1 = Time.new
+ system("./icp img/c#{i}.pbm img/x#{i}.pbm #{q} #{e}")
+ ttb2 = Time.new
+ ttb = ttb2 - ttb1
+
+ # mean
+
+ meant = (t + ta + tb) / 3
+ meantt = (tt + tta + ttb) /3
+
+ print "#{i} #{t} \t #{tt}\n"
+end
Index: jardonnet/test/icp_ref.cc
--- jardonnet/test/icp_ref.cc (revision 1978)
+++ jardonnet/test/icp_ref.cc (working copy)
@@ -25,6 +25,7 @@
float q = std::atof(argv[3]);
int e = std::atoi(argv[4]);
+
if (q < 1 or e < 1)
usage(argv);
@@ -46,39 +47,37 @@
p_array<mln_point_(I3d)> c = convert::to_p_array(cloud);
p_array<mln_point_(I3d)> x = convert::to_p_array(surface);
+ //working box
+ const box_<mln_point_(I3d)> working_box =
enlarge(bigger(c.bbox(),x.bbox()),100);
+
// FIXME : TODO : map : vec<3,float> -> point
+ closest_point<mln_point_(I3d)> map(x, working_box);
quat7<3> qk = registration::icp(c, map, q, e, x);
#ifndef NDEBUG
- std::cout << "closest_point(Ck[i]) = " << fun.i << std::endl;
+ std::cout << "closest_point(Ck[i]) = " << map.i << std::endl;
std::cout << "Pts processed = " << registration::pts <<
std::endl;
#endif
qk.apply_on(c, c, c.npoints());
- //init output image
- //FIXME: Should be like
- //mln_concrete(I) output(res.bbox()) = convert::to_image<I>(res) ?
-
- const box_<point2d> box2d(400,700);
- image2d<value::rgb8> output(box2d, 1);
+ image2d<value::rgb8> output(convert::to_box2d(working_box), 1);
//to 2d : projection (FIXME:if 3d)
for (size_t i = 0; i < c.npoints(); i++)
{
- //Ck points
point2d p(c[i][0], c[i][1]);
if (output.has(p))
output(p) = literal::white;
- //Xk points
}
+ //ref image
for (size_t i = 0; i < x.npoints(); i++)
{
- point2d x(map(c[i])[0], map(c[i])[1]);
- if (output.has(x))
- output(x) = literal::green;
+ point2d px(x[i][0], x[i][1]);
+ if (output.has(px))
+ output(px) = literal::green;
}
io::ppm::save(output, "registred.ppm");
Index: jardonnet/test/icp.cc
--- jardonnet/test/icp.cc (revision 1978)
+++ jardonnet/test/icp.cc (working copy)
@@ -64,7 +64,8 @@
qk.apply_on(c, c, c.npoints());
//init output image
- image2d<value::rgb8> output(convert::to_box2d(working_box), 1);
+ image2d<value::rgb8> output(convert::to_box2d(working_box), 0);
+ level::fill(output, literal::white);
float stddev, mean;
registration::mean_stddev(c, map, mean, stddev);
@@ -79,10 +80,18 @@
length[i] = norm::l2(algebra::vec<3,int> (c[i] - map(c[i])));
// final transform
- quat7<3> fqk = registration::final_qk(c, map, 2 * stddev);
- std::cout << fqk << std::endl;
+ quat7<3> fqk = registration::final_qk2(c, map, 2*stddev);
fqk.apply_on(c, c, c.npoints());
+ //print x
+ for (size_t i = 0; i < x.npoints(); i++)
+ {
+ //Xk points
+ point2d px(x[i][0], x[i][1]);
+ if (output.has(px))
+ output(px) = literal::green;
+ }
+
//to 2d : projection (FIXME:if 3d)
for (size_t i = 0; i < c.npoints(); i++)
{
@@ -98,17 +107,8 @@
else if (length[i] > stddev)
output(p) = value::rgb8(255,200,0);
else
- output(p) = literal::white;
- }
+ output(p) = literal::black;
}
-
- // print surface
- for (size_t i = 0; i < c.npoints(); i++)
- {
- //Xk points
- point2d x(map(c[i])[0], map(c[i])[1]);
- if (output.has(x))
- output(x) = literal::green;
}
io::ppm::save(output, "registred.ppm");
Index: jardonnet/test/plotscript
--- jardonnet/test/plotscript (revision 1978)
+++ jardonnet/test/plotscript (working copy)
@@ -1,10 +1,7 @@
set xlabel "q"
set ylabel "e"
set zlabel "time"
-
splot "log.dat"
-
-
set terminal png nocrop enhanced size 800,600
set output "bench_qe.png"
replot
Index: jardonnet/test/img/c4.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: jardonnet/test/img/c6.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/c6.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/c7.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/c7.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/c8.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/c8.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/c9.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/c9.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/x3.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: jardonnet/test/img/x6.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/x6.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/x7.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/x7.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/x8.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/x8.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/img/x9.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/img/x9.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/Makefile
--- jardonnet/test/Makefile (revision 1978)
+++ jardonnet/test/Makefile (working copy)
@@ -16,11 +16,14 @@
icpD: icp.cc +depend
g++ icp.cc -I../../.. -g -o 'icpD'
-icp: icp.cc +depend icp.o
+icp: icp.o +depend
g++ icp.o -I../../.. -O3 -DNDEBUG -o 'icp'
-icp_ref:
- g++ icp_ref.cc -I../../.. -g -o 'icp_ref'
+icp_refD: icp_ref.cc ../registration/icp_ref.hh +depend
+ g++ icp_ref.cc -I../../.. -g -o 'icp_refD'
+
+icp_ref: icp_ref.cc ../registration/icp_ref.hh +depend
+ g++ icp_ref.cc -I../../.. -pg -O3 -DNDEBUG -o 'icp_ref'
icp.o:
g++ -c icp.cc -I../../.. -O3 -DNDEBUG
@@ -28,14 +31,17 @@
bench:
ruby bench.rb
+test: icp icp_ref
+ ruby test.rb
+
clean:
rm -f -- ./bin/*
- rm -f sub gsub gau icpD icp
+ rm -f sub gsub gau icpD icp icp_refD icp_ref
rm -f log.dat registred.pbm
rm -f i_*
rm -f tmp.ppm registred.ppm semantic.cache
-.PHONY: check bench icpD
+.PHONY: check bench test icpD
+depend:
g++ -M icp.cc $(FLAG) > +depend
Index: jardonnet/test/script_latex.plot
--- jardonnet/test/script_latex.plot (revision 0)
+++ jardonnet/test/script_latex.plot (revision 0)
@@ -0,0 +1,8 @@
+set terminal latex
+set output "eg1.tex"
+
+set xlabel "q"
+set ylabel "e"
+set zlabel "time"
+splot "log.dat"
+
Index: jardonnet/registration/final_qk.hh
--- jardonnet/registration/final_qk.hh (revision 1978)
+++ jardonnet/registration/final_qk.hh (working copy)
@@ -55,6 +55,8 @@
mu_newc += ci;
}
}
+ if (newc.npoints() == 0)
+ return quat7<P::dim>();
mu_newc /= newc.npoints();
quat7<P::dim> qk = match(newc, mu_newc, newc, map, newc.npoints());
Index: jardonnet/registration/interpolation.hh
--- jardonnet/registration/interpolation.hh (revision 1978)
+++ jardonnet/registration/interpolation.hh (working copy)
@@ -5,7 +5,7 @@
namespace mln
{
- void polcoe(float x[], float y[], int n,
+ void polcoe(const float x[], const float y[], int n,
float cof[])
{
int k,j,i;
Index: jardonnet/registration/tools.hh
--- jardonnet/registration/tools.hh (revision 1978)
+++ jardonnet/registration/tools.hh (working copy)
@@ -33,7 +33,7 @@
{
}
- void add(T e)
+ void store(T e)
{
for (int i = 0; i < n-1; i++)
buf[i+1] = buf[i];
@@ -48,6 +48,11 @@
return buf[i];
}
+ const T * get_array()
+ {
+ return buf;
+ }
+
private:
T buf[n];
unsigned int setted;
@@ -122,7 +127,6 @@
: value(nrows, ncols,1), is_known(nrows,ncols,1), fun(fun)
{ }
- // FIXME: gore length
const mln_result(F)
//inline
operator () (const typename F::input& p) const
Index: jardonnet/registration/cloud.hh
--- jardonnet/registration/cloud.hh (revision 1978)
+++ jardonnet/registration/cloud.hh (working copy)
@@ -16,6 +16,26 @@
namespace mln
{
+ namespace geom
+ {
+ template <typename P>
+ P center(const p_array<P>& a)
+ {
+ if (a.npoints() == 0)
+ return P();
+
+ algebra::vec<P::dim,float> c(literal::zero);
+ for (unsigned i = 0; i < a.npoints(); ++i)
+ {
+ // FIXME : Ugly.
+ algebra::vec<P::dim,float> ai = a[i];
+ c += ai;
+ }
+
+ return algebra::to_point<P>(c / a.npoints());
+ }
+ }
+
namespace registration
{
@@ -23,8 +43,9 @@
P center(const p_array<P>& a, size_t length)
{
algebra::vec<P::dim,float> c(literal::zero);
- for (size_t i = 0; i < length; ++i)
+ for (unsigned i = 0; i < length; ++i)
{
+ // FIXME : Ugly.
algebra::vec<P::dim,float> ai = a[i];
c += ai;
}
Index: jardonnet/registration/icp_ref.hh
--- jardonnet/registration/icp_ref.hh (revision 1978)
+++ jardonnet/registration/icp_ref.hh (working copy)
@@ -48,7 +48,6 @@
# include <mln/level/fill.hh>
# include <mln/io/ppm/save.hh>
-
# include "tools.hh"
# include "cloud.hh"
@@ -101,64 +100,37 @@
std::cout << "k\t\te_k >=\td_k\tdqk" << std::endl;
#endif
- quat7<P::dim> buf_qk[4];
- float buf_dk[3];
+ buffer<4,quat7<P::dim> > buf_qk;
- float err = 100;
- //float err_bis;
- p_array<P> Ck(C);
+ p_array<P> Ck(C), Xk(C);
+ float d_k = 1000, d_k_1 = 1000;
algebra::vec<P::dim,float> mu_C = center(C, c_length), mu_Xk;
- buf_qk[0] = qk;
+ buf_qk.store(qk);
qk.apply_on(C, Ck, c_length);
unsigned int k = 0;
do {
- //update buff dk //FIXME: rewrite it
- buf_dk[2] = buf_dk[1];
- buf_dk[1] = buf_dk[0];
- buf_dk[0] = err;
-
//compute qk
qk = match(C, mu_C, Ck, map, c_length);
- //update buff qk //FIXME: rewrite it
- buf_qk[3] = buf_qk[2];
- buf_qk[2] = buf_qk[1];
- buf_qk[1] = buf_qk[0];
- buf_qk[0] = qk;
-
- //update qk
- /*
- if (k > 3)
- qk = update_qk(buf_qk, buf_dk);
- qk._qR.set_unit();
- buf_qk[0] = qk;
- */
+ buf_qk.store(qk);
//Ck+1 = qk(C)
qk.apply_on(C, Ck, c_length);
- // e_k = d(Yk, Pk)
- // = d(closest(Pk), Pk)
- // = d(closest(qk-1(P)), qk-1(P))
- float e_k = rms(C, map, c_length, buf_qk[1], buf_qk[1]);
-
+ d_k_1 = d_k;
// d_k = d(Yk, Pk+1)
// = d(closest(qk-1(P)), qk(P))
- float d_k = rms(C, map, c_length, buf_qk[1], qk);
-
-
- //err = d(Ck+1,Xk) = d_k
- err = rms(C, qk, map, c_length);
-
- //err = d(Ck,Xk) = e_k
- float err_bis = rms(C, buf_qk[1], map, c_length);
+ d_k = rms(C, map, c_length, buf_qk[1], qk);
#ifndef NDEBUG
+ // e_k = d(closest(qk-1(P)), qk-1(P))
+ float e_k = rms(C, map, c_length, buf_qk[1], buf_qk[1]);
+
//plot file
std::cout << k << '\t' << (e_k >= d_k ? ' ' : '-') << '\t'
<< e_k << '\t' << d_k << '\t'
<< ((qk - buf_qk[1]).sqr_norm() / qk.sqr_norm())
<< '\t'
@@ -167,7 +139,7 @@
pts += c_length;
#endif
k++;
- } while ((qk - buf_qk[1]).sqr_norm() / qk.sqr_norm() > epsilon);
+ } while (d_k_1 - d_k > epsilon);
trace::exiting("registration::impl::icp_");
}
Index: jardonnet/registration/icp.hh
--- jardonnet/registration/icp.hh (revision 1978)
+++ jardonnet/registration/icp.hh (working copy)
@@ -101,65 +101,50 @@
std::cout << "k\t\te_k >=\td_k\tdqk" << std::endl;
#endif
- quat7<P::dim> buf_qk[4];
- float buf_dk[3];
+ buffer<4,quat7<P::dim> > buf_qk;
+ buffer<3,float> buf_dk;
- float err = 100;
- //float err_bis;
+ float d_k = 10000;
p_array<P> Ck(C);
algebra::vec<P::dim,float> mu_C = center(C, c_length), mu_Xk;
- buf_qk[0] = qk;
+ buf_qk.store(qk);
qk.apply_on(C, Ck, c_length);
+ //buf_dk[0] = rms(C, map, c_length, buf_qk[1], qk);
+
unsigned int k = 0;
do {
- //update buff dk //FIXME: rewrite it
- buf_dk[2] = buf_dk[1];
- buf_dk[1] = buf_dk[0];
- buf_dk[0] = err;
+ buf_dk.store(d_k);
//compute qk
qk = match(C, mu_C, Ck, map, c_length);
- //update buff qk //FIXME: rewrite it
- buf_qk[3] = buf_qk[2];
- buf_qk[2] = buf_qk[1];
- buf_qk[1] = buf_qk[0];
- buf_qk[0] = qk;
-
+ buf_qk.store(qk);
//update qk
- if (k > 3)
- qk = update_qk(buf_qk, buf_dk);
+ if (k > 2)
+ qk = update_qk(buf_qk.get_array(), buf_dk.get_array());
qk._qR.set_unit();
buf_qk[0] = qk;
//Ck+1 = qk(C)
qk.apply_on(C, Ck, c_length);
- // e_k = d(Yk, Pk)
- // = d(closest(Pk), Pk)
- // = d(closest(qk-1(P)), qk-1(P))
- float e_k = rms(C, map, c_length, buf_qk[1], buf_qk[1]);
-
// d_k = d(Yk, Pk+1)
// = d(closest(qk-1(P)), qk(P))
- float d_k = rms(C, map, c_length, buf_qk[1], qk);
-
-
- //err = d(Ck+1,Xk) = d_k
- err = rms(C, qk, map, c_length);
-
- //err = d(Ck,Xk) = e_k
- float err_bis = rms(C, buf_qk[1], map, c_length);
+ d_k = rms(C, map, c_length, buf_qk[1], qk);
#ifndef NDEBUG
+ // e_k = d(closest(qk-1(P)), qk-1(P))
+ float e_k = rms(C, map, c_length, buf_qk[1], buf_qk[1]);
+
//plot file
- std::cout << k << '\t' << (e_k >= d_k ? ' ' : '-') << '\t' <<
e_k << '\t' << d_k << '\t'
+ std::cout << k << '\t' << (e_k >= d_k ? ' ' : '-')
+ << '\t' << e_k << '\t' << d_k << '\t'
<< ((qk - buf_qk[1]).sqr_norm() / qk.sqr_norm())
<< '\t'
<< std::endl;
//count the number of points processed
Index: jardonnet/registration/update_qk.hh
--- jardonnet/registration/update_qk.hh (revision 1978)
+++ jardonnet/registration/update_qk.hh (working copy)
@@ -17,8 +17,8 @@
}
- quat7<3> update_qk(quat7<3> qk[4],
- float dk[3])
+ quat7<3> update_qk(const quat7<3> qk[4],
+ const float dk[3])
{
quat7<3> dqk_2 = qk[2] - qk[3];
quat7<3> dqk_1 = qk[1] - qk[2];
@@ -30,17 +30,18 @@
if (tetak < 10 and tetak_1 < 10) //10 degrees
{
float vk[3];
- float dk[3];
float coef[3];
vk[0] = 0;
vk[1] = - dqk.sqr_norm();
vk[2] = - dqk_1.sqr_norm() + vk[1];
+ // FIXME: check again.
float a1 = (dk[2] + dk[0]) / (vk[2] - vk[0]);
float b1 = dk[1] - ((dk[2] + dk[0]) / (vk[2] - vk[0])) * vk[1];
float v1 = math::abs(- b1 / a1); // > 0
+ // FIXME: compute inline;
polcoe(vk, dk, 2, coef);
float a2 = coef[0];
float b2 = coef[1];
@@ -59,8 +60,6 @@
if (v1 > vmax and v2 > vmax)
return qk[0] + (dqk / dqk.sqr_norm()) * vmax;
-
- std::cout << "echec" << std::endl;
}
return qk[0];
1
0