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
September 2008
- 12 participants
- 359 discussions
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix update in level fill.
* mln/level/fill.hh: Fix update.
fill.hh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: mln/level/fill.hh
--- mln/level/fill.hh (revision 2234)
+++ mln/level/fill.hh (working copy)
@@ -88,26 +88,27 @@
// dispatch_overload
template <typename I>
- void fill_dispatch_overload(Image<I>& ima, const mln_value(I)& v)
+ void fill_dispatch_overload(I& ima, const mln_value(I)& v)
{
mln::level::fill_with_value(ima, v);
}
template <typename I, typename J>
- void fill_dispatch_overload(Image<I>& ima, const Image<J>& data)
+ void fill_dispatch_overload(I& ima, const Image<J>& data)
{
mln::level::fill_with_image(ima, data);
}
template <typename I, typename F>
- void fill_dispatch_overload(Image<I>& ima, const Function<F>& f)
+ void fill_dispatch_overload(I& ima, const Function<F>& f)
{
mlc_converts_to(mln_result(F), mln_value(I))::check();
- mln::level::fill_with_image(ima, f | ima.domain());
+ mln::level::fill_with_image(ima,
+ exact(f) | ima.domain());
}
template <typename I, typename R, typename A>
- void fill_dispatch_overload(Image<I>& ima, R (*f)(A))
+ void fill_dispatch_overload(I& ima, R (*f)(A))
{
mlc_converts_to(R, mln_value(I))::check();
mln::level::fill_with_image(ima,
@@ -115,10 +116,9 @@
}
template <typename I, typename V, unsigned N>
- void fill_dispatch_overload(Image<I>& ima_, V (&arr)[N])
+ void fill_dispatch_overload(I& ima, V (&arr)[N])
{
mlc_converts_to(V, mln_value(I))::check();
- I& ima = exact(ima_);
mln_precondition(N == ima.nsites());
mln_fwd_piter(I) p(ima.domain());
unsigned i = 0;
1
0
12 Sep '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Get rid of the deprecated 'npoints' name.
* tools/area_flooding.cc,
* tests/core/other/dpoints_pixter.cc,
* mln/core/site_set/p_bgraph.hh,
* mln/core/site_set/p_bgraph_piter.hh,
* mln/core/site_set/p_complex.hh,
* mln/core/site_set/p_line_graph.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_graph.hh,
* mln/core/image/bgraph_image.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/internal/run_image.hh,
* mln/core/concept/doc/image.hh,
* mln/draw/graph.hh,
* mln/level/sort_psites.hh,
* mln/convert/to_p_array.hh,
* mln/geom/pmin_pmax.hh,
* mln/set/is_subset_of.hh,
* mln/morpho/rank_filter.hh,
* mln/morpho/Rd.hh,
* sandbox/duhamel/queue_p_priority.cc,
* sandbox/duhamel/mesh_p.hh,
* sandbox/duhamel/queue_p_fast.hh,
* sandbox/duhamel/queue_p_priority.hh,
* sandbox/duhamel/labeling_algo.hh,
* sandbox/pellegrin/set/test/p_queue_fast.cc,
* sandbox/pellegrin/set/test/p_priority_queue_fast.cc,
* sandbox/pellegrin/set/test/p_queue.cc,
* sandbox/pellegrin/set/test/p_priority_queue.cc,
* sandbox/pellegrin/set/test/p_runs.cc,
* sandbox/pellegrin/set/test/pset_if.cc,
* sandbox/pellegrin/set/test/p_set.cc,
* sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc,
* 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/p_array.hh,
* sandbox/pellegrin/set/core/concept/point_set.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_priority_queue_fast_with_array.hh,
* sandbox/pellegrin/set/core/p_set.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/aroumougame/skeleton/test_image3d.cc,
* sandbox/aroumougame/skeleton/thinning.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/jardonnet/test/icp_ref.cc,
* sandbox/jardonnet/test/icp.cc,
* sandbox/jardonnet/registration/final_qk.hh,
* sandbox/jardonnet/registration/cov.hh,
* sandbox/jardonnet/registration/exp_val.hh,
* sandbox/jardonnet/registration/save.hh,
* sandbox/jardonnet/registration/tools.hh,
* sandbox/jardonnet/registration/quat7.hh,
* sandbox/jardonnet/registration/cloud.hh,
* sandbox/jardonnet/registration/icp_ref.hh,
* sandbox/jardonnet/registration/icp.hh,
* sandbox/jardonnet/registration/projection.hh,
* sandbox/jardonnet/registration/center.hh,
* sandbox/geraud/fllt/fllt.hh,
* sandbox/geraud/fllt/simple_tests.cc,
* sandbox/geraud/fllt/fllt.svg.1.cc,
* sandbox/geraud/fllt/fllt.svg.7.hh,
* sandbox/geraud/fllt/fllt.svg.2.cc,
* sandbox/geraud/fllt/fllt.svg.3.cc,
* sandbox/geraud/fllt/fllt.svg.4.cc,
* sandbox/geraud/fllt/fllt.svg.5.cc,
* sandbox/geraud/fllt/fllt.svg.6.cc,
* sandbox/geraud/fllt/connected_filters/area_filter.hh,
* sandbox/geraud/fllt/fllt_test.hh,
* sandbox/geraud/fllt.svg.7.hh,
* sandbox/geraud/p_runs__with_dedicated_piter.hh,
* sandbox/geraud/fllt.svg.6.cc,
* sandbox/garrigues/level_set.hh,
* sandbox/garrigues/fllt/fllt_simple.svg.1.cc,
* sandbox/garrigues/fllt/merge.hh,
* sandbox/garrigues/fllt/fllt_simple.svg.3.cc,
* sandbox/garrigues/fllt/fllt_simple.cc,
* sandbox/garrigues/fllt/types.hh,
* sandbox/garrigues/fllt/fllt_theo.cc,
* sandbox/garrigues/fllt/compute_level_set_fast2.hh,
* sandbox/garrigues/fllt/fllt_merge.hh,
* sandbox/garrigues/fllt/fllt_optimized.hh,
* sandbox/garrigues/fllt/debug.hh,
* sandbox/garrigues/fllt/compute_level_set_fast.hh,
* sandbox/garrigues/fllt/fllt_simple.svg.2.cc,
* sandbox/garrigues/fllt/compute_level_set.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
* sandbox/abraham/mln/morpho/basic_najman.hh
(npoints): Update token to...
(nsites): ...this.
mln/convert/to_p_array.hh | 2
mln/core/concept/doc/image.hh | 2
mln/core/image/bgraph_image.hh | 2
mln/core/image/fi_adaptor.hh | 2
mln/core/internal/run_image.hh | 2
mln/core/site_set/p_bgraph.hh | 6
mln/core/site_set/p_bgraph_piter.hh | 2
mln/core/site_set/p_complex.hh | 6
mln/core/site_set/p_faces.hh | 6
mln/core/site_set/p_graph.hh | 14 -
mln/core/site_set/p_line_graph.hh | 12 -
mln/draw/graph.hh | 2
mln/geom/pmin_pmax.hh | 4
mln/level/sort_psites.hh | 4
mln/morpho/Rd.hh | 2
mln/morpho/rank_filter.hh | 2
mln/set/is_subset_of.hh | 2
sandbox/abraham/mln/morpho/basic_najman.hh | 38 ++---
sandbox/aroumougame/skeleton/test_image3d.cc | 6
sandbox/aroumougame/skeleton/thinning.hh | 74 +++++-----
sandbox/duhamel/labeling_algo.hh | 2
sandbox/duhamel/mesh_p.hh | 4
sandbox/duhamel/queue_p_fast.hh | 10 -
sandbox/duhamel/queue_p_priority.cc | 10 -
sandbox/duhamel/queue_p_priority.hh | 18 +-
sandbox/garrigues/fllt/compute_level_set.hh | 18 +-
sandbox/garrigues/fllt/compute_level_set_fast.hh | 14 -
sandbox/garrigues/fllt/compute_level_set_fast2.hh | 14 -
sandbox/garrigues/fllt/debug.hh | 10 -
sandbox/garrigues/fllt/fllt_merge.hh | 4
sandbox/garrigues/fllt/fllt_optimized.hh | 4
sandbox/garrigues/fllt/fllt_simple.cc | 30 ++--
sandbox/garrigues/fllt/fllt_simple.svg.1.cc | 8 -
sandbox/garrigues/fllt/fllt_simple.svg.2.cc | 8 -
sandbox/garrigues/fllt/fllt_simple.svg.3.cc | 30 ++--
sandbox/garrigues/fllt/fllt_theo.cc | 18 +-
sandbox/garrigues/fllt/merge.hh | 6
sandbox/garrigues/fllt/types.hh | 20 +-
sandbox/garrigues/level_set.hh | 8 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 2
sandbox/geraud/fllt.svg.6.cc | 32 ++--
sandbox/geraud/fllt.svg.7.hh | 18 +-
sandbox/geraud/fllt/connected_filters/area_filter.hh | 4
sandbox/geraud/fllt/fllt.hh | 22 +-
sandbox/geraud/fllt/fllt.svg.1.cc | 2
sandbox/geraud/fllt/fllt.svg.2.cc | 10 -
sandbox/geraud/fllt/fllt.svg.3.cc | 6
sandbox/geraud/fllt/fllt.svg.4.cc | 10 -
sandbox/geraud/fllt/fllt.svg.5.cc | 10 -
sandbox/geraud/fllt/fllt.svg.6.cc | 32 ++--
sandbox/geraud/fllt/fllt.svg.7.hh | 18 +-
sandbox/geraud/fllt/fllt_test.hh | 18 +-
sandbox/geraud/fllt/simple_tests.cc | 4
sandbox/geraud/p_runs__with_dedicated_piter.hh | 2
sandbox/jardonnet/registration/center.hh | 6
sandbox/jardonnet/registration/cloud.hh | 10 -
sandbox/jardonnet/registration/cov.hh | 6
sandbox/jardonnet/registration/exp_val.hh | 6
sandbox/jardonnet/registration/final_qk.hh | 20 +-
sandbox/jardonnet/registration/icp.hh | 12 -
sandbox/jardonnet/registration/icp_ref.hh | 4
sandbox/jardonnet/registration/projection.hh | 16 +-
sandbox/jardonnet/registration/quat7.hh | 4
sandbox/jardonnet/registration/save.hh | 10 -
sandbox/jardonnet/registration/tools.hh | 8 -
sandbox/jardonnet/test/icp.cc | 12 -
sandbox/jardonnet/test/icp_ref.cc | 10 -
sandbox/nivault/plugin-gimp/src/gimp-image.hh | 2
sandbox/pellegrin/set/core/concept/point_set.hh | 10 -
sandbox/pellegrin/set/core/internal/multi_set.hh | 10 -
sandbox/pellegrin/set/core/internal/uni_set.hh | 10 -
sandbox/pellegrin/set/core/line2d.hh | 6
sandbox/pellegrin/set/core/p_array.hh | 12 -
sandbox/pellegrin/set/core/p_bgraph.hh | 6
sandbox/pellegrin/set/core/p_graph.hh | 10 -
sandbox/pellegrin/set/core/p_line_graph.hh | 4
sandbox/pellegrin/set/core/p_priority_queue.hh | 18 +-
sandbox/pellegrin/set/core/p_priority_queue_fast.hh | 18 +-
sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh | 18 +-
sandbox/pellegrin/set/core/p_queue.hh | 10 -
sandbox/pellegrin/set/core/p_queue_fast.hh | 10 -
sandbox/pellegrin/set/core/p_run.hh | 10 -
sandbox/pellegrin/set/core/p_runs.hh | 12 -
sandbox/pellegrin/set/core/p_set.hh | 10 -
sandbox/pellegrin/set/core/pset_if.hh | 4
sandbox/pellegrin/set/test/p_priority_queue.cc | 10 -
sandbox/pellegrin/set/test/p_priority_queue_fast.cc | 10 -
sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc | 16 +-
sandbox/pellegrin/set/test/p_queue.cc | 6
sandbox/pellegrin/set/test/p_queue_fast.cc | 6
sandbox/pellegrin/set/test/p_runs.cc | 4
sandbox/pellegrin/set/test/p_set.cc | 2
sandbox/pellegrin/set/test/pset_if.cc | 2
tests/core/other/dpoints_pixter.cc | 6
tools/area_flooding.cc | 2
95 files changed, 492 insertions(+), 492 deletions(-)
Index: tools/area_flooding.cc
--- tools/area_flooding.cc (revision 2233)
+++ tools/area_flooding.cc (working copy)
@@ -114,7 +114,7 @@
nbh_t nbh;
unsigned area = 0;
- unsigned max_area = input.npoints();
+ unsigned max_area = input.nsites();
unsigned nregions = mln_max(unsigned);
unsigned max_nregions = atoi(argv[1]);
Index: tests/core/other/dpoints_pixter.cc
--- tests/core/other/dpoints_pixter.cc (revision 2233)
+++ tests/core/other/dpoints_pixter.cc (working copy)
@@ -40,7 +40,7 @@
template <typename I, typename W>
-void test_fill(I& ima, const W& win, unsigned npoints)
+void test_fill(I& ima, const W& win, unsigned nsites)
{
mln_piter(I) p(ima.domain());
mln_fwd_qixter(I, W) fq(ima, win, p);
@@ -49,7 +49,7 @@
unsigned i = 0;
for_all(fq)
++i, fq.val() = 51;
- mln_assertion(i == npoints);
+ mln_assertion(i == nsites);
}
mln_bkd_qixter(I, W) bq(ima, win, p);
for_all(p)
@@ -57,7 +57,7 @@
unsigned i = 0;
for_all(bq)
++i, bq.val() = 42;
- mln_assertion(i == npoints);
+ mln_assertion(i == nsites);
}
}
Index: mln/core/site_set/p_bgraph.hh
--- mln/core/site_set/p_bgraph.hh (revision 2233)
+++ mln/core/site_set/p_bgraph.hh (working copy)
@@ -78,7 +78,7 @@
p_bgraph (graph* gr);
/// Return The number of points (i.e., nodes) in the graph.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of lines (i.e., edges) in the graph.
std::size_t nlines() const;
@@ -131,7 +131,7 @@
template<typename P>
inline
std::size_t
- p_bgraph<P>::npoints() const
+ p_bgraph<P>::nsites() const
{
return boost::num_vertices(*gr_);
}
@@ -161,7 +161,7 @@
// Check whether P is compatible with this psite set.
(&p.pg() == this) &&
// Check that the node id of P belongs to the range of valid node ids.
- (p.id() < this->npoints());
+ (p.id() < this->nsites());
}
Index: mln/core/site_set/p_bgraph_piter.hh
--- mln/core/site_set/p_bgraph_piter.hh (revision 2233)
+++ mln/core/site_set/p_bgraph_piter.hh (working copy)
@@ -118,7 +118,7 @@
p_bgraph_piter_<P>::p_bgraph_piter_(const p_bgraph<P>& pg)
: pg_(pg),
// Initialize psite_ to a dummy value.
- psite_(pg, pg_.npoints()),
+ psite_(pg, pg_.nsites()),
p_()
{
iterators_ = boost::vertices(pg_.to_graph());
Index: mln/core/site_set/p_complex.hh
--- mln/core/site_set/p_complex.hh (revision 2233)
+++ mln/core/site_set/p_complex.hh (working copy)
@@ -82,7 +82,7 @@
/// number of \em faces.
///
/// Required by the mln::Point_Set concept.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of faces in the complex.
std::size_t nfaces() const;
@@ -161,7 +161,7 @@
{
// FIXME: Dummy initialization.
accu::bbox<P> a;
- for (unsigned i = 0; i < npoints(); ++i)
+ for (unsigned i = 0; i < nsites(); ++i)
a.take(P());
bb_ = a.to_result();
}
@@ -169,7 +169,7 @@
template <unsigned D, typename P>
inline
std::size_t
- p_complex<D, P>::npoints() const
+ p_complex<D, P>::nsites() const
{
return nfaces();
}
Index: mln/core/site_set/p_line_graph.hh
--- mln/core/site_set/p_line_graph.hh (revision 2233)
+++ mln/core/site_set/p_line_graph.hh (working copy)
@@ -79,7 +79,7 @@
/// line graph.
///
/// Required by the mln::Point_Set concept.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of vertices in the graph.
std::size_t nvertices() const;
@@ -155,7 +155,7 @@
template <typename P>
inline
std::size_t
- p_line_graph<P>::npoints() const
+ p_line_graph<P>::nsites() const
{
return nedges();
}
@@ -213,8 +213,8 @@
p_line_graph<P>::adjacent(const util::edge_id& lhs,
const util::edge_id& rhs) const
{
- mln_assertion(lhs < this->npoints());
- mln_assertion(rhs < this->npoints());
+ mln_assertion(lhs < this->nsites());
+ mln_assertion(rhs < this->nsites());
// Ensure LHS and RHS are *not* equal.
if (lhs == rhs)
@@ -248,8 +248,8 @@
p_line_graph<P>::adjacent_or_equal(const util::edge_id& lhs,
const util::edge_id& rhs) const
{
- mln_assertion(lhs < this->npoints());
- mln_assertion(rhs < this->npoints());
+ mln_assertion(lhs < this->nsites());
+ mln_assertion(rhs < this->nsites());
// Check whether LHS and RHS are equal.
if (lhs == rhs)
Index: mln/core/site_set/p_faces.hh
--- mln/core/site_set/p_faces.hh (revision 2233)
+++ mln/core/site_set/p_faces.hh (working copy)
@@ -79,7 +79,7 @@
/// number of \em faces.
///
/// Required by the mln::Point_Set concept.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of faces in the complex.
std::size_t nfaces() const;
@@ -135,7 +135,7 @@
// FIXME: Dummy initialization.
accu::bbox<P> a;
- for (unsigned i = 0; i < npoints(); ++i)
+ for (unsigned i = 0; i < nsites(); ++i)
a.take(P());
bb_ = a.to_result();
}
@@ -143,7 +143,7 @@
template <unsigned N, unsigned D, typename P>
inline
std::size_t
- p_faces<N, D, P>::npoints() const
+ p_faces<N, D, P>::nsites() const
{
return nfaces();
}
Index: mln/core/site_set/p_graph.hh
--- mln/core/site_set/p_graph.hh (revision 2233)
+++ mln/core/site_set/p_graph.hh (working copy)
@@ -71,7 +71,7 @@
/// the number of \em vertices.
///
/// Required by the mln::Point_Set concept.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of vertices in the graph.
std::size_t nvertices() const;
@@ -160,7 +160,7 @@
: gr_ (new util::graph<P>(gr))
{
accu::bbox<P> a;
- for (unsigned i = 0; i < npoints(); ++i)
+ for (unsigned i = 0; i < nsites(); ++i)
a.take(gr_->vertex_data(i));
bb_ = a.to_result();
}
@@ -168,7 +168,7 @@
template <typename P>
inline
std::size_t
- p_graph<P>::npoints() const
+ p_graph<P>::nsites() const
{
return nvertices();
}
@@ -256,8 +256,8 @@
p_graph<P>::adjacent(const util::vertex_id& lhs,
const util::vertex_id& rhs) const
{
- mln_assertion(lhs < this->npoints());
- mln_assertion(rhs < this->npoints());
+ mln_assertion(lhs < this->nsites());
+ mln_assertion(rhs < this->nsites());
// Ensure LHS and RHS are *not* equal.
if (rhs == lhs)
@@ -291,8 +291,8 @@
p_graph<P>::adjacent_or_equal(const util::vertex_id& lhs,
const util::vertex_id& rhs) const
{
- mln_assertion(lhs < this->npoints());
- mln_assertion(rhs < this->npoints());
+ mln_assertion(lhs < this->nsites());
+ mln_assertion(rhs < this->nsites());
// Check whether LHS and RHS are equal.
if (lhs == rhs)
Index: mln/core/image/bgraph_image.hh
--- mln/core/image/bgraph_image.hh (revision 2233)
+++ mln/core/image/bgraph_image.hh (working copy)
@@ -202,7 +202,7 @@
inline
bgraph_image<P, V>::bgraph_image(const p_bgraph<P>& g)
{
- init_(g, std::vector<V>(g.npoints()));
+ init_(g, std::vector<V>(g.nsites()));
}
template <typename P, typename V>
Index: mln/core/image/fi_adaptor.hh
--- mln/core/image/fi_adaptor.hh (revision 2233)
+++ mln/core/image/fi_adaptor.hh (working copy)
@@ -310,7 +310,7 @@
fi_adaptor<I>::nelements() const
{
mln_precondition(this->has_data());
- return this->data_->b_.npoints();
+ return this->data_->b_.nsites();
}
template <typename I>
Index: mln/core/internal/run_image.hh
--- mln/core/internal/run_image.hh (revision 2233)
+++ mln/core/internal/run_image.hh (working copy)
@@ -102,7 +102,7 @@
run_image_<T, P, E>::compression() const
{
return float(exact(this)->data_->size_mem()) /
- float (sizeof(T) * exact(this)->data_->domain_.bbox().npoints());
+ float (sizeof(T) * exact(this)->data_->domain_.bbox().nsites());
}
template <typename T, typename P, typename E>
Index: mln/core/concept/doc/image.hh
--- mln/core/concept/doc/image.hh (revision 2233)
+++ mln/core/concept/doc/image.hh (working copy)
@@ -176,7 +176,7 @@
/*! \brief Give the number of points of the image domain.
*/
- std::size_t npoints() const;
+ std::size_t nsites() const;
};
Index: mln/draw/graph.hh
--- mln/draw/graph.hh (revision 2233)
+++ mln/draw/graph.hh (working copy)
@@ -103,7 +103,7 @@
pg.gr_->vertex_data(pg.gr_->edge(l).v2()),
edge_v);
// Draw the points (vertices).
- for (size_t p = 0; p < pg.npoints(); ++p)
+ for (size_t p = 0; p < pg.nsites(); ++p)
exact(ima)(pg.gr_->vertex_data(p)) = vertex_v;
}
Index: mln/level/sort_psites.hh
--- mln/level/sort_psites.hh (revision 2233)
+++ mln/level/sort_psites.hh (working copy)
@@ -149,7 +149,7 @@
loc[i] = loc[i-1] + h[i-1];
// computing output data
- std::vector<mln_psite(I)> vec(input.npoints());
+ std::vector<mln_psite(I)> vec(input.nsites());
mln_fwd_piter(I) p(input.domain());
for_all(p)
vec[loc[vset.index_of(input(p))]++] = p;
@@ -193,7 +193,7 @@
loc[i] = loc[i+1] + h[i+1];
// computing output data
- std::vector<mln_psite(I)> vec(input.npoints());
+ std::vector<mln_psite(I)> vec(input.nsites());
mln_fwd_piter(I) p(input.domain());
for_all(p)
vec[loc[vset.index_of(input(p))]++] = p;
Index: mln/convert/to_p_array.hh
--- mln/convert/to_p_array.hh (revision 2233)
+++ mln/convert/to_p_array.hh (working copy)
@@ -68,7 +68,7 @@
{
const S& pset = exact(pset_);
p_array<mln_psite(S)> v;
- v.reserve(pset.npoints());
+ v.reserve(pset.nsites());
// FIXME: Why mln_fwd_piter and not mln_piter?
mln_fwd_piter(S) p(pset);
for_all(p)
Index: mln/geom/pmin_pmax.hh
--- mln/geom/pmin_pmax.hh (revision 2233)
+++ mln/geom/pmin_pmax.hh (working copy)
@@ -150,7 +150,7 @@
void
pmin_pmax(const Site_Set<S>& s, mln_point(S)& pmin, mln_point(S)& pmax)
{
- mln_precondition(exact(s).npoints() != 0);
+ mln_precondition(exact(s).nsites() != 0);
impl::pmin_pmax_(exact(s), pmin, pmax);
}
@@ -159,7 +159,7 @@
std::pair<mln_point(S), mln_point(S)>
pmin_pmax(const Site_Set<S>& s)
{
- mln_precondition(exact(s).npoints() != 0);
+ mln_precondition(exact(s).nsites() != 0);
typedef mln_point(S) P;
std::pair<P, P> tmp;
pmin_pmax(s, tmp.first, tmp.second); // Calls the previous version.
Index: mln/set/is_subset_of.hh
--- mln/set/is_subset_of.hh (revision 2233)
+++ mln/set/is_subset_of.hh (working copy)
@@ -58,7 +58,7 @@
Pl lhs = exact(lhs_);
Pr rhs = exact(rhs_);
- if (lhs.npoints() > rhs.npoints())
+ if (lhs.nsites() > rhs.nsites())
{
trace::exiting("set::is_subset_of");
return false;
Index: mln/morpho/rank_filter.hh
--- mln/morpho/rank_filter.hh (revision 2233)
+++ mln/morpho/rank_filter.hh (working copy)
@@ -69,7 +69,7 @@
mln_concrete(I) output;
initialize(output, input);
- accu::rank_<mln_value(I)> accu(k, convert::to_p_array(win, mln_psite(I)()).npoints());
+ accu::rank_<mln_value(I)> accu(k, convert::to_p_array(win, mln_psite(I)()).nsites());
mln_piter(I) p(input.domain());
mln_qiter(W) q(win, p);
for_all(p)
Index: mln/morpho/Rd.hh
--- mln/morpho/Rd.hh (revision 2233)
+++ mln/morpho/Rd.hh (working copy)
@@ -85,7 +85,7 @@
loc[255] = 0;
for (int l = 254; l >= 0; --l)
loc[l] = loc[l+1] + h[l+1];
- std::vector<mln_psite(I)> vec(ima.domain().npoints());
+ std::vector<mln_psite(I)> vec(ima.domain().nsites());
// storing output data
mln_piter(I) p(ima.domain());
for_all(p)
Index: sandbox/duhamel/queue_p_priority.cc
--- sandbox/duhamel/queue_p_priority.cc (revision 2233)
+++ sandbox/duhamel/queue_p_priority.cc (working copy)
@@ -12,7 +12,7 @@
mln_assertion (q.empty ());
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
q.push_force (p3);
q.push_force (p1, 3);
@@ -25,7 +25,7 @@
mln_assertion (q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 3);
+ mln_assertion (q.nsites () == 3);
mln_assertion (q.front () == p2);
q.pop ();
@@ -33,7 +33,7 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 2);
+ mln_assertion (q.nsites () == 2);
mln_assertion (q.front () == p1);
q.pop ();
@@ -41,14 +41,14 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 1);
+ mln_assertion (q.nsites () == 1);
mln_assertion (q.front () == p3);
q.pop ();
mln_assertion (!q.has (p1));
mln_assertion (!q.has (p2));
mln_assertion (!q.has (p3));
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
mln_assertion (q.empty ());
Index: sandbox/duhamel/mesh_p.hh
--- sandbox/duhamel/mesh_p.hh (revision 2233)
+++ sandbox/duhamel/mesh_p.hh (working copy)
@@ -28,7 +28,7 @@
/// Backward Site_Iterator associated type.
typedef mesh_p_piter_<P> bkd_piter;
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -128,7 +128,7 @@
template<typename P>
std::size_t
- mesh_p<P>::npoints() const
+ mesh_p<P>::nsites() const
{
return this->gr_.nb_node_;
}
Index: sandbox/duhamel/queue_p_fast.hh
--- sandbox/duhamel/queue_p_fast.hh (revision 2233)
+++ sandbox/duhamel/queue_p_fast.hh (working copy)
@@ -60,7 +60,7 @@
* (i.e., no-op if multiple or allow multiple insertions).
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P>
class queue_p_fast : public internal::point_set_base_< P, queue_p_fast<P> >
@@ -83,7 +83,7 @@
bool empty() const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -179,7 +179,7 @@
template <typename P>
std::size_t
- queue_p_fast<P>::npoints() const
+ queue_p_fast<P>::nsites() const
{
mln_precondition(this->end_ >= this->begin_);
return (this->end_ - this->begin_);
@@ -189,7 +189,7 @@
const box_<P>&
queue_p_fast<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -263,7 +263,7 @@
const P&
queue_p_fast<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return q_[begin_ + i];
}
Index: sandbox/duhamel/queue_p_priority.hh
--- sandbox/duhamel/queue_p_priority.hh (revision 2233)
+++ sandbox/duhamel/queue_p_priority.hh (working copy)
@@ -61,7 +61,7 @@
* (i.e., no-op if multiple or allow multiple insertions).
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P, typename T>
class queue_p_priority : public internal::point_set_base_< P, queue_p_priority<P, T> >
@@ -84,7 +84,7 @@
bool empty() const;
/// Give the number of points.
- unsigned npoints() const;
+ unsigned nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -142,7 +142,7 @@
queue_p_priority<P, T>::vect_update_() const
{
vect_.clear();
- vect_.reserve(npoints());
+ vect_.reserve(nsites());
typename std::map<T, queue_p<P> >::const_iterator it = q_.begin ();
@@ -161,7 +161,7 @@
typename std::map<T, queue_p<P> >::const_iterator it = q_.begin ();
for (; it != q_.end (); ++it)
- for (unsigned i = 0; i < (*it).second.npoints (); ++i)
+ for (unsigned i = 0; i < (*it).second.nsites (); ++i)
bb_.take((*it).second[i]);
}
@@ -192,7 +192,7 @@
template <typename P, typename T>
unsigned
- queue_p_priority<P, T>::npoints() const
+ queue_p_priority<P, T>::nsites() const
{
unsigned res = 0;
@@ -200,7 +200,7 @@
for (; it != q_.end (); ++it)
if (!(*it).second.empty ())
- res += (*it).second.npoints();
+ res += (*it).second.nsites();
return res;
}
@@ -208,7 +208,7 @@
const box_<P>&
queue_p_priority<P, T>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -290,7 +290,7 @@
const P&
queue_p_priority<P, T>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
typename std::map<T, queue_p<P> >::const_iterator it = q_.begin ();
unsigned cpt = 0;
@@ -298,7 +298,7 @@
for (; it != q_.end (); ++it)
{
if (!(*it).second.empty ())
- for (cpt = 0; cpt < (*it).second.npoints (); ++cpt)
+ for (cpt = 0; cpt < (*it).second.nsites (); ++cpt)
{
if (i == 0)
return (*it).second[cpt];
Index: sandbox/duhamel/labeling_algo.hh
--- sandbox/duhamel/labeling_algo.hh (revision 2233)
+++ sandbox/duhamel/labeling_algo.hh (working copy)
@@ -250,7 +250,7 @@
q.push(p);
break;
}
- std::cout << "init => q has " << q.npoints() << " points"
+ std::cout << "init => q has " << q.nsites() << " points"
<< std::endl;
}
Index: sandbox/pellegrin/set/test/p_queue_fast.cc
--- sandbox/pellegrin/set/test/p_queue_fast.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_queue_fast.cc (working copy)
@@ -44,14 +44,14 @@
.push(make::point2d(6, 9))
.push(make::point2d(5, 1))
.push(make::point2d(4, 2));
- mln_assertion(q.npoints() == 3);
+ mln_assertion(q.nsites() == 3);
std::cout << q.bbox() << std::endl;
std::cout << q << std::endl;
q.pop();
- mln_assertion(q.npoints() == 2);
+ mln_assertion(q.nsites() == 2);
point2d p = q.front();
- mln_assertion(q.npoints() == 2);
+ mln_assertion(q.nsites() == 2);
mln_assertion(p == make::point2d(5, 1));
}
Index: sandbox/pellegrin/set/test/p_priority_queue_fast.cc
--- sandbox/pellegrin/set/test/p_priority_queue_fast.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_priority_queue_fast.cc (working copy)
@@ -44,7 +44,7 @@
mln_assertion (q.is_empty ());
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
q.push_force (p3);
q.push_force (p1, 3);
@@ -59,7 +59,7 @@
mln_assertion (q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 3);
+ mln_assertion (q.nsites () == 3);
mln_assertion (q.front () == p2);
q.pop ();
@@ -67,7 +67,7 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 2);
+ mln_assertion (q.nsites () == 2);
mln_assertion (q.front () == p1);
q.pop ();
@@ -75,14 +75,14 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 1);
+ mln_assertion (q.nsites () == 1);
mln_assertion (q.front () == p3);
q.pop ();
mln_assertion (!q.has (p1));
mln_assertion (!q.has (p2));
mln_assertion (!q.has (p3));
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
mln_assertion (q.is_empty ());
Index: sandbox/pellegrin/set/test/p_queue.cc
--- sandbox/pellegrin/set/test/p_queue.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_queue.cc (working copy)
@@ -44,14 +44,14 @@
.push(make::point2d(6, 9))
.push(make::point2d(5, 1))
.push(make::point2d(4, 2));
- mln_assertion(q.npoints() == 3);
+ mln_assertion(q.nsites() == 3);
std::cout << q.bbox() << std::endl;
std::cout << q << std::endl;
q.pop();
- mln_assertion(q.npoints() == 2);
+ mln_assertion(q.nsites() == 2);
point2d p = q.front();
- mln_assertion(q.npoints() == 2);
+ mln_assertion(q.nsites() == 2);
mln_assertion(p == make::point2d(5, 1));
}
Index: sandbox/pellegrin/set/test/p_priority_queue.cc
--- sandbox/pellegrin/set/test/p_priority_queue.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_priority_queue.cc (working copy)
@@ -44,7 +44,7 @@
mln_assertion (q.is_empty ());
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
q.push_force (p3);
q.push_force (p1, 3);
@@ -59,7 +59,7 @@
mln_assertion (q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 3);
+ mln_assertion (q.nsites () == 3);
mln_assertion (q.front () == p2);
q.pop ();
@@ -67,7 +67,7 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 2);
+ mln_assertion (q.nsites () == 2);
mln_assertion (q.front () == p1);
q.pop ();
@@ -75,14 +75,14 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 1);
+ mln_assertion (q.nsites () == 1);
mln_assertion (q.front () == p3);
q.pop ();
mln_assertion (!q.has (p1));
mln_assertion (!q.has (p2));
mln_assertion (!q.has (p3));
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
mln_assertion (q.is_empty ());
Index: sandbox/pellegrin/set/test/p_runs.cc
--- sandbox/pellegrin/set/test/p_runs.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_runs.cc (working copy)
@@ -61,10 +61,10 @@
p_runs_<point2d> ps2;
ps.insert(p_run<point2d>(p, 7));
- mln_assertion(ps.npoints() == 7);
+ mln_assertion(ps.nsites() == 7);
ps.insert(p_run<point2d>(q, 5));
- mln_assertion(ps.npoints() == 12);
+ mln_assertion(ps.nsites() == 12);
ps.insert(p_run<point2d>(r, 2));
Index: sandbox/pellegrin/set/test/pset_if.cc
--- sandbox/pellegrin/set/test/pset_if.cc (revision 2233)
+++ sandbox/pellegrin/set/test/pset_if.cc (working copy)
@@ -43,7 +43,7 @@
using namespace mln;
box2d box_8x8 = make::box2d(8, 8);
- mln_assertion((box_8x8 | fun::p2b::chess).npoints() == 32);
+ mln_assertion((box_8x8 | fun::p2b::chess).nsites() == 32);
{
p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess);
Index: sandbox/pellegrin/set/test/p_set.cc
--- sandbox/pellegrin/set/test/p_set.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_set.cc (working copy)
@@ -47,7 +47,7 @@
.insert(make::point2d(4, 2))
.insert(make::point2d(4, 2))
.insert(make::point2d(5, 1));
- mln_assertion(ps.npoints() == 3);
+ mln_assertion(ps.nsites() == 3);
std::cout << ps.bbox() << std::endl;
Index: sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc
--- sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc (revision 2233)
+++ sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc (working copy)
@@ -43,19 +43,19 @@
point2d p3 (4, 2);
mln_assertion (q.is_empty ());
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
q.push_force (p3);
mln_assertion (!q.is_empty ());
- mln_assertion (q.npoints () == 1);
+ mln_assertion (q.nsites () == 1);
q.push_force (p1, 3);
mln_assertion (!q.is_empty ());
- mln_assertion (q.npoints () == 2);
+ mln_assertion (q.nsites () == 2);
q.push_force (p2, 5);
mln_assertion (!q.is_empty ());
- mln_assertion (q.npoints () == 3);
+ mln_assertion (q.nsites () == 3);
std::cout << q.bbox () << std::endl;
std::cout << q << std::endl;
@@ -66,7 +66,7 @@
mln_assertion (q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 3);
+ mln_assertion (q.nsites () == 3);
mln_assertion (q.front () == p2);
q.pop ();
@@ -74,7 +74,7 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 2);
+ mln_assertion (q.nsites () == 2);
mln_assertion (q.front () == p1);
q.pop ();
@@ -82,14 +82,14 @@
mln_assertion (!q.has (p2));
mln_assertion (q.has (p3));
- mln_assertion (q.npoints () == 1);
+ mln_assertion (q.nsites () == 1);
mln_assertion (q.front () == p3);
q.pop ();
mln_assertion (!q.has (p1));
mln_assertion (!q.has (p2));
mln_assertion (!q.has (p3));
- mln_assertion (q.npoints () == 0);
+ mln_assertion (q.nsites () == 0);
mln_assertion (q.is_empty ());
Index: sandbox/pellegrin/set/core/p_priority_queue_fast.hh
--- sandbox/pellegrin/set/core/p_priority_queue_fast.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_priority_queue_fast.hh (working copy)
@@ -75,7 +75,7 @@
* \todo Make it work with P being a Point_Site.
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P, typename T>
class p_priority_fast : public internal::point_set_base_< P, p_priority_fast<P, T> >
@@ -98,7 +98,7 @@
bool is_empty() const;
/// Give the number of points.
- size_t npoints() const;
+ size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -163,7 +163,7 @@
p_priority_fast<P, T>::vect_update_() const
{
vect_.clear();
- vect_.reserve(npoints());
+ vect_.reserve(nsites());
typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin ();
@@ -183,7 +183,7 @@
typename std::map<T, p_queue_fast<P> >::const_iterator it = q_.begin ();
for (; it != q_.end (); ++it)
- for (unsigned i = 0; i < (*it).second.npoints (); ++i)
+ for (unsigned i = 0; i < (*it).second.nsites (); ++i)
bb_.take((*it).second[i]);
bb_needs_update_ = false;
}
@@ -218,7 +218,7 @@
template <typename P, typename T>
inline
size_t
- p_priority_fast<P, T>::npoints() const
+ p_priority_fast<P, T>::nsites() const
{
unsigned res = 0;
@@ -226,7 +226,7 @@
for (; it != q_.end (); ++it)
if (!(*it).second.is_empty ())
- res += (*it).second.npoints();
+ res += (*it).second.nsites();
return res;
}
@@ -235,7 +235,7 @@
const box_<P>&
p_priority_fast<P, T>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -339,7 +339,7 @@
const P&
p_priority_fast<P, T>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
typename std::map<T, p_queue_fast<P> >::const_reverse_iterator it = q_.rbegin ();
unsigned cpt = 0;
@@ -347,7 +347,7 @@
for (; it != q_.rend (); ++it)
{
if (!(*it).second.is_empty ())
- for (cpt = 0; cpt < (*it).second.npoints (); ++cpt)
+ for (cpt = 0; cpt < (*it).second.nsites (); ++cpt)
{
if (i == 0)
return (*it).second[cpt];
Index: sandbox/pellegrin/set/core/p_bgraph.hh
--- sandbox/pellegrin/set/core/p_bgraph.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_bgraph.hh (working copy)
@@ -92,7 +92,7 @@
p_bgraph (graph* gr);
/// Return The number of points (i.e., nodes) in the graph.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of lines (i.e., edges) in the graph.
std::size_t nlines() const;
@@ -145,7 +145,7 @@
template<typename P>
inline
std::size_t
- p_bgraph<P>::npoints() const
+ p_bgraph<P>::nsites() const
{
return boost::num_vertices(*gr_);
}
@@ -175,7 +175,7 @@
// Check whether P is compatible with this psite set.
(&p.pg() == this) &&
// Check that the node id of P belongs to the range of valid node ids.
- (p.id() < this->npoints());
+ (p.id() < this->nsites());
}
Index: sandbox/pellegrin/set/core/p_run.hh
--- sandbox/pellegrin/set/core/p_run.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_run.hh (working copy)
@@ -90,7 +90,7 @@
bool has(const P& p) const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the length of the run.
std::size_t length() const;
@@ -110,7 +110,7 @@
protected:
accu::bbox<P> bb_;
- // FIXME: Add invariant bb_.is_valid() <=> npoints() != 0
+ // FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
/// The first point of the run.
P p_;
@@ -186,7 +186,7 @@
template <typename P>
inline
std::size_t
- p_run<P>::npoints() const
+ p_run<P>::nsites() const
{
mln_precondition(is_valid_);
return len_;
@@ -207,7 +207,7 @@
p_run<P>::operator[](unsigned i) const
{
mln_precondition(is_valid_);
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
P p = p_;
p[P::dim - 1] += i;
return p;
@@ -227,7 +227,7 @@
p_run<P>::bbox() const
{
mln_precondition(is_valid_);
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
return bb_.to_result();
}
Index: sandbox/pellegrin/set/core/p_line_graph.hh
--- sandbox/pellegrin/set/core/p_line_graph.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_line_graph.hh (working copy)
@@ -93,7 +93,7 @@
typedef p_line_graph_piter_<P> bkd_piter;
/// Return The number of points (i.e., nodes) in the graph.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of lines (i.e., edges) in the graph.
std::size_t nlines() const;
@@ -137,7 +137,7 @@
template<typename P>
inline
std::size_t
- p_line_graph<P>::npoints() const
+ p_line_graph<P>::nsites() const
{
return this->gr_.nnodes();
}
Index: sandbox/pellegrin/set/core/pset_if.hh
--- sandbox/pellegrin/set/core/pset_if.hh (revision 2233)
+++ sandbox/pellegrin/set/core/pset_if.hh (working copy)
@@ -105,7 +105,7 @@
const box_<mln_point(S)>& bbox() const;
/// Give the number of points of the subset.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the primary overset.
const S& overset() const;
@@ -210,7 +210,7 @@
template <typename S, typename F>
std::size_t
- p_if<S,F>::npoints() const
+ p_if<S,F>::nsites() const
{
std::size_t n = 0;
fwd_piter p(*this);
Index: sandbox/pellegrin/set/core/p_array.hh
--- sandbox/pellegrin/set/core/p_array.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_array.hh (working copy)
@@ -65,7 +65,7 @@
* This is a multi-set of points.
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints(). FIXME: Explain!
+ * a call to nsites(). FIXME: Explain!
*
* \todo Make it work with P being a Point_Site.
*/
@@ -93,7 +93,7 @@
bool has(const P& p) const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -120,7 +120,7 @@
mutable bool bb_needs_update_;
void update_bb_() const;
- // FIXME: Add invariant bb_.is_valid() <=> npoints() != 0
+ // FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
@@ -183,7 +183,7 @@
template <typename P>
inline
std::size_t
- p_array<P>::npoints() const
+ p_array<P>::nsites() const
{
return vect_.size();
}
@@ -193,7 +193,7 @@
const box_<P>&
p_array<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
update_bb_();
return bb_.to_result();
@@ -232,7 +232,7 @@
const P&
p_array<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return vect_[i];
}
Index: sandbox/pellegrin/set/core/concept/point_set.hh
--- sandbox/pellegrin/set/core/concept/point_set.hh (revision 2233)
+++ sandbox/pellegrin/set/core/concept/point_set.hh (working copy)
@@ -77,7 +77,7 @@
bool has(const psite& p) const;
const box_<point>& bbox() const;
- std::size_t npoints() const;
+ std::size_t nsites() const;
*/
protected:
@@ -157,7 +157,7 @@
m1 = 0;
const box_<point>& (E::*m2)() const = & E::bbox;
m2 = 0;
- std::size_t (E::*m3)() const = & E::npoints;
+ std::size_t (E::*m3)() const = & E::nsites;
m3 = 0;
}
@@ -174,7 +174,7 @@
const Sr& rhs = exact(rhs_);
// easy test:
- if (lhs.npoints() != rhs.npoints())
+ if (lhs.nsites() != rhs.nsites())
return false;
// exhaustive test:
@@ -201,7 +201,7 @@
const Sr& rhs = exact(rhs_);
// easy test:
- if (lhs.npoints() > rhs.npoints())
+ if (lhs.nsites() > rhs.nsites())
return false;
// exhaustive test:
@@ -221,7 +221,7 @@
// FIXME: Same grid!
const Sl& lhs = exact(lhs_);
const Sr& rhs = exact(rhs_);
- return lhs <= rhs && lhs.npoints() != rhs.npoints();
+ return lhs <= rhs && lhs.nsites() != rhs.nsites();
}
Index: sandbox/pellegrin/set/core/p_queue.hh
--- sandbox/pellegrin/set/core/p_queue.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_queue.hh (working copy)
@@ -73,7 +73,7 @@
* (i.e., no-op if multiple or allow multiple insertions).
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P>
class p_queue : public internal::point_set_base_< P, p_queue<P> >
@@ -96,7 +96,7 @@
bool is_empty() const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -200,7 +200,7 @@
template <typename P>
inline
std::size_t
- p_queue<P>::npoints() const
+ p_queue<P>::nsites() const
{
return q_.size();
}
@@ -210,7 +210,7 @@
const box_<P>&
p_queue<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -299,7 +299,7 @@
const P&
p_queue<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return q_[i];
}
Index: sandbox/pellegrin/set/core/p_priority_queue.hh
--- sandbox/pellegrin/set/core/p_priority_queue.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_priority_queue.hh (working copy)
@@ -75,7 +75,7 @@
* \todo Make it work with P being a Point_Site.
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P, typename T>
class p_priority : public internal::point_set_base_< P, p_priority<P, T> >
@@ -98,7 +98,7 @@
bool is_empty() const;
/// Give the number of points.
- size_t npoints() const;
+ size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -163,7 +163,7 @@
p_priority<P, T>::vect_update_() const
{
vect_.clear();
- vect_.reserve(npoints());
+ vect_.reserve(nsites());
typename std::map<T, p_queue<P> >::const_iterator it = q_.begin ();
@@ -183,7 +183,7 @@
typename std::map<T, p_queue<P> >::const_iterator it = q_.begin ();
for (; it != q_.end (); ++it)
- for (unsigned i = 0; i < (*it).second.npoints (); ++i)
+ for (unsigned i = 0; i < (*it).second.nsites (); ++i)
bb_.take((*it).second[i]);
bb_needs_update_ = false;
}
@@ -218,7 +218,7 @@
template <typename P, typename T>
inline
size_t
- p_priority<P, T>::npoints() const
+ p_priority<P, T>::nsites() const
{
unsigned res = 0;
@@ -226,7 +226,7 @@
for (; it != q_.end (); ++it)
if (!(*it).second.is_empty ())
- res += (*it).second.npoints();
+ res += (*it).second.nsites();
return res;
}
@@ -235,7 +235,7 @@
const box_<P>&
p_priority<P, T>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -339,7 +339,7 @@
const P&
p_priority<P, T>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
typename std::map<T, p_queue<P> >::const_reverse_iterator it = q_.rbegin ();
unsigned cpt = 0;
@@ -347,7 +347,7 @@
for (; it != q_.rend (); ++it)
{
if (!(*it).second.is_empty ())
- for (cpt = 0; cpt < (*it).second.npoints (); ++cpt)
+ for (cpt = 0; cpt < (*it).second.nsites (); ++cpt)
{
if (i == 0)
return (*it).second[cpt];
Index: sandbox/pellegrin/set/core/p_runs.hh
--- sandbox/pellegrin/set/core/p_runs.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_runs.hh (working copy)
@@ -88,7 +88,7 @@
const box_<P>& bbox() const;
/// Give the number of points.
- typename std::size_t npoints() const;
+ typename std::size_t nsites() const;
/// Insert a range, start at point \p p wit len \p len.
void insert(const p_run<P>& pr);
@@ -114,7 +114,7 @@
protected:
/// Number of points.
- typename std::size_t npoints_;
+ typename std::size_t nsites_;
/// Points container
util::lazy_set_<p_run<P> > con_;
@@ -128,7 +128,7 @@
template <typename P>
inline
p_runs_<P>::p_runs_() :
- npoints_(0)
+ nsites_(0)
{
}
@@ -155,9 +155,9 @@
template <typename P>
inline
typename std::size_t
- p_runs_<P>::npoints() const
+ p_runs_<P>::nsites() const
{
- return npoints_;
+ return nsites_;
}
template <typename P>
@@ -198,7 +198,7 @@
fb_.take(pr.bbox().pmin());
fb_.take(pr.bbox().pmax());
// update size
- npoints_ += pr.npoints();
+ nsites_ += pr.nsites();
}
template <typename P>
Index: sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh
--- sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh (working copy)
@@ -75,7 +75,7 @@
* \todo Make it work with P being a Point_Site.
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P, typename T, unsigned S>
class p_priority_fast_with_array : public internal::point_set_base_< P, p_priority_fast_with_array<P, T, S> >
@@ -98,7 +98,7 @@
bool is_empty() const;
/// Give the number of points.
- unsigned npoints() const;
+ unsigned nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -168,7 +168,7 @@
p_priority_fast_with_array<P, T, S>::vect_update_() const
{
vect_.clear();
- vect_.reserve(npoints());
+ vect_.reserve(nsites());
for (unsigned i = 0; i < S; ++i)
std::copy(q_[i].vect().begin(), q_[i].vect().end(),
@@ -184,7 +184,7 @@
bb_.init();
for (unsigned i = 0; i < S; ++i)
- for (unsigned j = 0; j < q_[i].npoints (); ++j)
+ for (unsigned j = 0; j < q_[i].nsites (); ++j)
bb_.take(q_[i][j]);
bb_needs_update_ = false;
}
@@ -215,13 +215,13 @@
template <typename P, typename T, unsigned S>
inline
unsigned
- p_priority_fast_with_array<P, T, S>::npoints() const
+ p_priority_fast_with_array<P, T, S>::nsites() const
{
unsigned res = 0;
for (unsigned i = 0; i < S; ++i)
if (!q_[i].is_empty ())
- res += q_[i].npoints();
+ res += q_[i].nsites();
return res;
}
@@ -231,7 +231,7 @@
const box_<P>&
p_priority_fast_with_array<P, T, S>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -330,13 +330,13 @@
const P&
p_priority_fast_with_array<P, T, S>::operator[](unsigned n) const
{
- mln_precondition(n < npoints());
+ mln_precondition(n < nsites());
unsigned i = S - 1;
unsigned cpt = 0;
for (; i != UINT_MAX; --i)
if (!q_[i].is_empty ())
- for (cpt = 0; cpt < q_[i].npoints (); ++cpt, --n)
+ for (cpt = 0; cpt < q_[i].nsites (); ++cpt, --n)
if (n == 0)
return q_[i][cpt];
mln_assertion (false);
Index: sandbox/pellegrin/set/core/p_set.hh
--- sandbox/pellegrin/set/core/p_set.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_set.hh (working copy)
@@ -89,7 +89,7 @@
using super_::vect;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Insert a point \p p.
p_set<P>& insert(const P& p);
@@ -110,7 +110,7 @@
protected:
accu::bbox<P> bb_;
- // FIXME: Add invariant bb_.is_valid() <=> npoints() != 0
+ // FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
@@ -133,7 +133,7 @@
template <typename P>
inline
std::size_t
- p_set<P>::npoints() const
+ p_set<P>::nsites() const
{
return this->super_::nelements();
}
@@ -165,7 +165,7 @@
const P&
p_set<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return this->super_::element(i);
}
@@ -183,7 +183,7 @@
const box_<mln_point(P)>&
p_set<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
return bb_.to_result();
}
Index: sandbox/pellegrin/set/core/line2d.hh
--- sandbox/pellegrin/set/core/line2d.hh (revision 2233)
+++ sandbox/pellegrin/set/core/line2d.hh (working copy)
@@ -81,7 +81,7 @@
bool has(const point2d& p) const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<point2d>& bbox() const;
@@ -177,7 +177,7 @@
inline
std::size_t
- line2d::npoints() const
+ line2d::nsites() const
{
return vect_.size();
}
@@ -200,7 +200,7 @@
const point2d&
line2d::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return vect_[i];
}
Index: sandbox/pellegrin/set/core/internal/multi_set.hh
--- sandbox/pellegrin/set/core/internal/multi_set.hh (revision 2233)
+++ sandbox/pellegrin/set/core/internal/multi_set.hh (working copy)
@@ -70,7 +70,7 @@
using super_::vect;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Insert a point \p p.
multi_set<P>& insert(const P& p);
@@ -91,7 +91,7 @@
protected:
accu::bbox<P> bb_;
- // FIXME: Add invariant bb_.is_valid() <=> npoints() != 0
+ // FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
@@ -114,7 +114,7 @@
template <typename P>
inline
std::size_t
- multi_set<P>::npoints() const
+ multi_set<P>::nsites() const
{
return this->super_::nelements();
}
@@ -146,7 +146,7 @@
const P&
multi_set<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return this->super_::element(i);
}
@@ -164,7 +164,7 @@
const box_<mln_point(P)>&
multi_set<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
return bb_.to_result();
}
Index: sandbox/pellegrin/set/core/internal/uni_set.hh
--- sandbox/pellegrin/set/core/internal/uni_set.hh (revision 2233)
+++ sandbox/pellegrin/set/core/internal/uni_set.hh (working copy)
@@ -70,7 +70,7 @@
using super_::vect;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Insert a point \p p.
uni_set<P>& insert(const P& p);
@@ -91,7 +91,7 @@
protected:
accu::bbox<P> bb_;
- // FIXME: Add invariant bb_.is_valid() <=> npoints() != 0
+ // FIXME: Add invariant bb_.is_valid() <=> nsites() != 0
};
@@ -114,7 +114,7 @@
template <typename P>
inline
std::size_t
- uni_set<P>::npoints() const
+ uni_set<P>::nsites() const
{
return this->super_::nelements();
}
@@ -146,7 +146,7 @@
const P&
uni_set<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return this->super_::element(i);
}
@@ -164,7 +164,7 @@
const box_<mln_point(P)>&
uni_set<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
return bb_.to_result();
}
Index: sandbox/pellegrin/set/core/p_graph.hh
--- sandbox/pellegrin/set/core/p_graph.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_graph.hh (working copy)
@@ -78,7 +78,7 @@
typedef p_graph_piter_<P> bkd_piter;
/// Return The number of points (i.e., nodes) in the graph.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Return The number of lines (i.e., edges) in the graph.
std::size_t nlines() const;
@@ -131,7 +131,7 @@
// FIXME: Warning: if the underlying graph is updated later, this
// won't be taken into account by this p_graph!
accu::bbox<P> a;
- for (unsigned i = 0; i < npoints(); ++i)
+ for (unsigned i = 0; i < nsites(); ++i)
a.take(gr_.node_data(i));
bb_ = a.to_result();
}
@@ -141,7 +141,7 @@
template<typename P>
inline
std::size_t
- p_graph<P>::npoints() const
+ p_graph<P>::nsites() const
{
return this->gr_.nnodes();
}
@@ -221,8 +221,8 @@
{
// FIXME: Likewise, this is inefficient.
- assert (lhs < this->npoints());
- assert (rhs < this->npoints());
+ assert (lhs < this->nsites());
+ assert (rhs < this->nsites());
if (rhs == lhs)
return true;
Index: sandbox/pellegrin/set/core/p_queue_fast.hh
--- sandbox/pellegrin/set/core/p_queue_fast.hh (revision 2233)
+++ sandbox/pellegrin/set/core/p_queue_fast.hh (working copy)
@@ -72,7 +72,7 @@
* \todo Make it work with P being a Point_Site.
*
* \warning We have some troubles with point set comparison based on
- * a call to npoints() when this container is multiple.
+ * a call to nsites() when this container is multiple.
*/
template <typename P>
class p_queue_fast : public internal::point_set_base_< P, p_queue_fast<P> >
@@ -95,7 +95,7 @@
bool is_empty() const;
/// Give the number of points.
- std::size_t npoints() const;
+ std::size_t nsites() const;
/// Give the exact bounding box.
const box_<P>& bbox() const;
@@ -202,7 +202,7 @@
template <typename P>
inline
std::size_t
- p_queue_fast<P>::npoints() const
+ p_queue_fast<P>::nsites() const
{
mln_precondition(this->end_ >= this->begin_);
return (this->end_ - this->begin_);
@@ -213,7 +213,7 @@
const box_<P>&
p_queue_fast<P>::bbox() const
{
- mln_precondition(npoints() != 0);
+ mln_precondition(nsites() != 0);
if (bb_needs_update_)
bb_update_();
return bb_.to_result();
@@ -306,7 +306,7 @@
const P&
p_queue_fast<P>::operator[](unsigned i) const
{
- mln_precondition(i < npoints());
+ mln_precondition(i < nsites());
return q_[begin_ + i];
}
Index: sandbox/aroumougame/skeleton/test_image3d.cc
--- sandbox/aroumougame/skeleton/test_image3d.cc (revision 2233)
+++ sandbox/aroumougame/skeleton/test_image3d.cc (working copy)
@@ -71,12 +71,12 @@
X_complement.insert(mln::make::point3d(centre, centre, centre));
X_complement.insert(mln::make::point3d(centre+5, centre, centre));
- std::cout << "X "<< X.npoints() << std::endl;
- std::cout << "X_complement "<< X_complement.npoints() << std::endl;
+ std::cout << "X "<< X.nsites() << std::endl;
+ std::cout << "X_complement "<< X_complement.nsites() << std::endl;
X = thinning(X,c6(),X_complement,2000,false);
- for(uint i=0; i<X.npoints(); i++)
+ for(uint i=0; i<X.nsites(); i++)
{
std::cout << X[i] << std::endl;
}
Index: sandbox/aroumougame/skeleton/thinning.hh
--- sandbox/aroumougame/skeleton/thinning.hh (revision 2233)
+++ sandbox/aroumougame/skeleton/thinning.hh (working copy)
@@ -45,15 +45,15 @@
neighbors.insert(q);
}
}
-// std::cout << "nb_composant_connexe: neighbors " << neighbors.npoints() <<std::endl;
- if(neighbors.npoints()<=1)
+// std::cout << "nb_composant_connexe: neighbors " << neighbors.nsites() <<std::endl;
+ if(neighbors.nsites()<=1)
{
- return neighbors.npoints();
+ return neighbors.nsites();
}
else
T=0;
- while(neighbors.npoints()!=0)
+ while(neighbors.nsites()!=0)
{
T++;
done.insert(neighbors[0]);
@@ -67,13 +67,13 @@
}
}
- while(composant.npoints()!=0)
+ while(composant.nsites()!=0)
{
done.insert(composant[0]);
if(neighbors.has(composant[0]))
{
neighbors.remove(composant[0]);
- if(neighbors.npoints()==0)
+ if(neighbors.nsites()==0)
return T;
}
@@ -110,14 +110,14 @@
}
}
- if(neighbors.npoints()<=1)
+ if(neighbors.nsites()<=1)
{
- return neighbors.npoints();
+ return neighbors.nsites();
}
else
T=0;
- while(neighbors.npoints()!=0)
+ while(neighbors.nsites()!=0)
{
T++;
done.insert(neighbors[0]);
@@ -131,13 +131,13 @@
}
}
- while(composant.npoints()!=0)
+ while(composant.nsites()!=0)
{
done.insert(composant[0]);
if(neighbors.has(composant[0]))
{
neighbors.remove(composant[0]);
- if(neighbors.npoints()==0)
+ if(neighbors.nsites()==0)
return T;
}
@@ -262,19 +262,19 @@
p_set<mln_point(N)> Q;
p_set<mln_point(N)> K;
- for(uint i=0; i<X.npoints(); i++)
+ for(uint i=0; i<X.nsites(); i++)
{
if(simple_point(X,nbh,X_complement,X[i],local))
P.insert(X[i]);
}
- while(P.npoints()!=0 && L>0)
+ while(P.nsites()!=0 && L>0)
{
Q.clear();
// FIXME need a method to get the number of neighbor from the neighborhood instead of the 6
for(int t=0; t<6; t++)
{
- for(uint i=0; i <P.npoints(); i++)
+ for(uint i=0; i <P.nsites(); i++)
{
// isthmus1d => X and isthmus2d => X_complement
if(extremity(X,nbh,P[i]))
@@ -301,7 +301,7 @@
P.clear();
L--;
- for(uint i=0; i<Q.npoints(); i++)
+ for(uint i=0; i<Q.nsites(); i++)
{
if(simple_point(X,nbh,X_complement,Q[i],local))
{
@@ -329,11 +329,11 @@
N.insert(p_ref);
}
- while(N.npoints()!=0 && L>0)
+ while(N.nsites()!=0 && L>0)
{
Q.clear();
- for(uint i=0; i <N.npoints(); i++)
+ for(uint i=0; i <N.nsites(); i++)
{
// isthmus1d => type_isthmus = true and isthmus2d => type_isthmus = false
if(extremity(gi,N[i]))
@@ -360,7 +360,7 @@
N.clear();
L--;
- for(uint i=0; i<Q.npoints(); i++)
+ for(uint i=0; i<Q.nsites(); i++)
{
if(simple_point(gi,Q[i],false))
{
@@ -394,7 +394,7 @@
}
}
- for(int i=0; i < neighbors.npoints(); i++)
+ for(int i=0; i < neighbors.nsites(); i++)
{
mln_niter(graph_elt_neighborhood< P >) n(nbh, neighbors[i]);
@@ -408,7 +408,7 @@
}
}
- for(int i=0; i < composant.npoints(); i++)
+ for(int i=0; i < composant.nsites(); i++)
{
mln_niter(graph_elt_neighborhood< P >) n(nbh, composant[i]);
@@ -442,14 +442,14 @@
}
}
- if(neighbors.npoints()<=1)
+ if(neighbors.nsites()<=1)
{
- return neighbors.npoints();
+ return neighbors.nsites();
}
else
T=0;
- while(neighbors.npoints()!=0)
+ while(neighbors.nsites()!=0)
{
T++;
done.insert(neighbors[0]);
@@ -463,13 +463,13 @@
}
}
- while(composant.npoints()!=0)
+ while(composant.nsites()!=0)
{
done.insert(composant[0]);
if(neighbors.has(composant[0]))
{
neighbors.remove(composant[0]);
- if(neighbors.npoints()==0)
+ if(neighbors.nsites()==0)
return T;
}
@@ -518,17 +518,17 @@
p_set< graph_psite<N> > Q;
p_set< graph_psite<N> > K;
- for(uint i=0; i<X.npoints(); i++)
+ for(uint i=0; i<X.nsites(); i++)
{
if(simple_point(X,X_complement,X[i],local))
P.insert(X[i]);
}
- while(P.npoints()!=0 && L>0)
+ while(P.nsites()!=0 && L>0)
{
Q.clear();
- for(uint i=0; i <P.npoints(); i++)
+ for(uint i=0; i <P.nsites(); i++)
{
// isthmus1d => X and isthmus2d => X_complement
// if(isthmus(X,P[i],local))
@@ -556,7 +556,7 @@
P.clear();
L--;
- for(uint i=0; i<Q.npoints(); i++)
+ for(uint i=0; i<Q.nsites(); i++)
{
if(simple_point(X,X_complement,Q[i],local))
{
@@ -576,7 +576,7 @@
std::vector< std::pair< double, mln::point2d> > R;
// fill Q
- for(uint i = 0; i < X.npoints(); i++)
+ for(uint i = 0; i < X.nsites(); i++)
{
if (!Y.has(X[i]))
{
@@ -586,7 +586,7 @@
}
// fill R
- for(uint i = 0; i < X.npoints(); i++)
+ for(uint i = 0; i < X.nsites(); i++)
{
if (!Y.has(X[i]))
{
@@ -732,11 +732,11 @@
image2d<value::int_u8> bisector(h, w);
level::fill(bisector, 0);
- for(uint i=0; i<Y.npoints(); i++)
+ for(uint i=0; i<Y.nsites(); i++)
{
proj = EP(dt, Y[i], lut, nbh);
- int n=proj.npoints();
+ int n=proj.nsites();
if(n>1)
{
@@ -776,7 +776,7 @@
{
std::vector< std::pair< double, mln::point2d> > Q;
// fill Q
- for(uint i = 0; i < X.npoints(); i++)
+ for(uint i = 0; i < X.nsites(); i++)
{
if (!Y.has(X[i]))
{
@@ -891,7 +891,7 @@
mln::io::pgm::save(pic1, "bisector.pgm");
uint cpt=0;
- while(cpt!=Y.npoints())
+ while(cpt!=Y.nsites())
{
if(dt(Y[cpt])>=r && pic1(Y[cpt])>=alpha)
{
@@ -934,7 +934,7 @@
std::vector< std::pair< double, pt_t > > Q;
graph_elt_neighborhood<P> nbh;
// fill Q
- for(uint i = 0; i < X.npoints(); i++)
+ for(uint i = 0; i < X.nsites(); i++)
{
if (!Y.has(X[i]))
{
@@ -954,7 +954,7 @@
{
X.remove(tmp);
X_complement.insert(tmp);
-// std::cout << Y.npoints() << std::endl;
+// std::cout << Y.nsites() << std::endl;
mln_niter(graph_elt_neighborhood< P >) r(nbh, tmp);
for_all(r)
{
Index: sandbox/nivault/plugin-gimp/src/gimp-image.hh
--- sandbox/nivault/plugin-gimp/src/gimp-image.hh (revision 2233)
+++ sandbox/nivault/plugin-gimp/src/gimp-image.hh (working copy)
@@ -393,7 +393,7 @@
gimp_image<t>::nelements() const
{
mln_precondition(this->has_data());
- return this->data_->b_.npoints();
+ return this->data_->b_.nsites();
}
Index: sandbox/jardonnet/test/icp_ref.cc
--- sandbox/jardonnet/test/icp_ref.cc (revision 2233)
+++ sandbox/jardonnet/test/icp_ref.cc (working copy)
@@ -72,23 +72,23 @@
std::cout << "Pts processed = " << registration::pts << std::endl;
#endif
- qk.apply_on(c, c, c.npoints());
+ qk.apply_on(c, c, c.nsites());
image2d<value::rgb8> output(convert::to_box2d(working_box), 1);
level::fill(output, literal::white);
/* FIXME: remove or plot mu_Ck and mu_Xk
//plot mu_Ck
- point3df mu_Ck = registration::center(c, c.npoints());
+ point3df mu_Ck = registration::center(c, c.nsites());
draw::plot(output, point2d(mu_Ck[0], mu_Ck[1]), literal::green);
//plot mu_X
- point3df mu_X = registration::center(x, x.npoints());
+ point3df mu_X = registration::center(x, x.nsites());
draw::plot(output, point2d(mu_X[0], mu_X[1]), literal::black);
*/
//to 2d : projection (FIXME:if 3d)
- for (unsigned i = 0; i < c.npoints(); i++)
+ for (unsigned i = 0; i < c.nsites(); i++)
{
point2d p(c[i][0], c[i][1]);
if (output.has(p))
@@ -96,7 +96,7 @@
}
//ref image (black)
- for (unsigned i = 0; i < x.npoints(); i++)
+ for (unsigned i = 0; i < x.nsites(); i++)
{
point2d px(x[i][0], x[i][1]);
if (output.has(px))
Index: sandbox/jardonnet/test/icp.cc
--- sandbox/jardonnet/test/icp.cc (revision 2233)
+++ sandbox/jardonnet/test/icp.cc (working copy)
@@ -62,7 +62,7 @@
std::cout << "Pts processed = " << registration::pts << std::endl;
#endif
- qk.apply_on(c, c, c.npoints());
+ qk.apply_on(c, c, c.nsites());
float stddev, mean;
registration::mean_stddev(c, map, mean, stddev);
@@ -72,14 +72,14 @@
std::cout << "stddev : " << stddev << std::endl;
#endif
- std::vector<float> length(c.npoints());
- for (size_t i = 0; i < c.npoints(); i++)
+ std::vector<float> length(c.nsites());
+ for (size_t i = 0; i < c.nsites(); i++)
length[i] = norm::l2(algebra::vec<3,int> (c[i] - map(c[i])));
// final transform
quat7<3> fqk = registration::final_qk2(c, map, 2*stddev);
- fqk.apply_on(c, c, c.npoints());
+ fqk.apply_on(c, c, c.nsites());
//init output image
@@ -88,7 +88,7 @@
//print x
- for (size_t i = 0; i < x.npoints(); i++)
+ for (size_t i = 0; i < x.nsites(); i++)
{
//Xk points
point2d px(x[i][0], x[i][1]);
@@ -98,7 +98,7 @@
//to 2d : projection (FIXME:if 3d)
- for (size_t i = 0; i < c.npoints(); i++)
+ for (size_t i = 0; i < c.nsites(); i++)
{
//Ck points
point2d p(c[i][0], c[i][1]);
Index: sandbox/jardonnet/registration/final_qk.hh
--- sandbox/jardonnet/registration/final_qk.hh (revision 2233)
+++ sandbox/jardonnet/registration/final_qk.hh (working copy)
@@ -14,22 +14,22 @@
float& stddev)
{
//mean + length
- std::vector<float> length(c.npoints());
+ std::vector<float> length(c.nsites());
mean = 0;
- for (size_t i = 0; i < c.npoints(); i++)
+ for (size_t i = 0; i < c.nsites(); i++)
{
float f = norm::l2(algebra::vec<3,int> (c[i] - map(c[i])));
length[i] = f;
mean += f;
}
- mean /= c.npoints();
+ mean /= c.nsites();
//standar variation
stddev = 0;
- for (size_t i = 0; i < c.npoints(); i++)
+ for (size_t i = 0; i < c.nsites(); i++)
stddev += (length[i] - mean) * (length[i] - mean);
- stddev /= c.npoints();
+ stddev /= c.nsites();
stddev = math::sqrt(stddev);
}
@@ -44,7 +44,7 @@
p_array<P> newc;
algebra::vec<3,float> mu_newc(literal::zero);
- for (size_t i = 0; i < c.npoints(); ++i)
+ for (size_t i = 0; i < c.nsites(); ++i)
{
algebra::vec<3,float> ci = c[i];
algebra::vec<3,float> xki = map(c[i]);
@@ -55,11 +55,11 @@
mu_newc += ci;
}
}
- if (newc.npoints() == 0)
+ if (newc.nsites() == 0)
return quat7<P::dim>();
- mu_newc /= newc.npoints();
+ mu_newc /= newc.nsites();
- quat7<P::dim> qk = match(newc, mu_newc, newc, map, newc.npoints());
+ quat7<P::dim> qk = match(newc, mu_newc, newc, map, newc.nsites());
//qk._qT = - qk._qT; // FIXME : why?
@@ -78,7 +78,7 @@
algebra::vec<3,float> mu_C(literal::zero);
float nb_point = 0;
- for (size_t i = 0; i < c.npoints(); ++i)
+ for (size_t i = 0; i < c.nsites(); ++i)
{
algebra::vec<3,float> xki = map(c[i]);
algebra::vec<3,float> ci = c[i];
Index: sandbox/jardonnet/registration/cov.hh
--- sandbox/jardonnet/registration/cov.hh (revision 2233)
+++ sandbox/jardonnet/registration/cov.hh (working copy)
@@ -53,7 +53,7 @@
cov(const p_array<P>& a1,
const p_array<P>& a2)
{
- mln_precondition(a1.npoints() == a2.npoints());
+ mln_precondition(a1.nsites() == a2.nsites());
//centers of mass
algebra::vec<P::dim,float> mu_a1 = math::exp_value(a1);
@@ -61,7 +61,7 @@
//covariance matrix
algebra::mat<P::dim,P::dim,float> Mk(literal::zero);
- for (unsigned i = 0; i < a1.npoints(); ++i)
+ for (unsigned i = 0; i < a1.nsites(); ++i)
{
// FIXME: ugly cast.
algebra::vec<P::dim,float> a1i = a1[i];
@@ -69,7 +69,7 @@
Mk += make::mat(a1i - mu_a1) * trans(make::mat(a2i - mu_a2));
}
- return Mk / a1.npoints();
+ return Mk / a1.nsites();
}
# endif // ! MLN_INCLUDE_ONLY
Index: sandbox/jardonnet/registration/exp_val.hh
--- sandbox/jardonnet/registration/exp_val.hh (revision 2233)
+++ sandbox/jardonnet/registration/exp_val.hh (working copy)
@@ -53,18 +53,18 @@
algebra::vec<P::dim,float>
exp_value(const p_array<P>& a)
{
- if (a.npoints() == 0)
+ if (a.nsites() == 0)
return P();
algebra::vec<P::dim,float> c(literal::zero);
- for (unsigned i = 0; i < a.npoints(); ++i)
+ for (unsigned i = 0; i < a.nsites(); ++i)
{
// FIXME : Ugly.
algebra::vec<P::dim,float> ai = a[i];
c += ai;
}
- return c / a.npoints();
+ return c / a.nsites();
}
# endif // ! MLN_INCLUDE_ONLY
Index: sandbox/jardonnet/registration/save.hh
--- sandbox/jardonnet/registration/save.hh (revision 2233)
+++ sandbox/jardonnet/registration/save.hh (working copy)
@@ -53,7 +53,7 @@
//build ck: apply transform
p_array<P> ck(c);
- qk.apply_on(c, ck, c.npoints());
+ qk.apply_on(c, ck, c.nsites());
const box_<P> working_box = enlarge(bigger(ck.bbox(),x.bbox()),5);
image2d<value::rgb8> out(convert::to_box2d(working_box), 1);
@@ -72,7 +72,7 @@
//build xk : project ck
p_array<P> xk;
- for (unsigned i = 0; i < ck.npoints(); ++i)
+ for (unsigned i = 0; i < ck.nsites(); ++i)
xk.append(map(ck[i]));
//plot mu_Xk
@@ -87,7 +87,7 @@
literal::red);
//x in black
- for (unsigned i = 0; i < x.npoints(); i++)
+ for (unsigned i = 0; i < x.nsites(); i++)
{
point2d p(x[i][0], x[i][1]);
if (out.has(p))
@@ -95,7 +95,7 @@
}
//xk in red
- for (unsigned i = 0; i < xk.npoints(); i++)
+ for (unsigned i = 0; i < xk.nsites(); i++)
{
point2d p(xk[i][0], xk[i][1]);
if (out.has(p))
@@ -103,7 +103,7 @@
}
//ck in green
- for (unsigned i = 0; i < ck.npoints(); i++)
+ for (unsigned i = 0; i < ck.nsites(); i++)
{
point2d p(ck[i][0], ck[i][1]);
if (out.has(p))
Index: sandbox/jardonnet/registration/tools.hh
--- sandbox/jardonnet/registration/tools.hh (revision 2233)
+++ sandbox/jardonnet/registration/tools.hh (working copy)
@@ -23,9 +23,9 @@
template <typename P>
void shuffle(p_array<P>& a)
{
- for (unsigned int i = 0; i < a.npoints(); i++)
+ for (unsigned int i = 0; i < a.nsites(); i++)
{
- unsigned int r = rand() % a.npoints();
+ unsigned int r = rand() % a.nsites();
P tmp;
tmp = a[i];
a.hook_()[i] = a[r];
@@ -92,7 +92,7 @@
algebra::vec<P::dim,float> Cki = Ck;
algebra::vec<P::dim,float> best_x = X[0];
float best_d = norm::l2(Cki - best_x);
- for (size_t j = 1; j < X.npoints(); ++j)
+ for (size_t j = 1; j < X.nsites(); ++j)
{
algebra::vec<P::dim,float> Xj = X[j];
float d = norm::l2(Cki - Xj);
@@ -231,7 +231,7 @@
to_image2d(const p_array<P>& a)
{
image2d<bool> output (to_box2d(a.bbox()), 0);
- for (size_t i = 0; i < a.npoints(); i++)
+ for (size_t i = 0; i < a.nsites(); i++)
{
point2d p(a[i][0], a[i][1]);
if (output.has(p))
Index: sandbox/jardonnet/registration/quat7.hh
--- sandbox/jardonnet/registration/quat7.hh (revision 2233)
+++ sandbox/jardonnet/registration/quat7.hh (working copy)
@@ -64,8 +64,8 @@
p_array<P>& output,
const size_t c_length) const
{
- assert(c_length <= input.npoints());
- assert(c_length <= output.npoints());
+ assert(c_length <= input.nsites());
+ assert(c_length <= output.nsites());
assert(_qR.is_unit());
for (size_t i = 0; i < c_length; i++)
Index: sandbox/jardonnet/registration/cloud.hh
--- sandbox/jardonnet/registration/cloud.hh (revision 2233)
+++ sandbox/jardonnet/registration/cloud.hh (working copy)
@@ -21,18 +21,18 @@
template <typename P>
P center(const p_array<P>& a)
{
- if (a.npoints() == 0)
+ if (a.nsites() == 0)
return P();
algebra::vec<P::dim,float> c(literal::zero);
- for (unsigned i = 0; i < a.npoints(); ++i)
+ for (unsigned i = 0; i < a.nsites(); ++i)
{
// FIXME : Ugly.
algebra::vec<P::dim,float> ai = a[i];
c += ai;
}
- return algebra::to_point<P>(c / a.npoints());
+ return algebra::to_point<P>(c / a.nsites());
}
}
@@ -70,7 +70,7 @@
const M& map,
const size_t length)
{
- assert(length <= a1.npoints());
+ assert(length <= a1.nsites());
float f = 0.f;
for (size_t i = 0; i < length; ++i)
@@ -89,7 +89,7 @@
quat7<P::dim>& q1,
quat7<P::dim>& q2)
{
- assert(length <= a1.npoints());
+ assert(length <= a1.nsites());
float f = 0.f;
for (size_t i = 0; i < length; ++i)
Index: sandbox/jardonnet/registration/icp_ref.hh
--- sandbox/jardonnet/registration/icp_ref.hh (revision 2233)
+++ sandbox/jardonnet/registration/icp_ref.hh (working copy)
@@ -169,7 +169,7 @@
trace::entering("registration::icp");
mln_precondition(P::dim == 3);
- mln_precondition(cloud.npoints() != 0);
+ mln_precondition(cloud.nsites() != 0);
shuffle(cloud);
@@ -193,7 +193,7 @@
for (int e = nb_it-1; e >= 0; e--)
{
- size_t l = cloud.npoints() / std::pow(q, e);
+ size_t l = cloud.nsites() / std::pow(q, e);
l = (l<1) ? 1 : l;
impl::icp_(cloud, map, qk, l, x, 1e-3);
Index: sandbox/jardonnet/registration/icp.hh
--- sandbox/jardonnet/registration/icp.hh (revision 2233)
+++ sandbox/jardonnet/registration/icp.hh (working copy)
@@ -172,7 +172,7 @@
trace::entering("registration::icp");
mln_precondition(P::dim == 3);
- mln_precondition(cloud.npoints() != 0);
+ mln_precondition(cloud.nsites() != 0);
// Shuffle cloud
shuffle(cloud);
@@ -200,23 +200,23 @@
for (int e = nb_it-1; e >= 0; e--)
{
- size_t l = cloud.npoints() / std::pow(q, e);
+ size_t l = cloud.nsites() / std::pow(q, e);
l = (l<1) ? 1 : l;
impl::icp_(cloud, map, qk, l, 1e-3);
/*
//remove points
p_array<P> tmp;
- tmp.reserve(cloud.npoints());
- qk.apply_on(cloud,tmp, cloud.npoints());
+ tmp.reserve(cloud.nsites());
+ qk.apply_on(cloud,tmp, cloud.nsites());
float stddev, mean;
mean_stddev(tmp, map, mean, stddev);
- for (unsigned i = 0; i < cloud.npoints(); i++)
+ for (unsigned i = 0; i < cloud.nsites(); i++)
{
algebra::vec<3,float> qci = tmp[i];
algebra::vec<3,float> xi = x[i];
if (norm::l2(qci - xi) < 2 * stddev)
- cloud.hook_()[i] = cloud[(i+1) % cloud.npoints()];
+ cloud.hook_()[i] = cloud[(i+1) % cloud.nsites()];
}
*/
#ifndef NDEBUG
Index: sandbox/jardonnet/registration/projection.hh
--- sandbox/jardonnet/registration/projection.hh (revision 2233)
+++ sandbox/jardonnet/registration/projection.hh (working copy)
@@ -15,11 +15,11 @@
std::pair<T1,T2>& map,
p_array<P>& Xk)
{
- assert(Ck.npoints() == Xk.npoints());
+ assert(Ck.nsites() == Xk.nsites());
float err = 0.f;
- for (size_t i = 0; i < Ck.npoints(); ++i)
+ for (size_t i = 0; i < Ck.nsites(); ++i)
{
//FIXME: bof
if (map.second.has(Ck[i]))
@@ -30,7 +30,7 @@
err += map.first(Ck[i]);
}
}
- return err /= Ck.npoints();
+ return err /= Ck.nsites();
}
template <typename P>
@@ -41,16 +41,16 @@
p_array<P>& Xk,
float& err)
{
- assert(Ck.npoints() == Xk.npoints());
+ assert(Ck.nsites() == Xk.nsites());
err = 0.f;
- for (size_t i = 0; i < Ck.npoints(); ++i)
+ for (size_t i = 0; i < Ck.nsites(); ++i)
{
algebra::vec<P::dim,float> Cki = Ck[i];
algebra::vec<P::dim,float> best_x = X[0];
float best_d = norm::l2(Cki - best_x);
- for (size_t j = 1; j < X.npoints(); ++j)
+ for (size_t j = 1; j < X.nsites(); ++j)
{
algebra::vec<P::dim,float> Xj = X[j];
float d = norm::l2(Cki - Xj);
@@ -63,7 +63,7 @@
Xk.hook_()[i] = algebra::to_point<P>(best_x);
err += best_d;
}
- err /= Ck.npoints();
+ err /= Ck.nsites();
}
@@ -73,7 +73,7 @@
lazy_image<T>& map,
const size_t c_length) // first: closest points, second: is_computed
{
- //assert(Ck.npoints() == Xk.npoints()); //FIXME:
+ //assert(Ck.nsites() == Xk.nsites()); //FIXME:
for (size_t i = 0; i < c_length; ++i)
Xk.hook_()[i] = map(Ck[i]);
Index: sandbox/jardonnet/registration/center.hh
--- sandbox/jardonnet/registration/center.hh (revision 2233)
+++ sandbox/jardonnet/registration/center.hh (working copy)
@@ -49,18 +49,18 @@
inline
P exp_value(const p_array<P>& a)
{
- if (a.npoints() == 0)
+ if (a.nsites() == 0)
return P();
algebra::vec<P::dim,float> c(literal::zero);
- for (unsigned i = 0; i < a.npoints(); ++i)
+ for (unsigned i = 0; i < a.nsites(); ++i)
{
// FIXME : Ugly.
algebra::vec<P::dim,float> ai = a[i];
c += ai;
}
- return algebra::to_point<P>(c / a.npoints());
+ return algebra::to_point<P>(c / a.nsites());
}
# endif // ! MLN_INCLUDE_ONLY
Index: sandbox/geraud/fllt/fllt.hh
--- sandbox/geraud/fllt/fllt.hh (revision 2233)
+++ sandbox/geraud/fllt/fllt.hh (working copy)
@@ -93,7 +93,7 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
std::vector<p_array<P>*> N;
@@ -101,7 +101,7 @@
unsigned root_version;
unsigned deja_vu;
- fllt_node_elt(bool set_id) : npoints(0),
+ fllt_node_elt(bool set_id) : nsites(0),
tagged(false),
set_id(set_id),
root(0) {}
@@ -131,7 +131,7 @@
{
// gN is the min.
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -146,7 +146,7 @@
// gN is the max.
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -162,7 +162,7 @@
{
for (unsigned i = 0; i < 257; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -207,7 +207,7 @@
//std::cout << " Save in " << filename.str() << std::endl;
image2d<value::int_u8> out(is.domain());// = clone(cast_image<value::int_u8>(is));
level::fill(out, 0);
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -653,7 +653,7 @@
// deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -669,7 +669,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -737,7 +737,7 @@
//save_u(u, deja_vu, N_box, in_R, in_N);
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
@@ -774,7 +774,7 @@
current_cc->elt().N.resize(257);
for (unsigned i = 0; i < 257; ++i)
{
- if (N[i]->npoints() > 0)
+ if (N[i]->nsites() > 0)
{
current_cc->elt().N[i] = N[i];
N[i] = new arr_t();
@@ -789,7 +789,7 @@
the_end:
std::cout << " n_step1=" << n_step_1 << " n_step3=" << n_step_3
<< " n_browsed=" << n_browsed
- << " n_browsed/npoints=" << n_browsed / input.domain().npoints()
+ << " n_browsed/nsites=" << n_browsed / input.domain().nsites()
<< " n_find_root=" << n_find_root
<< " n_neighb=" << n_neighb
<< " n_pass=" << n_pass
Index: sandbox/geraud/fllt/simple_tests.cc
--- sandbox/geraud/fllt/simple_tests.cc (revision 2233)
+++ sandbox/geraud/fllt/simple_tests.cc (working copy)
@@ -20,7 +20,7 @@
<< " from " << ((*p).elt().set_id == lower<V>::id ?
"lower" : "upper") << " level set."
<< std::endl
- << " npoints = " << (*p).elt().npoints << std::endl
+ << " nsites = " << (*p).elt().nsites << std::endl
<< " holes = " << (*p).elt().holes << std::endl;
std::cout << std::endl;
@@ -31,7 +31,7 @@
for_all(n)
tmp.append((*n).elt().points);
- if ((*p).elt().points.npoints() > 0)
+ if ((*p).elt().points.nsites() > 0)
debug::println(ima | tmp);
tmp.clear();
Index: sandbox/geraud/fllt/fllt.svg.1.cc
--- sandbox/geraud/fllt/fllt.svg.1.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.1.cc (working copy)
@@ -59,7 +59,7 @@
unsigned compute_gN(const N_t& N)
{
for (unsigned i = 0; i < 256; ++i)
- if (N[i].npoints() != 0)
+ if (N[i].nsites() != 0)
return i;
mln_invariant(0);
return 0;
Index: sandbox/geraud/fllt/fllt.svg.7.hh
--- sandbox/geraud/fllt/fllt.svg.7.hh (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.7.hh (working copy)
@@ -94,11 +94,11 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
- fllt_node_elt(bool set_id) : npoints(0), tagged(false), set_id(set_id) {}
+ fllt_node_elt(bool set_id) : nsites(0), tagged(false), set_id(set_id) {}
};
@@ -124,7 +124,7 @@
void update_gN(const N_t& N, G& gN, lower<V>)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -138,7 +138,7 @@
{
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -154,7 +154,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -196,7 +196,7 @@
image2d<value::int_u8> out = clone(cast_image<value::int_u8>(is));
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -533,7 +533,7 @@
deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -548,7 +548,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -588,7 +588,7 @@
else
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
Index: sandbox/geraud/fllt/fllt.svg.2.cc
--- sandbox/geraud/fllt/fllt.svg.2.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.2.cc (working copy)
@@ -61,7 +61,7 @@
void update_gN(const N_t& N, G& gN)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g].npoints() != 0)
+ if (N[g].nsites() != 0)
{
gN = g;
return;
@@ -76,7 +76,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i].npoints() == 0)
+ if (N[i].nsites() == 0)
continue;
std::cout << i << ": " << N[i] << std::endl;
}
@@ -157,7 +157,7 @@
typedef p_array<mln_point(I)> arr_t;
arr_t A, R;
- R.reserve(input.npoints());
+ R.reserve(input.nsites());
arr_t N[256];
accu::bbox<mln_point(I)> R_box;
@@ -209,7 +209,7 @@
// R <- R U A
- if (A.npoints() == 0)
+ if (A.nsites() == 0)
goto the_end;
R.append(A);
@@ -218,7 +218,7 @@
mln_invariant(is(a) == in_A);
is(a) = in_R;
}
- mln_invariant(R.npoints() == (is | in_R).npoints());
+ mln_invariant(R.nsites() == (is | in_R).nsites());
R_box.take(A.bbox());
// N <- N U { x in nbh of A and not in R }
Index: sandbox/geraud/fllt/fllt.svg.3.cc
--- sandbox/geraud/fllt/fllt.svg.3.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.3.cc (working copy)
@@ -62,7 +62,7 @@
void update_gN(const N_t& N, G& gN)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g].npoints() != 0)
+ if (N[g].nsites() != 0)
{
gN = g;
return;
@@ -77,7 +77,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i].npoints() == 0)
+ if (N[i].nsites() == 0)
continue;
std::cout << i << ": " << N[i] << std::endl;
}
@@ -212,7 +212,7 @@
// R <- R U A
- if (A.npoints() == 0)
+ if (A.nsites() == 0)
goto the_end;
for_all(a)
Index: sandbox/geraud/fllt/fllt.svg.4.cc
--- sandbox/geraud/fllt/fllt.svg.4.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.4.cc (working copy)
@@ -64,7 +64,7 @@
void update_gN(const N_t& N, G& gN)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g].npoints() != 0)
+ if (N[g].nsites() != 0)
{
gN = g;
return;
@@ -79,7 +79,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i].npoints() == 0)
+ if (N[i].nsites() == 0)
continue;
std::cout << i << ": " << N[i] << std::endl;
}
@@ -221,7 +221,7 @@
// R <- R U A
- if (A.npoints() == 0)
+ if (A.nsites() == 0)
goto the_end;
// for_all(a)
@@ -292,10 +292,10 @@
// we only want R
// yet A is empty (cause included in R)
- // so this test is ok: mln_invariant((is | in_A).npoints() == 0);
+ // so this test is ok: mln_invariant((is | in_A).nsites() == 0);
for (unsigned i = 0; i < 256; ++i)
- if (N[i].npoints())
+ if (N[i].nsites())
level::fill(inplace(deja_vu | N[i]), false);
// {
// mln_piter(arr_t) p(N[i]);
Index: sandbox/geraud/fllt/fllt.svg.5.cc
--- sandbox/geraud/fllt/fllt.svg.5.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.5.cc (working copy)
@@ -64,7 +64,7 @@
void update_gN(const N_t& N, G& gN)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -79,7 +79,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -223,7 +223,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// for_all(a)
@@ -298,10 +298,10 @@
// we only want R
// yet A is empty (cause included in R)
- // so this test is ok: mln_invariant((is | in_A).npoints() == 0);
+ // so this test is ok: mln_invariant((is | in_A).nsites() == 0);
for (unsigned i = 0; i < 256; ++i)
- if (N[i]->npoints())
+ if (N[i]->nsites())
level::fill(inplace(deja_vu | *N[i]), false);
// mln_invariant(deja_vu == ((pw::value(is) == pw::cst(in_R)) | input.domain()));
Index: sandbox/geraud/fllt/fllt.svg.6.cc
--- sandbox/geraud/fllt/fllt.svg.6.cc (revision 2233)
+++ sandbox/geraud/fllt/fllt.svg.6.cc (working copy)
@@ -93,11 +93,11 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
- fllt_node_elt(bool set_id) : npoints(0), tagged(false), set_id(set_id) {}
+ fllt_node_elt(bool set_id) : nsites(0), tagged(false), set_id(set_id) {}
};
@@ -123,7 +123,7 @@
void update_gN(const N_t& N, G& gN, lower<V>)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -137,7 +137,7 @@
{
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -153,7 +153,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -195,7 +195,7 @@
image2d<value::int_u8> out = clone(cast_image<value::int_u8>(is));
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -451,7 +451,7 @@
mln_invariant(smallest_shapes(a) != current_cc);
deja_vu(a) = in_R;
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
if (!smallest_shapes(a))
{
smallest_shapes(a) = current_cc;
@@ -615,7 +615,7 @@
deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -630,7 +630,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -670,7 +670,7 @@
else
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
@@ -938,7 +938,7 @@
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
<< " from " << ((*p).elt().set_id == lower<V>::id ? "lower" : "upper") << " level set." << std::endl
- << " npoints = " << (*p).elt().npoints << std::endl
+ << " nsites = " << (*p).elt().nsites << std::endl
<< " holes = " << (*p).elt().holes << std::endl;
std::cout << std::endl;
@@ -949,7 +949,7 @@
for_all(n)
tmp.append((*n).elt().points);
- if ((*p).elt().points.npoints() > 0)
+ if ((*p).elt().points.nsites() > 0)
debug::println(ima | tmp);
tmp.clear();
@@ -979,7 +979,7 @@
ima(p) = true;
}
- node->elt().npoints = area;
+ node->elt().nsites = area;
return area;
}
@@ -1019,7 +1019,7 @@
fllt_tree(P, V) subtree(node);
fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node));
for_all(s)
- if ((*s).elt().npoints > min_area && (*s).elt().npoints < max_area)
+ if ((*s).elt().nsites > min_area && (*s).elt().nsites < max_area)
draw_shape(output, &*s);
}
@@ -1029,14 +1029,14 @@
value::int_u8 g,
unsigned accu)
{
-// if ((*node).elt().npoints >= min_area)
+// if ((*node).elt().nsites >= min_area)
if (accu > min_area)
{
accu = 0;
g = (*node).elt().value;
}
- accu += (*node).elt().npoints;
+ accu += (*node).elt().nsites;
level::fill(inplace(output | (*node).elt().points), g);
for (int i = 0; i < node->children().size();i++)
Index: sandbox/geraud/fllt/connected_filters/area_filter.hh
--- sandbox/geraud/fllt/connected_filters/area_filter.hh (revision 2233)
+++ sandbox/geraud/fllt/connected_filters/area_filter.hh (working copy)
@@ -27,7 +27,7 @@
ima(p) = true;
}
- node->elt().npoints = area;
+ node->elt().nsites = area;
return area;
}
@@ -46,7 +46,7 @@
unsigned min_area,
value::int_u8 g)
{
- unsigned area = (*node).elt().npoints;
+ unsigned area = (*node).elt().nsites;
if (area > min_area)
g = (*node).elt().value;
Index: sandbox/geraud/fllt/fllt_test.hh
--- sandbox/geraud/fllt/fllt_test.hh (revision 2233)
+++ sandbox/geraud/fllt/fllt_test.hh (working copy)
@@ -90,12 +90,12 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
char id;
- fllt_node_elt(bool set_id) : npoints(0), tagged(false), set_id(set_id)
+ fllt_node_elt(bool set_id) : nsites(0), tagged(false), set_id(set_id)
{
static char id_ = 'A';
@@ -127,7 +127,7 @@
void update_gN(const N_t& N, G& gN, lower<V>)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -141,7 +141,7 @@
{
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -157,7 +157,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -202,7 +202,7 @@
image2d<value::int_u8> out = clone(cast_image<value::int_u8>(is));
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -562,7 +562,7 @@
deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -576,7 +576,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -617,7 +617,7 @@
else
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
Index: sandbox/geraud/fllt.svg.7.hh
--- sandbox/geraud/fllt.svg.7.hh (revision 2233)
+++ sandbox/geraud/fllt.svg.7.hh (working copy)
@@ -94,11 +94,11 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
- fllt_node_elt(bool set_id) : npoints(0), tagged(false), set_id(set_id) {}
+ fllt_node_elt(bool set_id) : nsites(0), tagged(false), set_id(set_id) {}
};
@@ -124,7 +124,7 @@
void update_gN(const N_t& N, G& gN, lower<V>)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -138,7 +138,7 @@
{
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -154,7 +154,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -196,7 +196,7 @@
image2d<value::int_u8> out = clone(cast_image<value::int_u8>(is));
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -526,7 +526,7 @@
deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -541,7 +541,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -581,7 +581,7 @@
else
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
Index: sandbox/geraud/p_runs__with_dedicated_piter.hh
--- sandbox/geraud/p_runs__with_dedicated_piter.hh (revision 2233)
+++ sandbox/geraud/p_runs__with_dedicated_piter.hh (working copy)
@@ -418,7 +418,7 @@
// fb_.take(pr.bbox().pmin());
// fb_.take(pr.bbox().pmax());
// // update size
-// npoints_ += pr.npoints();
+// nsites_ += pr.nsites();
// }
Index: sandbox/geraud/fllt.svg.6.cc
--- sandbox/geraud/fllt.svg.6.cc (revision 2233)
+++ sandbox/geraud/fllt.svg.6.cc (working copy)
@@ -93,11 +93,11 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
bool tagged;
bool set_id;
- fllt_node_elt(bool set_id) : npoints(0), tagged(false), set_id(set_id) {}
+ fllt_node_elt(bool set_id) : nsites(0), tagged(false), set_id(set_id) {}
};
@@ -123,7 +123,7 @@
void update_gN(const N_t& N, G& gN, lower<V>)
{
for (unsigned g = 0; g < 256; ++g)
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -137,7 +137,7 @@
{
for (int g = 255; g >= 0; --g)
{
- if (N[g]->npoints() != 0)
+ if (N[g]->nsites() != 0)
{
gN = g;
return;
@@ -153,7 +153,7 @@
{
for (unsigned i = 0; i < 256; ++i)
{
- if (N[i]->npoints() == 0)
+ if (N[i]->nsites() == 0)
continue;
std::cout << i << ": " << *N[i] << std::endl;
}
@@ -195,7 +195,7 @@
image2d<value::int_u8> out = clone(cast_image<value::int_u8>(is));
- mln_assertion(R_box.npoints() > 0);
+ mln_assertion(R_box.nsites() > 0);
mln_piter_(box2d) p(R_box);
for_all(p)
if (is(p) == in_R)
@@ -451,7 +451,7 @@
mln_invariant(smallest_shapes(a) != current_cc);
deja_vu(a) = in_R;
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
if (!smallest_shapes(a))
{
smallest_shapes(a) = current_cc;
@@ -615,7 +615,7 @@
deja_vu(x0) = in_R;
smallest_shapes(x0) = current_cc;
current_cc->elt().points.append(x0);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
}
@@ -630,7 +630,7 @@
// R <- R U A
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto the_end;
// N <- N U { x in nbh of A and not in R }
@@ -670,7 +670,7 @@
else
blob(Set(), deja_vu, N, in_N, N_box, current_cc);
- n_holes += current_cc->elt().holes.npoints();
+ n_holes += current_cc->elt().holes.nsites();
node_type* child = current_cc;
current_cc = new node_type(Set::id);
@@ -938,7 +938,7 @@
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
<< " from " << ((*p).elt().set_id == lower<V>::id ? "lower" : "upper") << " level set." << std::endl
- << " npoints = " << (*p).elt().npoints << std::endl
+ << " nsites = " << (*p).elt().nsites << std::endl
<< " holes = " << (*p).elt().holes << std::endl;
std::cout << std::endl;
@@ -949,7 +949,7 @@
for_all(n)
tmp.append((*n).elt().points);
- if ((*p).elt().points.npoints() > 0)
+ if ((*p).elt().points.nsites() > 0)
debug::println(ima | tmp);
tmp.clear();
@@ -979,7 +979,7 @@
ima(p) = true;
}
- node->elt().npoints = area;
+ node->elt().nsites = area;
return area;
}
@@ -1019,7 +1019,7 @@
fllt_tree(P, V) subtree(node);
fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node));
for_all(s)
- if ((*s).elt().npoints > min_area && (*s).elt().npoints < max_area)
+ if ((*s).elt().nsites > min_area && (*s).elt().nsites < max_area)
draw_shape(output, &*s);
}
@@ -1029,14 +1029,14 @@
value::int_u8 g,
unsigned accu)
{
-// if ((*node).elt().npoints >= min_area)
+// if ((*node).elt().nsites >= min_area)
if (accu > min_area)
{
accu = 0;
g = (*node).elt().value;
}
- accu += (*node).elt().npoints;
+ accu += (*node).elt().nsites;
level::fill(inplace(output | (*node).elt().points), g);
for (int i = 0; i < node->children().size();i++)
Index: sandbox/garrigues/level_set.hh
--- sandbox/garrigues/level_set.hh (revision 2233)
+++ sandbox/garrigues/level_set.hh (working copy)
@@ -159,7 +159,7 @@
// env.shape(n);
// }
// std::cout << "update cc lower : " << p << std::endl;
-// if (env.R.npoints())
+// if (env.R.nsites())
// debug::println(env.u | env.R);
// debug::println(d);
@@ -289,7 +289,7 @@
}
// gn <- min u(x) x belongs to N.
- if ((env.u | set::inter(env.N, env.u.domain())).npoints() > 0)
+ if ((env.u | set::inter(env.N, env.u.domain())).nsites() > 0)
env.gn = level::compute< typename F::accu_for_gn >(env.u | set::inter(env.N, env.u.domain()));
else
{
@@ -317,7 +317,7 @@
// Create a new conected component.
// FIXME : we can make it faster.
- if ((env.R.bbox() < env.u.domain()) || (env.R.npoints() == env.u.domain().npoints()))
+ if ((env.R.bbox() < env.u.domain()) || (env.R.nsites() == env.u.domain().nsites()))
{
mln_piter(p_set<P>) p(env.R);
env.current_region = new fllt_node(P, V)();
@@ -355,7 +355,7 @@
// std::cout << "labeling : " << n << std::endl;
// std::cout << "nous : " << env.n_cc << std::endl;
-// if (env.R.npoints())
+// if (env.R.nsites())
// debug::println(env.u | env.R);
if (n > 1)
Index: sandbox/garrigues/fllt/fllt_simple.svg.1.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.1.cc (revision 2233)
+++ sandbox/garrigues/fllt/fllt_simple.svg.1.cc (working copy)
@@ -212,7 +212,7 @@
mln_niter(Nbh) x(nbh, a);
// Stop.
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto end;
// R <- R U A
@@ -233,9 +233,9 @@
#ifdef FLLTDEBUG
- std::cout << "points of A : " << A->npoints() << std::endl;
+ std::cout << "points of A : " << A->nsites() << std::endl;
#endif
- mln_assertion(A->npoints() > 0);
+ mln_assertion(A->nsites() > 0);
R_box.take(A->bbox());
mln_assertion(R_box.is_valid());
@@ -267,7 +267,7 @@
#endif
// Stop if N is empty.
- if (N->npoints() == 0)
+ if (N->nsites() == 0)
goto step_1;
else
{
Index: sandbox/garrigues/fllt/merge.hh
--- sandbox/garrigues/fllt/merge.hh (revision 2233)
+++ sandbox/garrigues/fllt/merge.hh (working copy)
@@ -94,10 +94,10 @@
const image2d<fllt_node(P, V)*>& hole_reg)
{
// std::cout << "[Start fill_a_shape] " << &node << " "
-// << node.elt().holes.npoints()
+// << node.elt().holes.nsites()
// << " holes." << std::endl;
- if (node.elt().holes.npoints() == 0)
+ if (node.elt().holes.nsites() == 0)
{
// std::cout << "[End fill_a_shape]" << std::endl;
return;
@@ -190,7 +190,7 @@
fllt_tree(P, V)* main_tree = &lower_tree;
fllt_tree(P, V)* other_tree = &upper_tree;
- if (lower_tree.root()->elt().points.npoints() >= ima.domain().npoints())
+ if (lower_tree.root()->elt().points.nsites() >= ima.domain().nsites())
{
main_tree = &upper_tree;
other_tree = &lower_tree;
Index: sandbox/garrigues/fllt/fllt_simple.svg.3.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.3.cc (revision 2233)
+++ sandbox/garrigues/fllt/fllt_simple.svg.3.cc (working copy)
@@ -138,18 +138,18 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
};
template <typename P, typename V>
- void add_npoints_to(fllt_node(P, V)* node, unsigned npoints)
+ void add_nsites_to(fllt_node(P, V)* node, unsigned nsites)
{
mln_assertion(node);
- node->elt().npoints += npoints;
+ node->elt().nsites += nsites;
if (node->parent())
- add_npoints_to(node->parent(), npoints);
+ add_nsites_to(node->parent(), nsites);
}
@@ -187,10 +187,10 @@
std::cout << " |" << std::endl;
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
- << " npoints = " << (*p).elt().npoints << std::endl
+ << " nsites = " << (*p).elt().nsites << std::endl
<< std::endl;
- if ((*p).elt().points.npoints() > 0)
+ if ((*p).elt().points.nsites() > 0)
debug::println(ima | (*p).elt().points);
std::cout << std::endl;
}
@@ -207,7 +207,7 @@
level::fill(output, 255);
for_all(p)
{
- if ((*p).elt().npoints > limit)
+ if ((*p).elt().nsites > limit)
{
mln_piter(p_array<point2d>) q((*p).elt().points);
for_all(q)
@@ -372,7 +372,7 @@
current_cc = new node_type();
++cc_cpt;
current_cc->elt().value = g;
- current_cc->elt().npoints = 0;
+ current_cc->elt().nsites = 0;
if (cc_cpt > 1)
current_parent = 0;
#ifdef FLLTDEBUG
@@ -414,7 +414,7 @@
mln_piter(arr_t) a(*A);
// Stop.
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto end;
// R <- R U A
@@ -426,7 +426,7 @@
mln_assertion(map(a).belongs_to == 0);
map(a).belongs_to = current_cc;
current_cc->elt().points.append(a);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
tagged(a) = true;
is(a) = in_R;
#ifdef FLLTDEBUG
@@ -439,9 +439,9 @@
#ifdef FLLTDEBUG
- std::cout << "points of A : " << A->npoints() << std::endl;
+ std::cout << "points of A : " << A->nsites() << std::endl;
#endif
- mln_assertion(A->npoints() > 0);
+ mln_assertion(A->nsites() > 0);
R_box.take(A->bbox());
mln_assertion(R_box.is_valid());
@@ -495,10 +495,10 @@
#endif
// Stop if N[g] is empty.
- if (N[g]->npoints() == 0)
+ if (N[g]->nsites() == 0)
{
- add_npoints_to(current_parent, current_cc->elt().npoints);
- // Was : current_parent->elt().npoints += current_cc->elt().npoints;
+ add_nsites_to(current_parent, current_cc->elt().nsites);
+ // Was : current_parent->elt().nsites += current_cc->elt().nsites;
current_cc->set_parent(current_parent);
erase_exterior_border(map, N_box, current_cc, neighb_c6);
goto step_1;
Index: sandbox/garrigues/fllt/fllt_simple.cc
--- sandbox/garrigues/fllt/fllt_simple.cc (revision 2233)
+++ sandbox/garrigues/fllt/fllt_simple.cc (working copy)
@@ -141,7 +141,7 @@
/// Tell if his parent if brighter or not. Nb : if the parent
/// if brighter, the node come from the lower level set
bool brighter;
- unsigned npoints;
+ unsigned nsites;
};
@@ -286,13 +286,13 @@
};
template <typename P, typename V>
- void add_npoints_to(fllt_node(P, V)* node, unsigned npoints)
+ void add_nsites_to(fllt_node(P, V)* node, unsigned nsites)
{
mln_assertion(node);
- node->elt().npoints += npoints;
+ node->elt().nsites += nsites;
if (node->parent())
- add_npoints_to(node->parent(), npoints);
+ add_nsites_to(node->parent(), nsites);
}
template <typename R>
@@ -327,10 +327,10 @@
std::cout << " |" << std::endl;
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
- << " npoints = " << (*p).elt().npoints << std::endl
+ << " nsites = " << (*p).elt().nsites << std::endl
<< std::endl;
- if ((*p).elt().points.npoints() > 0)
+ if ((*p).elt().points.nsites() > 0)
debug::println(ima | (*p).elt().points);
std::cout << std::endl;
}
@@ -346,7 +346,7 @@
level::fill(output, 255);
for_all(p)
{
- if ((*p).elt().npoints > limit)
+ if ((*p).elt().nsites > limit)
{
mln_piter(p_array<point2d>) q((*p).elt().points);
for_all(q)
@@ -490,7 +490,7 @@
current_cc = new node_type();
++cc_cpt;
current_cc->elt().value = g;
- current_cc->elt().npoints = 0;
+ current_cc->elt().nsites = 0;
if (cc_cpt > 1)
current_parent = 0;
#ifdef FLLTDEBUG
@@ -532,7 +532,7 @@
mln_piter(arr_t) a(*A);
// Stop.
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto end;
// R <- R U A
@@ -544,7 +544,7 @@
mln_assertion(map(a).belongs_to == 0);
map(a).belongs_to = current_cc;
current_cc->elt().points.append(a);
- current_cc->elt().npoints++;
+ current_cc->elt().nsites++;
tagged(a) = true;
is(a) = in_R;
#ifdef FLLTDEBUG
@@ -557,9 +557,9 @@
#ifdef FLLTDEBUG
- std::cout << "points of A : " << A->npoints() << std::endl;
+ std::cout << "points of A : " << A->nsites() << std::endl;
#endif
- mln_assertion(A->npoints() > 0);
+ mln_assertion(A->nsites() > 0);
R_box.take(A->bbox());
mln_assertion(R_box.is_valid());
@@ -613,10 +613,10 @@
#endif
// Stop if N[g] is empty.
- if (N[g]->npoints() == 0)
+ if (N[g]->nsites() == 0)
{
- add_npoints_to(current_parent, current_cc->elt().npoints);
- // Was : current_parent->elt().npoints += current_cc->elt().npoints;
+ add_nsites_to(current_parent, current_cc->elt().nsites);
+ // Was : current_parent->elt().nsites += current_cc->elt().nsites;
current_cc->set_parent(current_parent);
erase_exterior_border(map, N_box, current_cc);
goto step_1;
Index: sandbox/garrigues/fllt/types.hh
--- sandbox/garrigues/fllt/types.hh (revision 2233)
+++ sandbox/garrigues/fllt/types.hh (working copy)
@@ -96,14 +96,14 @@
const box2d& bbox() const;
/// Give the number of points.
- unsigned npoints() const;
+ unsigned nsites() const;
/// Hook to the image2d containing the points.
sub_image<image2d<value::int_u8>, box2d> image();
private:
image2d<value::int_u8> ima_;
- unsigned npoints_;
+ unsigned nsites_;
accu::bbox<point2d> bb_;
};
@@ -115,7 +115,7 @@
: ima_(b)
{
bb_.init();
- npoints_ = 0;
+ nsites_ = 0;
level::fill(ima_, false);
}
@@ -127,7 +127,7 @@
{
bb_.take(p);
ima_(p) = domain;
- npoints_++;
+ nsites_++;
return *this;
}
@@ -153,7 +153,7 @@
void
ran_domains::clear()
{
- if (npoints_ == 0)
+ if (nsites_ == 0)
return;
// unsigned bb_nrows = geom::nrows(bb_.to_result());
@@ -171,7 +171,7 @@
// else
level::fill(ima_, false);
- npoints_ = 0;
+ nsites_ = 0;
bb_.init();
}
@@ -180,22 +180,22 @@
const box2d&
ran_domains::bbox() const
{
- mln_precondition(npoints_ != 0);
+ mln_precondition(nsites_ != 0);
return bb_.to_result();
}
inline
unsigned
- ran_domains::npoints() const
+ ran_domains::nsites() const
{
- return npoints_;
+ return nsites_;
}
inline
sub_image<image2d<value::int_u8>, box2d>
ran_domains::image()
{
- mln_precondition(npoints_ > 0);
+ mln_precondition(nsites_ > 0);
mln_assertion(ima_.has_data());
return ima_ | bb_.to_result();
}
Index: sandbox/garrigues/fllt/fllt_theo.cc
--- sandbox/garrigues/fllt/fllt_theo.cc (revision 2233)
+++ sandbox/garrigues/fllt/fllt_theo.cc (working copy)
@@ -163,7 +163,7 @@
mln_niter(Nbh) x(nbh, a);
// Stop.
- if (A.npoints() == 0)
+ if (A.nsites() == 0)
goto end;
// R <- R U A
@@ -184,9 +184,9 @@
#ifdef FLLTDEBUG
- std::cout << "points of A : " << A.npoints() << std::endl;
+ std::cout << "points of A : " << A.nsites() << std::endl;
#endif
- mln_assertion(A.npoints() > 0);
+ mln_assertion(A.nsites() > 0);
R_box.take(A.bbox());
mln_assertion(R_box.is_valid());
@@ -214,7 +214,7 @@
// gN = min u(x) for all x in N
unsigned i;
for (i = 0; i < 256; ++i)
- if (N[i].npoints() != 0)
+ if (N[i].nsites() != 0)
{
gN = i;
break;
@@ -229,7 +229,7 @@
#endif
if (i == 256)
goto step_4c;
- mln_assertion(N[gN].npoints() > 0);
+ mln_assertion(N[gN].nsites() > 0);
// FIXME: update the number of CC of the border of R
}
@@ -249,8 +249,8 @@
A = N[gN];
N[gN].clear();
- mln_assertion(A.npoints() > 0);
- mln_assertion(N[gN].npoints() == 0);
+ mln_assertion(A.nsites() > 0);
+ mln_assertion(N[gN].nsites() == 0);
goto step_3;
}
// b)
@@ -261,8 +261,8 @@
#endif
A = N[gN];
N[gN].clear();
- mln_assertion(A.npoints() > 0);
- mln_assertion(N[gN].npoints() == 0);
+ mln_assertion(A.nsites() > 0);
+ mln_assertion(N[gN].nsites() == 0);
goto step_3;
}
// c)
Index: sandbox/garrigues/fllt/compute_level_set_fast2.hh
--- sandbox/garrigues/fllt/compute_level_set_fast2.hh (revision 2233)
+++ sandbox/garrigues/fllt/compute_level_set_fast2.hh (working copy)
@@ -130,7 +130,7 @@
// gn <- min u(x) x belongs to N.
image_sub_if_value tmp(r_a_n.image() | SET_N);
- finished = tmp.npoints() == 0;
+ finished = tmp.nsites() == 0;
if (!finished)
gn = level::compute< typename F::accu_for_gn >(u | tmp.domain());
@@ -175,7 +175,7 @@
// This is faster.
-// if (N.npoints() >= 0)
+// if (N.nsites() >= 0)
// {
image_sub_if_value tmp(r_a_n.image() | SET_N);
image_sub_if_value::fwd_piter qn(tmp.domain());
@@ -215,7 +215,7 @@
// FIXME : we can make it faster.
// FIXME : rewrite this test.
- // if ((R.bbox() < u.domain()) || (R.npoints() == u.domain().npoints()))
+ // if ((R.bbox() < u.domain()) || (R.nsites() == u.domain().nsites()))
// {
image_sub_if_value tmp(r_a_n.image() | SET_R);
image_sub_if_value::fwd_piter p(tmp.domain());
@@ -284,10 +284,10 @@
update_set(u, r_a_n, g);
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
// std::cout << "exiting step_fast 4_1" << std::endl;
@@ -307,10 +307,10 @@
update_set(u,r_a_n,g);
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
// std::cout << "exiting step_fast 4_2" << std::endl;
Index: sandbox/garrigues/fllt/fllt_merge.hh
--- sandbox/garrigues/fllt/fllt_merge.hh (revision 2233)
+++ sandbox/garrigues/fllt/fllt_merge.hh (working copy)
@@ -89,7 +89,7 @@
const image2d<fllt_node(P, V)*>& node_reg,
const image2d<fllt_node(P, V)*>& hole_reg)
{
- if (node.elt().holes.npoints() == 0)
+ if (node.elt().holes.nsites() == 0)
{
return;
}
@@ -177,7 +177,7 @@
fllt_tree(P, V)* main_tree = &lower_tree;
fllt_tree(P, V)* other_tree = &upper_tree;
- if (lower_tree.root()->elt().points.npoints() >= ima.domain().npoints())
+ if (lower_tree.root()->elt().points.nsites() >= ima.domain().nsites())
{
main_tree = &upper_tree;
other_tree = &lower_tree;
Index: sandbox/garrigues/fllt/fllt_optimized.hh
--- sandbox/garrigues/fllt/fllt_optimized.hh (revision 2233)
+++ sandbox/garrigues/fllt/fllt_optimized.hh (working copy)
@@ -83,7 +83,7 @@
level::fill(output, 255);
for_all(p)
{
- if ((*p).elt().points.npoints() > limit)
+ if ((*p).elt().points.nsites() > limit)
{
mln_piter(p_set<point2d>) q((*p).elt().points);
for_all(q)
@@ -114,7 +114,7 @@
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
<< " holes : "
- << (*p).elt().holes.npoints()
+ << (*p).elt().holes.nsites()
<< (*p).elt().holes
<< std::endl;
Index: sandbox/garrigues/fllt/debug.hh
--- sandbox/garrigues/fllt/debug.hh (revision 2233)
+++ sandbox/garrigues/fllt/debug.hh (working copy)
@@ -79,7 +79,7 @@
level::fill(output, 255);
for_all(p)
{
- if ((*p).elt().points.npoints() > limit)
+ if ((*p).elt().points.nsites() > limit)
{
mln_piter(p_set<point2d>) q((*p).elt().points);
for_all(q)
@@ -110,7 +110,7 @@
std::cout << "region : " << &*p
<< " value = " << (*p).elt().value << std::endl
<< " holes : "
- << (*p).elt().holes.npoints()
+ << (*p).elt().holes.nsites()
<< (*p).elt().holes
<< std::endl;
@@ -186,11 +186,11 @@
level::fill(out, literal::white);
- if (R.npoints() != 0)
+ if (R.nsites() != 0)
level::fill(inplace(out | R), literal::green);
- if (A.npoints() != 0)
+ if (A.nsites() != 0)
level::fill(inplace(out | A), literal::blue);
- if (N.npoints() != 0)
+ if (N.nsites() != 0)
level::fill(inplace(out | N), literal::red);
io::ppm::save(out, filename.str());
Index: sandbox/garrigues/fllt/compute_level_set_fast.hh
--- sandbox/garrigues/fllt/compute_level_set_fast.hh (revision 2233)
+++ sandbox/garrigues/fllt/compute_level_set_fast.hh (working copy)
@@ -120,7 +120,7 @@
// gn <- min u(x) x belongs to N.
- finished = N.npoints() == 0;
+ finished = N.nsites() == 0;
if (!finished)
gn = level::compute< typename F::accu_for_gn >(u | N);
@@ -166,7 +166,7 @@
// This is faster.
-// if (N.npoints() >= 0)
+// if (N.nsites() >= 0)
// {
p_image2d_fwd_pixter<point2d> pxl(N);
for_all(pxl)
@@ -210,7 +210,7 @@
// Create a new conected component.
// FIXME : we can make it faster.
- if ((R.bbox() < u.domain()) || (R.npoints() == u.domain().npoints()))
+ if ((R.bbox() < u.domain()) || (R.nsites() == u.domain().nsites()))
{
mln_piter(p_image2d<P>) p(R);
current_region = new fllt_node(P, V)();
@@ -277,10 +277,10 @@
update_set(u,A,N,g);
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
// std::cout << "exiting step_fast 4_1" << std::endl;
@@ -316,10 +316,10 @@
update_set(u,A,N,g);
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
// std::cout << "exiting step_fast 4_2" << std::endl;
Index: sandbox/garrigues/fllt/fllt_simple.svg.2.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.2.cc (revision 2233)
+++ sandbox/garrigues/fllt/fllt_simple.svg.2.cc (working copy)
@@ -228,7 +228,7 @@
mln_piter(arr_t) a(*A);
// Stop.
- if (A->npoints() == 0)
+ if (A->nsites() == 0)
goto end;
// R <- R U A
@@ -249,9 +249,9 @@
#ifdef FLLTDEBUG
- std::cout << "points of A : " << A->npoints() << std::endl;
+ std::cout << "points of A : " << A->nsites() << std::endl;
#endif
- mln_assertion(A->npoints() > 0);
+ mln_assertion(A->nsites() > 0);
R_box.take(A->bbox());
mln_assertion(R_box.is_valid());
@@ -291,7 +291,7 @@
#endif
// Stop if N is empty.
- if (N->npoints() == 0)
+ if (N->nsites() == 0)
goto step_1;
else
{
Index: sandbox/garrigues/fllt/compute_level_set.hh
--- sandbox/garrigues/fllt/compute_level_set.hh (revision 2233)
+++ sandbox/garrigues/fllt/compute_level_set.hh (working copy)
@@ -103,17 +103,17 @@
// debug::println(u);
// //std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// //debug::println(u | A);
// //std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// //debug::println(u | N);
// //std::cout << "R :" << std::endl;
- // if (R.npoints())
+ // if (R.nsites())
// //debug::println(u | R);
// gn <- min u(x) x belongs to N.
- if ((u | set::inter(N, u.domain())).npoints() > 0)
+ if ((u | set::inter(N, u.domain())).nsites() > 0)
gn = level::compute< typename F::accu_for_gn >(u | set::inter(N, u.domain()));
else
{
@@ -151,7 +151,7 @@
// Create a new conected component.
// FIXME : we can make it faster.
- if ((R.bbox() < u.domain()) || (R.npoints() == u.domain().npoints()))
+ if ((R.bbox() < u.domain()) || (R.nsites() == u.domain().nsites()))
{
mln_piter(p_set<P>) p(R);
current_region = new fllt_node(P, V)();
@@ -220,10 +220,10 @@
N = set::diff(N, set::inter(N, u.domain()) | pw::value(u) == pw::cst(g));
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
//std::cout << "exiting step 4_1" << std::endl;
@@ -248,10 +248,10 @@
N = set::diff(N, set::inter(N, u.domain()) | pw::value(u) == pw::cst(g));
// std::cout << "A :" << std::endl;
- // if (A.npoints())
+ // if (A.nsites())
// debug::println(u | A);
// std::cout << "N :" << std::endl;
- // if (N.npoints())
+ // if (N.nsites())
// debug::println(u | N);
//std::cout << "exiting step 4_2" << std::endl;
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2233)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -323,7 +323,7 @@
tiled_image2d<T>::nelements() const
{
mln_precondition(this->has_data());
- return this->data_->b_.npoints();
+ return this->data_->b_.nsites();
}
template <typename T>
Index: sandbox/abraham/mln/morpho/basic_najman.hh
--- sandbox/abraham/mln/morpho/basic_najman.hh (revision 2233)
+++ sandbox/abraham/mln/morpho/basic_najman.hh (working copy)
@@ -546,7 +546,7 @@
// Clear the marker map
level::fill(isproc, false);
- for (int ip = 0; ip < int(S.npoints()); ++ip)
+ for (int ip = 0; ip < int(S.nsites()); ++ip)
{
psite p = S[ip];
MakeSet_node(p);
@@ -721,7 +721,7 @@
// We're on a leaf, the point has not been found
- if (nodes(cur).children.npoints() == 0)
+ if (nodes(cur).children.nsites() == 0)
return psite (-1, -1);
psite tmp, acc = psite(-1, -1);
@@ -762,7 +762,7 @@
psite min (p_set<psite>& components)
{
- if (components.npoints() == 0)
+ if (components.nsites() == 0)
return psite(-1, -1);
typename p_set<psite>::fwd_piter it(components);
@@ -777,7 +777,7 @@
psite max (p_set<psite>& components)
{
- if (components.npoints() == 0)
+ if (components.nsites() == 0)
return psite(-1, -1);
typename p_set<psite>::fwd_piter it(components);
@@ -793,13 +793,13 @@
psite highest_fork (p_set<psite>& components)
{
- if (components.npoints() == 0)
+ if (components.nsites() == 0)
{
std::cerr << "highest fork : empty set" << std::endl;
return psite(-1, -1);
}
- // if (components.npoints() == 1)
+ // if (components.nsites() == 1)
// return components[0];
psite
@@ -834,7 +834,7 @@
if (pima.has(q) && pima(q) < pima(p))
v.insert(Par_node(q));
- if (v.npoints() == 0)
+ if (v.nsites() == 0)
return psite(-1, -1);
psite hf = highest_fork(v);
@@ -857,10 +857,10 @@
if (pima.has(q) && pima(q) < pima(p))
v.insert(Par_node(q));
- if (v.npoints() == 0)
+ if (v.nsites() == 0)
return psite(-1, -1);
- if (nodes(min(v)).children.npoints() != 0)
+ if (nodes(min(v)).children.nsites() != 0)
return (psite(-1, -1));
//std::cout << "hf of " << p << ":" << v;
@@ -882,12 +882,12 @@
if (pima.has(q) && pima(q) > pima(p))
v.insert(Par_node(q));
- if (v.npoints() == 0)
+ if (v.nsites() == 0)
return psite(-1, -1);
- if (v.npoints() == 1)
+ if (v.nsites() == 1)
{
- if (nodes(v[0]).children.npoints() == 1)
+ if (nodes(v[0]).children.nsites() == 1)
std::cout << "SINGL QUI MERDE" << std::endl;
return v[0];
}
@@ -911,7 +911,7 @@
if (nodes(c).level <= pima(p))
return psite(-1, -1);
- if (nodes(c).children.npoints() == 1)
+ if (nodes(c).children.nsites() == 1)
std::cout << "LCA QUI MERDE" << std::endl;
return c;
@@ -927,10 +927,10 @@
if (pima.has(q) && pima(q) > pima(p))
v.insert(Par_node(q));
- if (v.npoints() == 0)
+ if (v.nsites() == 0)
return psite(-1, -1);
- if (v.npoints() == 1)
+ if (v.nsites() == 1)
return v[0];
psite
@@ -1173,7 +1173,7 @@
level::fill(cmax, false);
mln_piter(I) it(Par_node.domain());
for_all(it)
- if (nodes(Par_node(it.to_point())).children.npoints() == 0)
+ if (nodes(Par_node(it.to_point())).children.nsites() == 0)
cmax(it.to_point()) = true;
// Optimisation : enqueue minima's neighbours
@@ -1213,15 +1213,15 @@
Par_node(x) = c;
// isproc(x) = true;
- if (nodes(c).children.npoints() == 0)
+ if (nodes(c).children.nsites() == 0)
cmax(x) = true;
else
- if (nodes(c).children.npoints() > 1)
+ if (nodes(c).children.nsites() > 1)
{
}
else
{
- std::cerr << "ERREUR COMPOSANTE BRANCHE " << nodes(c).children.npoints() << std::endl;
+ std::cerr << "ERREUR COMPOSANTE BRANCHE " << nodes(c).children.nsites() << std::endl;
}
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Cleanup level fill.
* mln/level/fill.hh: Dispatch to explicit routines.
fill.hh | 180 +++++++++++++++++++---------------------------------------------
1 file changed, 55 insertions(+), 125 deletions(-)
Index: mln/level/fill.hh
--- mln/level/fill.hh (revision 2232)
+++ mln/level/fill.hh (working copy)
@@ -32,16 +32,15 @@
*
* \brief Fill an image, that is, set pixel values.
*
- * \todo Re-organize this file contents + Overload for fastest images.
+ * \todo Add a conversion "arr->fun" then get rid of the C array overload.
*/
# include <mln/core/concept/function.hh>
+# include <mln/pw/image.hh>
+# include <mln/convert/to_fun.hh>
-# include <mln/level/fill_with_value.hh>
# include <mln/level/fill_with_image.hh>
-
-// Specializations are in:
-// # include <mln/level/fill.spe.hh>
+# include <mln/level/fill_with_value.hh>
namespace mln
@@ -50,165 +49,96 @@
namespace level
{
- /*! Fill the whole image \p ima with the single value \p v.
- *
- * \param[in,out] ima The image to be filled.
- * \param[in] v The value to assign to all sites.
- *
- * \pre \p ima has to be initialized.
- *
- * \todo Optimize when \p ima is large and sizeof(mln_value(I)) > 1.
- */
- template <typename I>
- void fill(Image<I>& ima, const mln_value(I)& v);
-
-
- /*! Fill the whole image \p ima with the function \p f.
- *
- * \param[in,out] ima The image to be filled.
- * \param[in] f The function.
- *
- * \pre \p ima has to be initialized.
- *
- * \todo Take benefit from quantization when possible.
- */
- template <typename I, typename F>
- void fill(Image<I>& ima, const Function_p2v<F>& f);
-
-
- /*! Fill the image \p ima by applying the function \p f.
+ /*! Fill the whole image \p ima with the data provided by \p aux.
*
* \param[in,out] ima The image to be filled.
- * \param[in] f The function that defines the value of every pixel.
- *
- * The signature of \p f has to be:
- * " value f(const point& p) "
+ * \param[in] data The auxiliary data to fill the image \p ima.
*
* \pre \p ima has to be initialized.
- *
- * \todo Take benefit from quantization when possible.
*/
- template <typename I>
- void fill(Image<I>& ima, mln_value(I) (*(&f))(const mln_psite(I)& p));
-
- template <typename I>
- void fill_f(Image<I>& ima, mln_value(I) (*f)(const mln_psite(I)& p));
-
+ template <typename I, typename D>
+ void fill(Image<I>& ima, const D& data);
- /*! Fill the image \p ima with the values given by the array \p arr.
- *
- * \param[in,out] ima The image to be filled.
- * \param[in] arr The array of values.
- *
- * \warning The size of the array has to be larger than the number
- * of image points, otherwise the program crashes.
- *
- * \pre \p ima has to be initialized.
- * \pre N == \p ima.npoints
- */
- template <typename I, unsigned N>
- void fill(Image<I>& ima, mln_value(I) (&arr)[N]);
- /*! Fill the image \p ima with the values of the image \p data.
- *
- * \param[in,out] ima The image to be filled.
- * \param[in] data The image.
- *
- * \warning The definition domain of \p ima has to be included in
- * the one of \p data.
- *
- * \pre \p ima.domain <= \p data.domain.
- *
- * \todo Use memcpy when possible.
- */
- template <typename I, typename J>
- void fill(Image<I>& ima, const Image<J>& data);
+# ifndef MLN_INCLUDE_ONLY
+ namespace internal
+ {
+ // tests
+ template <typename I, typename D>
+ inline
+ void fill_tests(Image<I>& ima, const D&)
+ {
+ mlc_is(mln_trait_image_value_io(I), trait::image::value_io::read_write)::check();
+ mln_precondition(exact(ima).has_data());
+ // FIXME: check for ambiguities...
+ }
-# ifndef MLN_INCLUDE_ONLY
+ // dispatch
+ template <typename I, typename D>
+ void fill_dispatch(Image<I>& ima, const D& data)
+ {
+ fill_dispatch_overload(ima, exact(data));
+ }
- // With: value
+ // dispatch_overload
template <typename I>
- inline
- void fill(Image<I>& ima, const mln_value(I)& value)
+ void fill_dispatch_overload(Image<I>& ima, const mln_value(I)& v)
{
- trace::entering("level::fill");
- fill_with_value(ima, value);
- trace::exiting("level::fill");
+ mln::level::fill_with_value(ima, v);
}
-
- // with: Image<J>
-
template <typename I, typename J>
- inline
- void fill(Image<I>& ima, const Image<J>& data)
+ void fill_dispatch_overload(Image<I>& ima, const Image<J>& data)
{
- trace::entering("level::fill");
- fill_with_image(ima, data);
- trace::exiting("level::fill");
+ mln::level::fill_with_image(ima, data);
}
-
- // with: Function_p2v<F>
-
template <typename I, typename F>
- inline
- void fill(Image<I>& ima_, const Function_p2v<F>& f_)
+ void fill_dispatch_overload(Image<I>& ima, const Function<F>& f)
{
- trace::entering("level::fill");
-
- I& ima = exact(ima_);
- mln_precondition(ima.has_data());
- const F& f = exact(f_);
- mln_piter(I) p(ima.domain());
- for_all(p)
- ima(p) = f(p);
-
- trace::exiting("level::fill");
+ mlc_converts_to(mln_result(F), mln_value(I))::check();
+ mln::level::fill_with_image(ima, f | ima.domain());
}
-
- // with: value f(const point&)
-
- template <typename I>
- inline
- void fill_f(Image<I>& ima_,
- mln_value(I) (*f)(const mln_psite(I)& p))
+ template <typename I, typename R, typename A>
+ void fill_dispatch_overload(Image<I>& ima, R (*f)(A))
{
- trace::entering("level::fill_f");
+ mlc_converts_to(R, mln_value(I))::check();
+ mln::level::fill_with_image(ima,
+ convert::to_fun(f) | ima.domain());
+ }
- mln_precondition(f != 0);
+ template <typename I, typename V, unsigned N>
+ void fill_dispatch_overload(Image<I>& ima_, V (&arr)[N])
+ {
+ mlc_converts_to(V, mln_value(I))::check();
I& ima = exact(ima_);
- mln_precondition(ima.has_data());
- mln_piter(I) p(ima.domain());
+ mln_precondition(N == ima.nsites());
+ mln_fwd_piter(I) p(ima.domain());
+ unsigned i = 0;
for_all(p)
- ima(p) = f(p);
-
- trace::exiting("level::fill_f");
+ ima(p) = arr[i++];
}
+ } // end of namespace mln::level::internal
+
- // with: value arr[N]
+ // Facade.
- template <typename I, unsigned N>
+ template <typename I, typename D>
inline
- void fill(Image<I>& ima_, mln_value(I) (&arr)[N])
+ void fill(Image<I>& ima, const D& data)
{
trace::entering("level::fill");
- I& ima = exact(ima_);
- mln_precondition(ima.has_data());
- mln_precondition(N == ima.npoints());
- mln_piter(I) p(ima.domain());
- unsigned i = 0;
- for_all(p)
- ima(p) = arr[i++];
+ internal::fill_tests(ima, data);
+ internal::fill_dispatch(ima, data);
trace::exiting("level::fill");
}
1
0
cleanup-2008 2232: Propagate the update of fastest image interface namings.
by Thierry Geraud 12 Sep '08
by Thierry Geraud 12 Sep '08
12 Sep '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Propagate the update of fastest image interface namings.
* tests/level/paste.cc: Re-activate 3D tests.
* mln/debug/println_with_border.spe.hh,
* mln/debug/println_with_border.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/image/image3d.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/pixel.hh,
* mln/core/concept/doc/image_fastest.hh,
* mln/level/memset_.hh,
* mln/level/memcpy_.hh,
* mln/border/fill.hh,
* mln/border/duplicate.hh,
* mln/canvas/labeling.hh,
* sandbox/duhamel/paste.hh,
* sandbox/duhamel/fill.hh,
* sandbox/duhamel/border_duplicate.hh,
* sandbox/duhamel/border_fill.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh:
Update fastest interface naming.
mln/border/duplicate.hh | 6 +--
mln/border/fill.hh | 8 ++--
mln/canvas/labeling.hh | 2 -
mln/core/concept/doc/image_fastest.hh | 12 +++---
mln/core/dpoints_pixter.hh | 4 +-
mln/core/image/fi_adaptor.hh | 18 ++++-----
mln/core/image/image3d.hh | 43 ++++++++++++++---------
mln/core/internal/check/image_fastest.hh | 4 +-
mln/core/internal/image_base.hh | 5 ++
mln/core/pixel.hh | 2 -
mln/debug/println_with_border.hh | 2 -
mln/debug/println_with_border.spe.hh | 2 -
mln/level/memcpy_.hh | 8 ++--
mln/level/memset_.hh | 6 +--
sandbox/duhamel/border_duplicate.hh | 6 +--
sandbox/duhamel/border_fill.hh | 8 ++--
sandbox/duhamel/fill.hh | 2 -
sandbox/duhamel/paste.hh | 2 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 4 +-
sandbox/nivault/plugin-gimp/src/gimp-image.hh | 18 ++++-----
tests/level/paste.cc | 34 +++++++++---------
21 files changed, 107 insertions(+), 89 deletions(-)
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2231)
+++ tests/level/paste.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image/image2d.hh>
-// #include <mln/core/image/image3d.hh>
+#include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/level/fill.hh>
@@ -63,20 +63,20 @@
assert(ima == (ima2 | b));
}
-// // tests in three dimension
-// {
-// box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
-// image3d<int> ima(b, 2);
-// debug::iota(ima);
-
-// box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
-// image3d<int> ima2(b2, 2);
-// debug::iota(ima2);
-
-// level::paste(ima, ima2); // Fast version.
-// assert(ima == (ima2 | b));
-
-// level::impl::generic::paste(ima, ima2); // Not so fast version...
-// assert(ima == (ima2 | b));
-// }
+ // tests in three dimension
+ {
+ box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
+ image3d<int> ima(b, 2);
+ debug::iota(ima);
+
+ box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
+ image3d<int> ima2(b2, 2);
+ debug::iota(ima2);
+
+ level::paste(ima, ima2); // Fast version.
+ assert(ima == (ima2 | b));
+
+ level::impl::generic::paste(ima, ima2); // Not so fast version...
+ assert(ima == (ima2 | b));
+ }
}
Index: mln/debug/println_with_border.spe.hh
--- mln/debug/println_with_border.spe.hh (revision 2231)
+++ mln/debug/println_with_border.spe.hh (working copy)
@@ -61,7 +61,7 @@
println_with_border(const box2d& b, const I& input)
{
const std::size_t ncols = b.ncols() + 2 * input.border();
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
{
std::cout << format(input.buffer()[i]) << ' ';
if (((i + 1) % ncols) == 0)
Index: mln/debug/println_with_border.hh
--- mln/debug/println_with_border.hh (revision 2231)
+++ mln/debug/println_with_border.hh (working copy)
@@ -65,7 +65,7 @@
void
println_with_border(const S&, const I& input)
{
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
std::cout << format(input.buffer()[i]) << ' ';
std::cout << std::endl;
}
Index: mln/core/image/fi_adaptor.hh
--- mln/core/image/fi_adaptor.hh (revision 2231)
+++ mln/core/image/fi_adaptor.hh (working copy)
@@ -170,7 +170,7 @@
const box2d& domain() const;
/// Give the number of cells.
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -194,10 +194,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint2d& dp) const;
+ int delta_index(const dpoint2d& dp) const;
/// Give the point corresponding to the offset \p o.
- point2d point_at_offset(unsigned o) const;
+ point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -307,7 +307,7 @@
template <typename I>
std::size_t
- fi_adaptor<I>::ncells() const
+ fi_adaptor<I>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -337,7 +337,7 @@
const mln_value(I)&
fi_adaptor<I>::operator[](unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -345,7 +345,7 @@
mln_value(I)&
fi_adaptor<I>::operator[](unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -387,7 +387,7 @@
template <typename I>
int
- fi_adaptor<I>::offset(const dpoint2d& dp) const
+ fi_adaptor<I>::delta_index(const dpoint2d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -396,9 +396,9 @@
template <typename I>
point2d
- fi_adaptor<I>::point_at_offset(unsigned o) const
+ fi_adaptor<I>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point2d p = make::point2d(this->data_->b_.max_row() - o / this->data_->b_.len(1) - this->data_->b_.min_row(),
o % this->data_->b_.len(1) + this->data_->b_.min_col());
mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Index: mln/core/image/image3d.hh
--- mln/core/image/image3d.hh (revision 2231)
+++ mln/core/image/image3d.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -172,11 +173,14 @@
/// Give the definition domain.
const box3d& domain() const;
+ /// Give the bounding box domain.
+ const box3d& bbox() const;
+
/// Give the border thickness.
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point3d& p) const;
@@ -185,10 +189,10 @@
T& operator()(const point3d& p);
/// Read-only access to the image value located at offset \p o.
- const T& operator[](unsigned o) const;
+ const T& element(unsigned o) const;
/// Read-write access to the image value located at offset \p o.
- T& operator[](unsigned o);
+ T& element(unsigned o);
/// Read-only access to the image value located at (\p ind).
const T& at(int sli, int row, int col) const;
@@ -200,10 +204,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint3d& dp) const;
+ int delta_index(const dpoint3d& dp) const;
/// Give the point corresponding to the offset \p o.
- point3d point_at_offset(unsigned o) const;
+ point3d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -400,6 +404,15 @@
template <typename T>
inline
+ const box3d&
+ image3d<T>::bbox() const
+ {
+ mln_precondition(this->has_data());
+ return data_->b_;
+ }
+
+ template <typename T>
+ inline
unsigned
image3d<T>::border() const
{
@@ -410,10 +423,10 @@
template <typename T>
inline
std::size_t
- image3d<T>::ncells() const
+ image3d<T>::nelements() const
{
mln_precondition(this->has_data());
- return data_->vb_.npoints();
+ return data_->vb_.nsites();
}
template <typename T>
@@ -446,18 +459,18 @@
template <typename T>
inline
const T&
- image3d<T>::operator[](unsigned o) const
+ image3d<T>::element(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
template <typename T>
inline
T&
- image3d<T>::operator[](unsigned o)
+ image3d<T>::element(unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
@@ -500,7 +513,7 @@
template <typename T>
inline
int
- image3d<T>::offset(const dpoint3d& dp) const
+ image3d<T>::delta_index(const dpoint3d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0];
@@ -510,9 +523,9 @@
template <typename T>
inline
point3d
- image3d<T>::point_at_offset(unsigned o) const
+ image3d<T>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point3d p = make::point3d(o / (data_->vb_.len(1) * data_->vb_.len(2)) + data_->vb_.min_sli(),
(o % (data_->vb_.len(1) * data_->vb_.len(2))) / data_->vb_.len(2) + data_->vb_.min_row(),
o % data_->vb_.len(2) + data_->vb_.min_col());
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh (revision 2231)
+++ mln/core/dpoints_pixter.hh (working copy)
@@ -264,7 +264,7 @@
dpoints_fwd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[0] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
@@ -375,7 +375,7 @@
dpoints_bkd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[ndpoints() - 1] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2231)
+++ mln/core/internal/image_base.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/core/internal/image_base.hh
*
* \brief Definition of the common base class for all images.
+ *
+ * \todo Provide coord iff the site is a grid point.
*/
# include <mln/core/concept/image.hh>
@@ -82,6 +84,9 @@
public image_checked_<E>
{
+ /// Coordinate associated type.
+ typedef mln_deduce(S, site, coord) coord;
+
/// Value associated type.
typedef T value;
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 2231)
+++ mln/core/internal/check/image_fastest.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Class that statically checks the interface of fastest
* images.
*
- * \todo Check and convert p in offset_at towards E::psite.
+ * \todo Check and convert p in index_of_point towards E::psite.
*/
# include <mln/core/internal/force_exact.hh>
@@ -60,7 +60,7 @@
* \warning This method is final.
*
* \pre The image has to be initialized and to own the point \p p.
- * \post p == point_at_offset(result)
+ * \post p == point_at_index(result)
*/
template <typename P>
unsigned
Index: mln/core/pixel.hh
--- mln/core/pixel.hh (revision 2231)
+++ mln/core/pixel.hh (working copy)
@@ -102,7 +102,7 @@
if (this->value_ptr_ == 0 || ! this->image_.has_data())
return false;
int o = this->value_ptr_ - this->image_.buffer();
- mln_psite(I) p = this->image_.point_at_offset(o);
+ mln_psite(I) p = this->image_.point_at_index(o);
return this->image_.has(p);
}
Index: mln/core/concept/doc/image_fastest.hh
--- mln/core/concept/doc/image_fastest.hh (revision 2231)
+++ mln/core/concept/doc/image_fastest.hh (working copy)
@@ -58,7 +58,7 @@
*
* \pre The image has to be initialized.
*/
- int offset(const dpoint& dp);
+ int delta_index(const dpoint& dp);
/*! \brief Give the point at offset \p o.
@@ -66,9 +66,9 @@
* \param[in] o An offset.
*
* \pre The image has to be initialized.
- * \pre o < ncells()
+ * \pre o < nelements()
*/
- point point_at_offset(unsigned o) const;
+ point point_at_index(unsigned o) const;
/*! \brief Give a hook to the value buffer.
@@ -83,7 +83,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (not assignable).
*/
@@ -94,7 +94,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (assignable).
*/
@@ -106,7 +106,7 @@
*
* \pre The image has to be initialized.
*/
- std::size_t ncells() const;
+ std::size_t nelements() const;
};
} // end of namespace mln::doc
Index: mln/level/memset_.hh
--- mln/level/memset_.hh (revision 2231)
+++ mln/level/memset_.hh (working copy)
@@ -131,8 +131,8 @@
P& pix = internal::force_exact<P>(pix_);
mln_precondition(pix.ima().has_data());
mln_precondition(& pix.val() >= & pix.ima()[0]);
- mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().ncells());
- mln_precondition(& pix.val() + n <= & pix.ima()[0] + pix.ima().ncells());
+ mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().nelements());
+ mln_precondition(& pix.val() + n <= & pix.ima()[0] + pix.ima().nelements());
impl::memset__(pix, v, n);
@@ -150,7 +150,7 @@
mln_precondition(input.has_data());
mln_precondition(input.has(p));
- mln_precondition(input.offset_at(p) + n <= input.ncells());
+ mln_precondition(input.index_of_point(p) + n <= input.nelements());
pixel<I> pix(input, p);
impl::memset__(pix, v, n);
Index: mln/level/memcpy_.hh
--- mln/level/memcpy_.hh (revision 2231)
+++ mln/level/memcpy_.hh (working copy)
@@ -126,12 +126,12 @@
mln_precondition(src.ima().has_data());
mln_precondition(&dest.val() >= &dest.ima()[0]);
- mln_precondition(&dest.val() < &dest.ima()[0] + dest.ima().ncells());
- mln_precondition(&dest.val() + n <= &dest.ima()[0] + dest.ima().ncells());
+ mln_precondition(&dest.val() < &dest.ima()[0] + dest.ima().nelements());
+ mln_precondition(&dest.val() + n <= &dest.ima()[0] + dest.ima().nelements());
mln_precondition(&src.val() >= &src.ima()[0]);
- mln_precondition(&src.val() < &src.ima()[0] + src.ima().ncells());
- mln_precondition(&src.val() + n <= &src.ima()[0] + src.ima().ncells());
+ mln_precondition(&src.val() < &src.ima()[0] + src.ima().nelements());
+ mln_precondition(&src.val() + n <= &src.ima()[0] + src.ima().nelements());
impl::memcpy__(dest, src, n);
Index: mln/border/fill.hh
--- mln/border/fill.hh (revision 2231)
+++ mln/border/fill.hh (working copy)
@@ -76,7 +76,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -84,7 +84,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
trace::exiting("border::impl::fill_size_1_");
}
@@ -102,12 +102,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
trace::exiting("border::impl::fill_size_n_");
Index: mln/border/duplicate.hh
--- mln/border/duplicate.hh (revision 2231)
+++ mln/border/duplicate.hh (working copy)
@@ -78,7 +78,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
trace::exiting("border::impl::duplicate_1d_");
@@ -102,7 +102,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -154,7 +154,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 2231)
+++ mln/canvas/labeling.hh (working copy)
@@ -270,7 +270,7 @@
labeling_fastest<F>::init()
{
initialize(parent, f.input);
- for (unsigned p = 0; p < parent.ncells(); ++p)
+ for (unsigned p = 0; p < parent.nelements(); ++p)
parent[p] = p; // make_set
initialize(output, f.input);
mln::level::fill(output, 0); // FIXME: Use literal::zero.
Index: sandbox/duhamel/paste.hh
--- sandbox/duhamel/paste.hh (revision 2231)
+++ sandbox/duhamel/paste.hh (working copy)
@@ -15,7 +15,7 @@
template <typename I>
void paste(const I& data_, I& destination_)
{
- imacpy_ (destination_, data_, destination_.ncells());
+ imacpy_ (destination_, data_, destination_.nelements());
}
template <typename I, typename J>
Index: sandbox/duhamel/fill.hh
--- sandbox/duhamel/fill.hh (revision 2231)
+++ sandbox/duhamel/fill.hh (working copy)
@@ -91,7 +91,7 @@
point2d u = min;
point2d v = min + down;
std::size_t k = ima.offset (down);
- std::size_t max = ima.ncells() / k;
+ std::size_t max = ima.nelements() / k;
for (std::size_t i = 0; i < k; ++i)
*ptr++ = value;
Index: sandbox/duhamel/border_duplicate.hh
--- sandbox/duhamel/border_duplicate.hh (revision 2231)
+++ sandbox/duhamel/border_duplicate.hh (working copy)
@@ -82,7 +82,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
}
@@ -104,7 +104,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -151,7 +151,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: sandbox/duhamel/border_fill.hh
--- sandbox/duhamel/border_fill.hh (revision 2231)
+++ sandbox/duhamel/border_fill.hh (working copy)
@@ -231,7 +231,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -239,7 +239,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
}
template <typename I>
@@ -254,12 +254,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
}
} // end of namespace mln::border::impl
Index: sandbox/nivault/plugin-gimp/src/gimp-image.hh
--- sandbox/nivault/plugin-gimp/src/gimp-image.hh (revision 2231)
+++ sandbox/nivault/plugin-gimp/src/gimp-image.hh (working copy)
@@ -194,7 +194,7 @@
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// const-only access to the image value located at point \p p.
const T& operator()(const point& p) const;
@@ -218,10 +218,10 @@
/// Fast Image method
// /// Give the offset corresponding to the delta-point \p dp.
-// int offset(const dpoint2d& dp) const;
+// int delta_index(const dpoint2d& dp) const;
// /// Give the point corresponding to the offset \p o.
-// point2d point_at_offset(unsigned o) const;
+// point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -390,7 +390,7 @@
template <GimpImageType t>
std::size_t
- gimp_image<t>::ncells() const
+ gimp_image<t>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -438,7 +438,7 @@
// const mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -447,7 +447,7 @@
// mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o)
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -490,7 +490,7 @@
// template <GimpImageType t>
// int
-// gimp_image<t>::offset(const dpoint2d& dp) const
+// gimp_image<t>::delta_index(const dpoint2d& dp) const
// {
// mln_precondition(this->has_data());
// int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -500,9 +500,9 @@
// template <GimpImageType t>
// point2d
-// gimp_image<t>::point_at_offset(unsigned o) const
+// gimp_image<t>::point_at_index(unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// point2d p = make::point2d(o / this->data_->b_.len(1) + this->data_->b_.min_row(),
// o % this->data_->b_.len(1) + this->data_->b_.min_col());
// mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2231)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -187,7 +187,7 @@
const box2d& domain() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -320,7 +320,7 @@
template <typename T>
inline
std::size_t
- tiled_image2d<T>::ncells() const
+ tiled_image2d<T>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
1
0
cleanup-2008 2231: Clean level::paste; yet de-activate specializations.
by Thierry Geraud 12 Sep '08
by Thierry Geraud 12 Sep '08
12 Sep '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Clean level::paste; yet de-activate specializations.
* tests/level/paste.cc: Deactivate 3D tests.
* mln/core/image/instant.hh (init_): New method; fix missing.
* mln/level/paste.spe.hh (paste_dispatch): New.
De-activate specializations; it calls the generic version.
* mln/level/paste.hh (paste_tests): New in internal.
(paste): Call tests then dispatch.
mln/core/image/instant.hh | 13 ++++++
mln/level/paste.hh | 40 +++++++++++++--------
mln/level/paste.spe.hh | 86 ++++++++++++++++++++++++++--------------------
tests/level/paste.cc | 36 +++++++++----------
4 files changed, 107 insertions(+), 68 deletions(-)
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2230)
+++ tests/level/paste.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image/image2d.hh>
-#include <mln/core/image/image3d.hh>
+// #include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/level/fill.hh>
@@ -59,24 +59,24 @@
level::paste(ima, ima2); // Fast version.
assert(ima == (ima2 | b));
- level::impl::generic::paste_(ima, ima2); // Not so fast version...
+ level::impl::generic::paste(ima, ima2); // Not so fast version...
assert(ima == (ima2 | b));
}
- // tests in three dimension
- {
- box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
- image3d<int> ima(b, 2);
- debug::iota(ima);
-
- box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
- image3d<int> ima2(b2, 2);
- debug::iota(ima2);
-
- level::paste(ima, ima2); // Fast version.
- assert(ima == (ima2 | b));
-
- level::impl::generic::paste_(ima, ima2); // Not so fast version...
- assert(ima == (ima2 | b));
- }
+// // tests in three dimension
+// {
+// box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
+// image3d<int> ima(b, 2);
+// debug::iota(ima);
+
+// box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
+// image3d<int> ima2(b2, 2);
+// debug::iota(ima2);
+
+// level::paste(ima, ima2); // Fast version.
+// assert(ima == (ima2 | b));
+
+// level::impl::generic::paste(ima, ima2); // Not so fast version...
+// assert(ima == (ima2 | b));
+// }
}
Index: mln/core/image/instant.hh
--- mln/core/image/instant.hh (revision 2230)
+++ mln/core/image/instant.hh (working copy)
@@ -95,6 +95,9 @@
/// Constructor.
instant_(I& ima);
+ /// Deferred initialization.
+ void init_(I& ima);
+
/// Remove the "instant" envelope.
I& un_instant_();
I& un_instant_() const;
@@ -126,6 +129,16 @@
instant_<I>::instant_(I& ima)
{
mln_precondition(ima.has_data());
+ this->init_(ima);
+ this->data_ = new internal::data< instant_<I> >(ima);
+ }
+
+ template <typename I>
+ inline
+ void
+ instant_<I>::init_(I& ima)
+ {
+ mln_precondition(ima.has_data());
this->data_ = new internal::data< instant_<I> >(ima);
}
Index: mln/level/paste.spe.hh
--- mln/level/paste.spe.hh (revision 2230)
+++ mln/level/paste.spe.hh (working copy)
@@ -57,54 +57,68 @@
namespace generic
{
template <typename I, typename J>
- void paste_(const I& data, J& destination);
- }
-
- template <typename I, typename J>
- inline
- void paste_lines_(const I& data, J& destination)
- {
- trace::entering("level::impl::paste_lines_");
- typedef mln_psite(I) P;
- std::size_t n = data.bbox().len(P::dim - 1);
- // FIXME: Works only for raw data images
- // FIXME: For linear data images, we should get the len for each line...
-
- typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter!
- // mln_line_piter(I) p(data.domain());
- for_all(p)
- memcpy_(inplace(make::pixel(destination, p)),
- make::pixel(data, p),
- n);
- trace::exiting("level::impl::paste_lines_");
+ void paste(const Image<I>& data, Image<J>& destination);
}
+// template <typename I, typename J>
+// inline
+// void paste_lines_(const I& data, J& destination)
+// {
+// trace::entering("level::impl::paste_lines_");
+// typedef mln_psite(I) P;
+// std::size_t n = data.bbox().len(P::dim - 1);
+// // FIXME: Works only for raw data images
+// // FIXME: For linear data images, we should get the len for each line...
+
+// typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter!
+// // mln_line_piter(I) p(data.domain());
+// for_all(p)
+// memcpy_(inplace(make::pixel(destination, p)),
+// make::pixel(data, p),
+// n);
+// trace::exiting("level::impl::paste_lines_");
+// }
+
+
+// // Disjunction.
+
+// // Remember: raw < linear < stored, computed.
+
+// template <typename I, typename J>
+// inline
+// void paste_(trait::image::value_storage::any, const I& data,
+// trait::image::value_storage::any, J& destination)
+// {
+// generic::paste_(data, destination);
+// }
+
+// template <typename I, typename J>
+// inline
+// void paste_(trait::image::value_storage::one_block, const I& data,
+// trait::image::value_storage::one_block, J& destination)
+// {
+// if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
+// paste_lines_(data, destination);
+// else
+// generic::paste_(data, destination);
+// }
- // Disjunction.
- // Remember: raw < linear < stored, computed.
+ } // end of namespace mln::level::impl
- template <typename I, typename J>
- inline
- void paste_(trait::image::value_storage::any, const I& data,
- trait::image::value_storage::any, J& destination)
+ namespace internal
{
- generic::paste_(data, destination);
- }
template <typename I, typename J>
inline
- void paste_(trait::image::value_storage::one_block, const I& data,
- trait::image::value_storage::one_block, J& destination)
+ void paste_dispatch(const Image<I>& data, Image<J>& destination)
{
- if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
- paste_lines_(data, destination);
- else
- generic::paste_(data, destination);
+ impl::generic::paste(data, destination);
+// impl::paste_(mln_trait_image_value_storage(I)(), data,
+// mln_trait_image_value_storage(J)(), destination);
}
-
- } // end of namespace mln::level::impl
+ } // end of namespace mln::level::internal
} // end of namespace mln::level
Index: mln/level/paste.hh
--- mln/level/paste.hh (revision 2230)
+++ mln/level/paste.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -73,6 +73,21 @@
# ifndef MLN_INCLUDE_ONLY
+ namespace internal
+ {
+
+ template <typename I, typename J>
+ inline
+ void paste_tests(const Image<I>& data, Image<J>& destination)
+ {
+ mlc_is(mln_trait_image_value_io(J), trait::image::value_io::read_write)::check();
+ mlc_converts_to(mln_value(I), mln_value(J))::check();
+ mln_precondition(exact(data).has_data());
+ mln_precondition(exact(data).domain() <= exact(destination).domain());
+ }
+
+ } // end of namespace mln::level::internal
+
namespace impl
{
@@ -81,15 +96,19 @@
template <typename I, typename J>
inline
- void paste_(const I& data, J& destination)
+ void paste(const Image<I>& data_, Image<J>& destination_)
{
- trace::entering("level::impl::generic::paste_");
+ trace::entering("level::impl::generic::paste");
+
+ internal::paste_tests(data_, destination_);
+ const I& data = exact(data_);
+ J& destination = exact(destination_);
mln_piter(I) p(data.domain());
for_all(p)
destination(p) = data(p);
- trace::exiting("level::impl::generic::paste_");
+ trace::exiting("level::impl::generic::paste");
}
} // end of namespace mln::level::impl::generic
@@ -101,19 +120,12 @@
template <typename I, typename J>
inline
- void paste(const Image<I>& data_, Image<J>& destination_)
+ void paste(const Image<I>& data, Image<J>& destination)
{
trace::entering("level::paste");
- const I& data = exact(data_);
- J& destination = exact(destination_);
-
- mlc_is(mln_trait_image_value_io(J), trait::image::value_io::read_write)::check();
- mlc_converts_to(mln_value(I), mln_value(J))::check();
- mln_precondition(data.domain() <= destination.domain());
-
- impl::paste_(mln_trait_image_value_storage(I)(), data,
- mln_trait_image_value_storage(J)(), destination);
+ internal::paste_tests(data, destination);
+ internal::paste_dispatch(data, destination);
trace::exiting("level::paste");
}
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Make the tests in tests/accu work.
* tests/accu/Makefile.am,
* tests/accu/all_accus.cc,
* tests/accu/histo.cc,
* tests/accu/rank.cc: Update.
* tests/accu/median.cc,
* tests/accu/median_h.cc: Move, rename median to median_h and update.
* mln/accu/min_h.hh,
* mln/accu/max_h.hh: Update licenses.
* mln/accu/rank.hh: Update.
* mln/accu/median.hh,
* mln/accu/median_h.hh: Move, rename to median_h and update.
* mln/accu/all.hh: Rename median to median_h.
mln/accu/all.hh | 2 -
mln/accu/max_h.hh | 2 -
mln/accu/median_h.hh | 89 +++++++++++++++++++++---------------------------
mln/accu/min_h.hh | 2 -
mln/accu/rank.hh | 16 +-------
tests/accu/Makefile.am | 6 ++-
tests/accu/all_accus.cc | 2 -
tests/accu/histo.cc | 2 -
tests/accu/median_h.cc | 10 ++---
tests/accu/rank.cc | 16 ++++----
10 files changed, 64 insertions(+), 83 deletions(-)
Index: tests/accu/rank.cc
--- tests/accu/rank.cc (revision 2229)
+++ tests/accu/rank.cc (working copy)
@@ -54,42 +54,42 @@
{
accu::rank_<value::int_u8> accu(0, 8);
fill(accu);
- mln_assertion(accu.to_result() == 1);
+ mln_assertion(accu.to_result() == 1u);
}
{
accu::rank_<value::int_u8> accu(1, 8);
fill(accu);
- mln_assertion(accu.to_result() == 2);
+ mln_assertion(accu.to_result() == 2u);
}
{
accu::rank_<value::int_u8> accu(2, 8);
fill(accu);
- mln_assertion(accu.to_result() == 2);
+ mln_assertion(accu.to_result() == 2u);
}
{
accu::rank_<value::int_u8> accu(3, 8);
fill(accu);
- mln_assertion(accu.to_result() == 3);
+ mln_assertion(accu.to_result() == 3u);
}
{
accu::rank_<value::int_u8> accu(4, 8);
fill(accu);
- mln_assertion(accu.to_result() == 4);
+ mln_assertion(accu.to_result() == 4u);
}
{
accu::rank_<value::int_u8> accu(5, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<value::int_u8> accu(6, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<value::int_u8> accu(7, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<bool> accu_bool(1, 5);
Index: tests/accu/median_h.cc
--- tests/accu/median_h.cc (revision 2228)
+++ tests/accu/median_h.cc (working copy)
@@ -25,22 +25,22 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/accu/median.cc
+/*! \file tests/accu/median_h.cc
*
- * \brief Tests on mln::accu::median.
+ * \brief Tests on mln::accu::median_h.
*/
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/accu/median.hh>
+#include <mln/accu/median_h.hh>
int main()
{
using namespace mln;
{
- accu::median< value::set<value::int_u8> > med;
+ accu::median_h<value::int_u8> med;
med.take(10);
med.take(9);
@@ -58,7 +58,7 @@
}
{
- accu::median< value::set<value::int_u8> > med;
+ accu::median_h<value::int_u8> med;
med.take(10);
med.take(7);
Property changes on: tests/accu/median_h.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: tests/accu/Makefile.am
--- tests/accu/Makefile.am (revision 2229)
+++ tests/accu/Makefile.am (working copy)
@@ -11,12 +11,13 @@
max \
max_h \
mean \
- median \
+ median_h \
min \
min_h \
min_max \
nil \
pair \
+ rank \
tuple
all_accus_SOURCES = all_accus.cc
@@ -27,12 +28,13 @@
max_SOURCES = max.cc
max_h_SOURCES = max_h.cc
mean_SOURCES = mean.cc
-median_SOURCES = median.cc
+median_h_SOURCES = median_h.cc
min_SOURCES = min.cc
min_h_SOURCES = min_h.cc
min_max_SOURCES = min_max.cc
nil_SOURCES = nil.cc
pair_SOURCES = pair.cc
+rank_SOURCES = rank.cc
tuple_SOURCES = tuple.cc
TESTS = $(check_PROGRAMS)
Index: tests/accu/all_accus.cc
--- tests/accu/all_accus.cc (revision 2229)
+++ tests/accu/all_accus.cc (working copy)
@@ -40,7 +40,7 @@
bbox<point2d> b;
count_<int> c;
- histo< value::set<bool> > h;
+ mln::accu::histo<bool> h;
max_<int> ma;
mean_<int> me;
// median< value::set<bool> > med; // FIXME: bool has no min so workaround!
Index: tests/accu/histo.cc
--- tests/accu/histo.cc (revision 2229)
+++ tests/accu/histo.cc (working copy)
@@ -40,7 +40,7 @@
using namespace mln;
using namespace mln::value;
- accu::histo< set<int_u8> > a;
+ accu::histo<int_u8> a;
a.take(1);
a.take(1);
Index: mln/accu/min_h.hh
--- mln/accu/min_h.hh (revision 2229)
+++ mln/accu/min_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
Index: mln/accu/rank.hh
--- mln/accu/rank.hh (revision 2229)
+++ mln/accu/rank.hh (working copy)
@@ -53,13 +53,12 @@
* The parameter \c T is the type of values.
*/
template <typename T>
- struct rank_ : public mln::accu::internal::base_< T, rank_<T> >
+ struct rank_ : public mln::accu::internal::base< T, rank_<T> >
{
typedef T argument;
typedef T result;
typedef mln::value::set<T> S;
- rank_(unsigned k, unsigned n, const Value_Set<S>& s);
rank_(unsigned k, unsigned n);
void init();
@@ -76,7 +75,7 @@
unsigned k_; // 0 <= k_ < n
unsigned n_;
- mutable accu::histo<S> h_;
+ mutable accu::histo<T> h_;
const S& s_; // derived from h_
mutable std::size_t sum_minus_, sum_plus_;
@@ -127,17 +126,6 @@
}
- template <typename T>
- inline
- rank_<T>::rank_(unsigned k, unsigned n, const Value_Set<mln::value::set<T> >& s)
- : k_(k),
- n_(n),
- h_(s),
- s_(h_.vset())
- {
- mln_assertion(k_ < n_);
- init();
- }
template <typename T>
inline
Index: mln/accu/max_h.hh
--- mln/accu/max_h.hh (revision 2229)
+++ mln/accu/max_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
Index: mln/accu/median_h.hh
--- mln/accu/median_h.hh (revision 2228)
+++ mln/accu/median_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,16 +25,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ACCU_MEDIAN_HH
-# define MLN_ACCU_MEDIAN_HH
+#ifndef MLN_ACCU_MEDIAN_H_HH
+# define MLN_ACCU_MEDIAN_H_HH
-/*! \file mln/accu/median.hh
+/*! \file mln/accu/median_h.hh
*
* \brief Define a generic median accumulator class.
*/
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
+# include <mln/value/set.hh>
namespace mln
@@ -45,38 +46,37 @@
/*! \brief Generic median function based on histogram over a value
- * set with type \c S.
+ * set with type \c V.
*/
- template <typename S>
- struct median : public mln::accu::internal::base< mln_value(S), median<S> >
- { // FIXME: Should median be named 'median_' like other accumulators ?
- typedef mln_value(S) argument;
+ template <typename V>
+ struct median_h : public mln::accu::internal::base< V, median_h<V> >
+ {
+ typedef V argument;
typedef argument result;
- median(const Value_Set<S>& s);
- median();
+ median_h();
void init();
void take(const argument& t);
- void take(const median<S>& other);
+ void take(const median_h<V>& other);
void untake(const argument& t);
unsigned card() const { return h_.sum(); }
argument to_result() const;
- const accu::histo<S>& histo() const;
+ const accu::histo<V>& histo() const;
protected:
- mutable accu::histo<S> h_;
- const S& s_; // derived from h_
+ mutable accu::histo<V> h_;
+ const value::set<V>& s_; // derived from h_
mutable std::size_t sum_minus_, sum_plus_;
mutable bool valid_;
- mutable std::size_t i_; // the median index
- mutable argument t_; // the median value
+ mutable std::size_t i_; // the median_h index
+ mutable argument t_; // the median_h value
// Auxiliary methods
void update_() const;
@@ -87,28 +87,19 @@
# ifndef MLN_INCLUDE_ONLY
- template <typename S>
- inline
- median<S>::median(const Value_Set<S>& s)
- : h_(s),
- s_(h_.vset())
- {
- init();
- }
-
- template <typename S>
+ template <typename V>
inline
- median<S>::median()
+ median_h<V>::median_h()
: h_(),
s_(h_.vset())
{
init();
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::take(const argument& t)
+ median_h<V>::take(const argument& t)
{
h_.take(t);
@@ -121,10 +112,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::take(const median<S>& other)
+ median_h<V>::take(const median_h<V>& other)
{
// h_
h_.take(other.h_);
@@ -141,10 +132,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::untake(const argument& t)
+ median_h<V>::untake(const argument& t)
{
mln_precondition(h_(t) != 0);
h_.untake(t);
@@ -158,10 +149,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::update_() const
+ median_h<V>::update_() const
{
valid_ = true;
@@ -184,10 +175,10 @@
}
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::go_minus_() const
+ median_h<V>::go_minus_() const
{
do
{
@@ -201,10 +192,10 @@
t_ = s_[i_];
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::go_plus_() const
+ median_h<V>::go_plus_() const
{
do
{
@@ -218,10 +209,10 @@
t_ = s_[i_];
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::init()
+ median_h<V>::init()
{
h_.init();
sum_minus_ = 0;
@@ -232,20 +223,20 @@
valid_ = true;
}
- template <typename S>
+ template <typename V>
inline
- typename median<S>::argument
- median<S>::to_result() const
+ typename median_h<V>::argument
+ median_h<V>::to_result() const
{
if (! valid_)
update_();
return t_;
}
- template <typename S>
+ template <typename V>
inline
- const accu::histo<S>&
- median<S>::histo() const
+ const accu::histo<V>&
+ median_h<V>::histo() const
{
return h_;
}
@@ -257,4 +248,4 @@
} // end of namespace mln
-#endif // ! MLN_ACCU_MEDIAN_HH
+#endif // ! MLN_ACCU_MEDIAN_H_HH
Property changes on: mln/accu/median_h.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/accu/all.hh
--- mln/accu/all.hh (revision 2229)
+++ mln/accu/all.hh (working copy)
@@ -58,7 +58,7 @@
# include <mln/accu/histo.hh>
# include <mln/accu/max.hh>
# include <mln/accu/mean.hh>
-# include <mln/accu/median.hh>
+# include <mln/accu/median_h.hh>
# include <mln/accu/min.hh>
# include <mln/accu/min_h.hh>
# include <mln/accu/min_max.hh>
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update the design of windows.
Propagate box renaming.
* mln/core/site_set/p_bgraph.hh,
* mln/core/site_set/p_complex.hh,
* mln/core/site_set/p_line_graph.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_graph.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/t_image.hh,
* mln/core/concept/doc/image.hh,
* mln/core/line_piter.hh,
* mln/core/alias/box2d_h.hh
(box_): Update to...
(box): ...its new name.
Use site-related names instead of point-related names.
* mln/core/w_window.hh,
* mln/core/clock_neighb.hh,
* mln/core/internal/image_base.hh,
* mln/core/concept/doc/weighted_window.hh,
* mln/core/concept/doc/dpoint.hh,
* mln/core/concept/doc/neighborhood.hh,
* mln/core/concept/doc/point_site.hh: Fix doc.
* mln/make/w_window.hh,
* mln/convert/to_upper_window.hh,
* mln/convert/to_image.hh,
* mln/convert/to_std_set.hh,
* mln/convert/to_p_set.hh,
* mln/geom/shift.hh: Fix code.
Update the design of windows.
* mln/core/point.hh (site, psite): New; this is a temp hack.
* mln/core/internal/dpoints_base.hh: Revamp.
(set_of): Remove; use instead...
(util::set): ...this and prefer delegation to...
(win_): ...this new attribute.
(insert): New protected method; no more inherited.
* mln/win/vline2d.hh,
* mln/win/hline2d.hh,
* mln/win/cube3d.hh,
* mln/win/segment1d.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: Update.
Misc.
* mln/core/site_set/p_array.hh: Fix missing include.
* mln/core/concept/window.hh (operator==): New.
* mln/core/grids.hh (coord): New include.
* mln/geom/bbox.hh: New overload for windows.
* mln/geom/sym.hh: Fix; the 'sym' method returns void.
convert/to_image.hh | 10 ++--
convert/to_p_set.hh | 8 +--
convert/to_std_set.hh | 12 ++---
convert/to_upper_window.hh | 6 +-
core/alias/box2d_h.hh | 2
core/clock_neighb.hh | 4 -
core/concept/doc/dpoint.hh | 4 -
core/concept/doc/image.hh | 6 +-
core/concept/doc/neighborhood.hh | 4 -
core/concept/doc/point_site.hh | 4 -
core/concept/doc/weighted_window.hh | 4 -
core/concept/window.hh | 8 +++
core/grids.hh | 3 -
core/image/obased_rle_image.hh | 6 +-
core/image/t_image.hh | 12 ++---
core/internal/dpoints_base.hh | 83 ++++++++++++++++++++++++------------
core/internal/image_base.hh | 2
core/line_piter.hh | 6 +-
core/point.hh | 5 ++
core/site_set/p_array.hh | 1
core/site_set/p_bgraph.hh | 6 +-
core/site_set/p_complex.hh | 6 +-
core/site_set/p_faces.hh | 6 +-
core/site_set/p_graph.hh | 6 +-
core/site_set/p_line_graph.hh | 6 +-
core/w_window.hh | 4 -
core/window.hh | 2
geom/bbox.hh | 23 +++++++++
geom/shift.hh | 12 ++---
geom/sym.hh | 8 ++-
make/w_window.hh | 6 +-
win/backdiag2d.hh | 27 +----------
win/cube3d.hh | 27 +----------
win/cuboid3d.hh | 25 ----------
win/diag2d.hh | 27 +----------
win/disk2d.hh | 27 +----------
win/hline2d.hh | 4 -
win/line.hh | 29 ++----------
win/octagon2d.hh | 27 +----------
win/rectangle2d.hh | 28 +++---------
win/segment1d.hh | 4 -
win/vline2d.hh | 4 -
42 files changed, 211 insertions(+), 293 deletions(-)
Index: mln/core/site_set/p_bgraph.hh
--- mln/core/site_set/p_bgraph.hh (revision 2228)
+++ mln/core/site_set/p_bgraph.hh (working copy)
@@ -84,7 +84,7 @@
std::size_t nlines() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -106,7 +106,7 @@
private:
graph* gr_;
- box_<P> bb_;
+ box<P> bb_;
};
# ifndef MLN_INCLUDE_ONLY
@@ -146,7 +146,7 @@
template<typename P>
inline
- const box_<P>&
+ const box<P>&
p_bgraph<P>::bbox() const
{
return bb_;
Index: mln/core/site_set/p_complex.hh
--- mln/core/site_set/p_complex.hh (revision 2228)
+++ mln/core/site_set/p_complex.hh (working copy)
@@ -103,7 +103,7 @@
complex<D>& cplx();
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
/// \}
private:
@@ -125,7 +125,7 @@
are not tied to a specific graph. */
mutable util::tracked_ptr< complex<D> > cplx_;
// FIXME: Remove as soon as bbox become optional.
- box_<P> bb_;
+ box<P> bb_;
};
@@ -212,7 +212,7 @@
template <unsigned D, typename P>
inline
- const box_<P>&
+ const box<P>&
p_complex<D, P>::bbox() const
{
// FIXME: Dummy value.
Index: mln/core/site_set/p_line_graph.hh
--- mln/core/site_set/p_line_graph.hh (revision 2228)
+++ mln/core/site_set/p_line_graph.hh (working copy)
@@ -87,7 +87,7 @@
std::size_t nedges() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -113,7 +113,7 @@
/* 2007-12-19: It seems so, since graph_image must implement a
method named bbox(). Now the question is: should each image
type have a bounding box? */
- box_<P> bb_;
+ box<P> bb_;
};
@@ -178,7 +178,7 @@
template <typename P>
inline
- const box_<P>&
+ const box<P>&
p_line_graph<P>::bbox() const
{
return bb_;
Index: mln/core/site_set/p_array.hh
--- mln/core/site_set/p_array.hh (revision 2228)
+++ mln/core/site_set/p_array.hh (working copy)
@@ -41,6 +41,7 @@
# include <vector>
# include <mln/core/internal/site_set_base.hh>
+# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/internal/pseudo_site_base.hh>
# include <mln/util/index.hh>
Index: mln/core/site_set/p_faces.hh
--- mln/core/site_set/p_faces.hh (revision 2228)
+++ mln/core/site_set/p_faces.hh (working copy)
@@ -85,7 +85,7 @@
std::size_t nfaces() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -96,7 +96,7 @@
/// The complex on which this pset is built.
util::tracked_ptr< complex<D> > cplx_;
// FIXME: Remove as soon as bbox become optional.
- box_<P> bb_;
+ box<P> bb_;
};
@@ -158,7 +158,7 @@
template <unsigned N, unsigned D, typename P>
inline
- const box_<P>&
+ const box<P>&
p_faces<N, D, P>::bbox() const
{
// FIXME: Dummy value.
Index: mln/core/site_set/p_graph.hh
--- mln/core/site_set/p_graph.hh (revision 2228)
+++ mln/core/site_set/p_graph.hh (working copy)
@@ -79,7 +79,7 @@
std::size_t nedges() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -125,7 +125,7 @@
named bbox(). Now the question is: should each image type have a
bounding box? */
private:
- box_<P> bb_;
+ box<P> bb_;
};
@@ -191,7 +191,7 @@
template <typename P>
inline
- const box_<P>&
+ const box<P>&
p_graph<P>::bbox() const
{
return bb_;
Index: mln/core/image/obased_rle_image.hh
--- mln/core/image/obased_rle_image.hh (revision 2228)
+++ mln/core/image/obased_rle_image.hh (working copy)
@@ -147,7 +147,7 @@
const std::vector<unsigned>& object(unsigned i) const;
/// Give the bounding box of the i-th object.
- const box_<P>& bbox_of_run(unsigned i) const;
+ const box<P>& bbox_of_run(unsigned i) const;
};
@@ -175,7 +175,7 @@
data_< obased_rle_image<P,T> >::size_mem() const
{
return domain_.size_mem() + bbox_.size()
- * (sizeof(T) + sizeof(box_<P>) + sizeof(std::vector<unsigned>))
+ * (sizeof(T) + sizeof(box<P>) + sizeof(std::vector<unsigned>))
+ (sizeof(unsigned) + sizeof(T)) * domain_.nruns();
}
@@ -261,7 +261,7 @@
template <typename P, typename T>
inline
- const box_<P>&
+ const box<P>&
obased_rle_image<P, T>::bbox_of_run(unsigned i) const
{
mln_assertion(i < this->data_->bbox_.size());
Index: mln/core/image/t_image.hh
--- mln/core/image/t_image.hh (revision 2228)
+++ mln/core/image/t_image.hh (working copy)
@@ -57,7 +57,7 @@
/// \param dim2 The second dimension to be swapped.
/// \param box The bounding box (domain) of the morphed image.
data(I& ima, unsigned dim1, unsigned dim2,
- mln::box_<mln_psite(I)>& box);
+ mln::box<mln_psite(I)>& box);
/// Underlying image.
I ima_;
@@ -67,7 +67,7 @@
unsigned dim2_;
/// \}
/// The bounding box of the morphed image.
- mln::box_<mln_psite(I)> box_;
+ mln::box<mln_psite(I)> box_;
};
} // end of namespace mln::internal
@@ -126,7 +126,7 @@
bool has(const mln_psite(I)& p) const;
/// Give the definition domain.
- const box_<mln_psite(I)>& domain() const;
+ const box<mln_psite(I)>& domain() const;
/// Read-only access of pixel value at point site \p p.
mln_rvalue(I) operator()(const mln_psite(I)& p) const;
@@ -168,7 +168,7 @@
inline
data< t_image<I> >::data(I& ima,
unsigned dim1, unsigned dim2,
- mln::box_<mln_psite(I)>& box)
+ mln::box<mln_psite(I)>& box)
: ima_(ima),
dim1_(dim1), dim2_(dim2),
box_(box)
@@ -188,7 +188,7 @@
// We don't use mln::t_image::transpose here, since one its
// prerequisite is that data_ is initialized, which is not done
// yet at this point.
- box_<mln_psite(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
+ box<mln_psite(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
exchange_coords_(ima.bbox().pmax(), dim1, dim2));
this->data_ = new internal::data< t_image<I> >(ima, dim1, dim2, box);
}
@@ -233,7 +233,7 @@
template <typename I>
inline
- const box_<mln_psite(I)>&
+ const box<mln_psite(I)>&
t_image<I>::domain() const
{
mln_precondition(this->has_data());
Index: mln/core/point.hh
--- mln/core/point.hh (revision 2228)
+++ mln/core/point.hh (working copy)
@@ -85,6 +85,11 @@
struct point : public Gpoint< point<G,C> >,
public internal::mutable_coord_impl_< G::dim, C, point<G,C> >
{
+ // FIXME: Temporary hack.
+ typedef point site;
+ typedef point psite;
+
+
/*! \var dim
* \brief Dimension of the space.
* \invariant dim > 0
Index: mln/core/w_window.hh
--- mln/core/w_window.hh (revision 2228)
+++ mln/core/w_window.hh (working copy)
@@ -56,10 +56,10 @@
template <typename D, typename W>
struct w_window : public Weighted_Window< w_window<D,W> >
{
- /// Point associated type.
+ /// Site associated type.
typedef mln_point(D) point;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef D dpoint;
/// Weight associated type.
Index: mln/core/window.hh
--- mln/core/window.hh (revision 2228)
+++ mln/core/window.hh (working copy)
@@ -38,6 +38,8 @@
* \todo Code other comparisons (< and <=).
*
* \todo Add static checks in insert methods.
+ *
+ * \todo Rename dps_hook_ as util_set_.
*/
# include <mln/core/internal/window_base.hh>
Index: mln/core/clock_neighb.hh
--- mln/core/clock_neighb.hh (revision 2228)
+++ mln/core/clock_neighb.hh (working copy)
@@ -54,10 +54,10 @@
template <typename D>
struct clock_neighb_ : public Neighborhood< clock_neighb_ <D> >
{
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef D dpoint;
- /// Point associated type.
+ /// Site associated type.
typedef mln_point(D) point;
/*! \brief Site_Iterator type to browse the points of a generic
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2228)
+++ mln/core/internal/image_base.hh (working copy)
@@ -105,7 +105,7 @@
/// Point_Site associated type.
typedef mln_psite(S) psite;
- /// Point associated type.
+ /// Site associated type.
typedef mln_site(S) site;
Index: mln/core/internal/dpoints_base.hh
--- mln/core/internal/dpoints_base.hh (revision 2228)
+++ mln/core/internal/dpoints_base.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -31,11 +31,15 @@
/*! \file mln/core/internal/dpoints_base.hh
*
* \brief Definition of a base class for classes based on a set of dpoints.
+ *
+ * \todo Rename as dpsites_impl.
+ *
+ * \todo Remove the .vect() method.
*/
-# include <mln/core/internal/set_of.hh>
-# include <mln/fun/i2v/all_to.hh>
-# include <mln/norm/linfty.hh>
+# include <mln/core/window.hh>
+# include <mln/core/dpsites_piter.hh>
+
namespace mln
@@ -48,16 +52,28 @@
*
*/
template <typename D, typename E>
- class dpoints_base_ : protected internal::set_of_<D>
+ class dpoints_base_
{
- typedef internal::set_of_<D> super_;
public:
- /// Point associated type.
- typedef mln_point(D) point;
+ /// Dpsite associated type.
+ typedef D dpsite;
+
+ /// Psite associated type.
+ typedef mln_psite(D) psite;
+
+ /// Site associated type.
+ typedef mln_site(D) site;
+
+
+ /// Forward site iterator associated type.
+ typedef dpsites_fwd_piter<E> fwd_qiter;
- /// Dpoint associated type.
- typedef D dpoint;
+ /// Backward site iterator associated type.
+ typedef dpsites_fwd_piter<E> bkd_qiter;
+
+ /// Site iterator associated type.
+ typedef fwd_qiter qiter;
/*! \brief Test if the window is centered.
@@ -87,8 +103,16 @@
// Give the vector of delta-points.
const std::vector<D>& vect() const;
+ // Give the vector of delta-points.
+ const std::vector<D>& std_vector() const;
+
protected:
+
dpoints_base_();
+
+ void insert(const D& d);
+
+ mln::window<D> win_;
};
@@ -105,30 +129,21 @@
inline
bool dpoints_base_<D,E>::is_centered() const
{
- static const D origin = all_to(0);
- return this->super_::has(origin);
+ return win_.is_centered();
}
template <typename D, typename E>
inline
bool dpoints_base_<D,E>::is_empty() const
{
- return this->super_::is_empty();
+ return win_.is_empty();
}
template <typename D, typename E>
inline
unsigned dpoints_base_<D,E>::delta() const
{
- unsigned d = 0;
- const unsigned n = ndpoints();
- for (unsigned i = 0; i < n; ++i)
- {
- unsigned dd = norm::linfty(dp(i).to_vec());
- if (dd > d)
- d = dd;
- }
- return d;
+ return win_.delta();
}
template <typename D, typename E>
@@ -136,7 +151,7 @@
unsigned
dpoints_base_<D,E>::ndpoints() const
{
- return this->super_::nelements();
+ return win_.size();
}
template <typename D, typename E>
@@ -145,7 +160,15 @@
dpoints_base_<D,E>::dp(unsigned i) const
{
mln_precondition(i < ndpoints());
- return this->element(i);
+ return win_.dp(i);
+ }
+
+ template <typename D, typename E>
+ inline
+ const std::vector<D>&
+ dpoints_base_<D,E>::std_vector() const
+ {
+ return win_.std_vector();
}
template <typename D, typename E>
@@ -153,7 +176,7 @@
const std::vector<D>&
dpoints_base_<D,E>::vect() const
{
- return this->super_::vect();
+ return std_vector();
}
template <typename D, typename E>
@@ -161,7 +184,15 @@
bool
dpoints_base_<D,E>::has(const D& dp) const
{
- return this->super_::has(dp);
+ return win_.dps_hook_().has(dp);
+ }
+
+ template <typename D, typename E>
+ inline
+ void
+ dpoints_base_<D,E>::insert(const D& d)
+ {
+ win_.insert(d);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/line_piter.hh
--- mln/core/line_piter.hh (revision 2228)
+++ mln/core/line_piter.hh (working copy)
@@ -60,7 +60,7 @@
*
* \param[in] b A box.
*/
- line_piter_(const box_<P>& b);
+ line_piter_(const box<P>& b);
/// Conversion to point.
operator P() const;
@@ -84,7 +84,7 @@
void next_();
private:
- const box_<P>& b_;
+ const box<P>& b_;
P p_;
bool is_valid_;
};
@@ -97,7 +97,7 @@
template <typename P>
inline
- line_piter_<P>::line_piter_(const box_<P>& b)
+ line_piter_<P>::line_piter_(const box<P>& b)
: b_(b)
{
invalidate();
Index: mln/core/alias/box2d_h.hh
--- mln/core/alias/box2d_h.hh (revision 2228)
+++ mln/core/alias/box2d_h.hh (working copy)
@@ -46,7 +46,7 @@
*
*/
- typedef box_<point2d_h> box2d_h;
+ typedef box<point2d_h> box2d_h;
} // end of namespace mln
Index: mln/core/concept/window.hh
--- mln/core/concept/window.hh (revision 2228)
+++ mln/core/concept/window.hh (working copy)
@@ -30,6 +30,8 @@
/*! \file mln/core/concept/window.hh
* \brief Definition of the concept of mln::Window.
+ *
+ * \todo Operator== should test if the cmp is possible.
*/
# include <mln/core/concept/object.hh>
@@ -76,6 +78,12 @@
};
+ template <typename Wl, typename Wr>
+ bool operator==(const Window<Wl>& lhs, const Window<Wr>& rhs)
+ {
+ return exact(lhs).std_vector() == exact(rhs).std_vector();
+ }
+
# ifndef MLN_INCLUDE_ONLY
Index: mln/core/concept/doc/image.hh
--- mln/core/concept/doc/image.hh (revision 2228)
+++ mln/core/concept/doc/image.hh (working copy)
@@ -121,7 +121,7 @@
*/
typedef void pset;
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
@@ -136,7 +136,7 @@
*/
typedef void coord;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
@@ -172,7 +172,7 @@
*
* \return A bounding box of the image domain.
*/
- const box_<point>& bbox() const;
+ const box<point>& bbox() const;
/*! \brief Give the number of points of the image domain.
*/
Index: mln/core/concept/doc/weighted_window.hh
--- mln/core/concept/doc/weighted_window.hh (revision 2228)
+++ mln/core/concept/doc/weighted_window.hh (working copy)
@@ -56,10 +56,10 @@
*/
typedef void bkd_qiter;
- /// Point associated type.
+ /// Site associated type.
typedef void point;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef void dpoint;
/// Weight associated type.
Index: mln/core/concept/doc/dpoint.hh
--- mln/core/concept/doc/dpoint.hh (revision 2228)
+++ mln/core/concept/doc/dpoint.hh (working copy)
@@ -47,12 +47,12 @@
*/
enum { dim };
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
Index: mln/core/concept/doc/neighborhood.hh
--- mln/core/concept/doc/neighborhood.hh (revision 2228)
+++ mln/core/concept/doc/neighborhood.hh (working copy)
@@ -57,10 +57,10 @@
*/
typedef void bkd_niter;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef void dpoint;
- /// Point associated type.
+ /// Site associated type.
typedef void point;
};
Index: mln/core/concept/doc/point_site.hh
--- mln/core/concept/doc/point_site.hh (revision 2228)
+++ mln/core/concept/doc/point_site.hh (working copy)
@@ -54,12 +54,12 @@
*/
typedef void mesh;
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
Index: mln/core/grids.hh
--- mln/core/grids.hh (revision 2228)
+++ mln/core/grids.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -34,6 +34,7 @@
*/
# include <mln/core/concept/regular_grid.hh>
+# include <mln/core/def/coord.hh>
# include <mln/metal/bool.hh>
Index: mln/make/w_window.hh
--- mln/make/w_window.hh (revision 2228)
+++ mln/make/w_window.hh (working copy)
@@ -53,7 +53,7 @@
* \return A weighted window.
*/
template <typename W, typename F>
- mln::w_window<mln_dpoint(W), mln_result(F)>
+ mln::w_window<mln_dpsite(W), mln_result(F)>
w_window(const Window<W>& win, const Function_p2v<F>& wei);
@@ -61,13 +61,13 @@
template <typename W, typename F>
inline
- mln::w_window<mln_dpoint(W), mln_result(F)>
+ mln::w_window<mln_dpsite(W), mln_result(F)>
w_window(const Window<W>& win_, const Function_p2v<F>& wei_)
{
const W& win = exact(win_);
const F& wei = exact(wei_);
mln_precondition(! win.is_empty());
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
mln::w_window<D, mln_result(F)> w_win;
mln_qiter(W) q(win, P::origin);
Index: mln/convert/to_upper_window.hh
--- mln/convert/to_upper_window.hh (revision 2228)
+++ mln/convert/to_upper_window.hh (working copy)
@@ -46,7 +46,7 @@
/// Convert a window \p nbh into an upper window.
template <typename W>
- window<mln_dpoint(W)> to_upper_window(const Window<W>& win);
+ window<mln_dpsite(W)> to_upper_window(const Window<W>& win);
/// Convert a neighborhood \p nbh into an upper window.
template <typename N>
@@ -66,10 +66,10 @@
depth in milena/core/concepts/README. */
template <typename W>
inline
- window<mln_dpoint(W)> to_upper_window(const Window<W>& win_)
+ window<mln_dpsite(W)> to_upper_window(const Window<W>& win_)
{
const W& input_win = exact(win_);
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
window<D> win;
mln_qiter(W) q(input_win, P::origin);
Index: mln/convert/to_image.hh
--- mln/convert/to_image.hh (revision 2228)
+++ mln/convert/to_image.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/convert/to_image.hh
*
* \brief Conversions to mln::Image.
+ *
+ * \todo Remove. Use from_to instead...
*/
# include <mln/core/image/image1d.hh>
@@ -150,8 +152,8 @@
const W& win = exact(win_);
mln_precondition(! win.is_empty());
- typedef mln_point(W) P;
- box_<P> b = geom::bbox(win);
+ typedef mln_site(W) P;
+ box<P> b = geom::bbox(win);
mln_image_from(W, bool) ima(b);
level::fill(ima, false);
mln_qiter(W) q(win, P::origin);
@@ -174,8 +176,8 @@
const W& w_win = exact(w_win_);
mln_precondition(! w_win.is_empty());
- typedef mln_point(W) P;
- box_<P> b = geom::bbox(w_win);
+ typedef mln_site(W) P;
+ box<P> b = geom::bbox(w_win);
mln_image_from(W, mln_weight(W)) ima(b);
// Fill the image with zeros, as (weighted) windows are not
// necessarily box-shaped (there might be holes corresponding to
Index: mln/convert/to_std_set.hh
--- mln/convert/to_std_set.hh (revision 2228)
+++ mln/convert/to_std_set.hh (working copy)
@@ -48,19 +48,19 @@
/// Convert a window \p win into a std::set of delta-points.
template <typename W>
- std::set<mln_dpoint(W)> to_std_set(const Window<W>& win);
+ std::set<mln_dpsite(W)> to_std_set(const Window<W>& win);
/// Convert a point set \p pset into a std::set of points.
template <typename W>
- std::set<mln_point(W)> to_std_set(const Site_Set<W>& setp);
+ std::set<mln_site(W)> to_std_set(const Site_Set<W>& setp);
# ifndef MLN_INCLUDE_ONLY
template <typename W>
inline
- std::set<mln_dpoint(W)> to_std_set(const Window<W>& win)
+ std::set<mln_dpsite(W)> to_std_set(const Window<W>& win)
{
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
std::set<D> s;
mln_qiter(W) q(exact(win), P::origin);
@@ -71,9 +71,9 @@
template <typename W>
inline
- std::set<mln_point(W)> to_std_set(const Site_Set<W>& setp)
+ std::set<mln_site(W)> to_std_set(const Site_Set<W>& setp)
{
- typedef mln_point(W) P;
+ typedef mln_site(W) P;
std::set<P> s;
mln_piter(W) p(exact(setp));
for_all(p)
Index: mln/convert/to_p_set.hh
--- mln/convert/to_p_set.hh (revision 2228)
+++ mln/convert/to_p_set.hh (working copy)
@@ -61,7 +61,7 @@
/// Convert a Window \p win into a point set.
template <typename W>
- p_set<mln_point(W)> to_p_set(const Window<W>& win);
+ p_set<mln_site(W)> to_p_set(const Window<W>& win);
/// Convert an std::set \p s of points into a point set.
template <typename P>
@@ -110,10 +110,10 @@
template <typename W>
inline
- p_set<mln_point(W)> to_p_set(const Window<W>& win)
+ p_set<mln_site(W)> to_p_set(const Window<W>& win)
{
- typedef mln_dpoint(W) D;
- typedef mln_point(W) P;
+ typedef mln_dpsite(W) D;
+ typedef mln_site(W) P;
p_set<P> pset;
mln_qiter(W) q(exact(win), P::origin);
for_all(q)
Index: mln/geom/bbox.hh
--- mln/geom/bbox.hh (revision 2228)
+++ mln/geom/bbox.hh (working copy)
@@ -37,9 +37,15 @@
* "set::nsites(Site_Set)"...
*
* \todo Add a static check "domain is ok for bbox (like grid)".
+ *
+ * \todo Add the weighted_window case.
*/
# include <mln/core/concept/box.hh>
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/window.hh>
+# include <mln/literal/zero.hh>
+# include <mln/accu/bbox.hh>
namespace mln
@@ -58,6 +64,12 @@
box<mln_site(I)> bbox(const Image<I>& ima);
+ /// Compute the precise bounding box of a window \p win.
+ template <typename W>
+ box<mln_site(W)> bbox(const Window<W>& win);
+
+
+
# ifndef MLN_INCLUDE_ONLY
namespace impl
@@ -123,6 +135,17 @@
return geom::bbox(ima.domain());
}
+ template <typename W>
+ box<mln_site(W)> bbox(const Window<W>& win)
+ {
+ typedef mln_site(W) P;
+ accu::bbox<P> b;
+ mln_qiter(W) q(exact(win), literal::origin);
+ for_all(q)
+ b.take(q);
+ return b;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::geom
Index: mln/geom/sym.hh
--- mln/geom/sym.hh (revision 2228)
+++ mln/geom/sym.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -62,7 +62,8 @@
W sym(const Window<W>& win)
{
W tmp = exact(win);
- return tmp.sym();
+ tmp.sym();
+ return tmp;
}
template <typename W>
@@ -70,7 +71,8 @@
W sym(const Weighted_Window<W>& w_win)
{
W tmp = exact(w_win);
- return tmp.sym();
+ tmp.sym();
+ return tmp;
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/geom/shift.hh
--- mln/geom/shift.hh (revision 2228)
+++ mln/geom/shift.hh (working copy)
@@ -46,19 +46,19 @@
/// Shift a window \p win with a delta-point \p dp.
template <typename W>
- window<mln_dpoint(W)>
- shift(const Window<W>& win, const mln_dpoint(W)& dp);
+ window<mln_dpsite(W)>
+ shift(const Window<W>& win, const mln_dpsite(W)& dp);
# ifndef MLN_INCLUDE_ONLY
template <typename W>
inline
- window<mln_dpoint(W)>
- shift(const Window<W>& win, const mln_dpoint(W)& dp)
+ window<mln_dpsite(W)>
+ shift(const Window<W>& win, const mln_dpsite(W)& dp)
{
- typedef mln_point(W) P;
- window<mln_dpoint(W)> tmp;
+ typedef mln_site(W) P;
+ window<mln_dpsite(W)> tmp;
mln_qiter(W) q(win, P::origin);
for_all(q)
tmp.insert(convert::to(q) + dp);
Index: mln/win/vline2d.hh
--- mln/win/vline2d.hh (revision 2228)
+++ mln/win/vline2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -54,7 +54,7 @@
* o \n
* is defined with length = 3.
*/
- typedef line<grid::square, 0, int> vline2d;
+ typedef line<grid::square, 0, def::coord> vline2d;
} // end of namespace mln::win
Index: mln/win/hline2d.hh
--- mln/win/hline2d.hh (revision 2228)
+++ mln/win/hline2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -52,7 +52,7 @@
* o o x o o \n
* is defined with length = 5.
*/
- typedef line<grid::square, 1, int> hline2d;
+ typedef line<grid::square, 1, def::coord> hline2d;
} // end of namespace mln::win
Index: mln/win/cube3d.hh
--- mln/win/cube3d.hh (revision 2228)
+++ mln/win/cube3d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::cube3d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint3d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -64,29 +63,9 @@
* o o o \n
* is defined with length = 3.
*/
- struct cube3d : public Window< cube3d >,
+ struct cube3d : public internal::window_base< dpoint3d, cube3d >,
public internal::dpoints_base_< dpoint3d, cube3d >
{
- /// Point associated type.
- typedef point3d point;
-
- /// Dpoint associated type.
- typedef dpoint3d dpoint;
-
- /*! \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 Site_Iterator type to browse a cube such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus height, of the cube3d.
Index: mln/win/segment1d.hh
--- mln/win/segment1d.hh (revision 2228)
+++ mln/win/segment1d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -52,7 +52,7 @@
* o x o \n
* is defined with length = 3.
*/
- typedef line<grid::tick, 0, int> segment1d;
+ typedef line<grid::tick, 0, def::coord> segment1d;
} // end of namespace mln::win
Index: mln/win/line.hh
--- mln/win/line.hh (revision 2228)
+++ mln/win/line.hh (working copy)
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::line window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/dpoint.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -57,27 +56,9 @@
* \see mln::win::hline2d for an exemple of his use.
*/
template <typename M, unsigned i, typename C>
- struct line : public Window< line<M,i,C> >,
- public internal::dpoints_base_<dpoint<M, C>, point<M, C> >
+ struct line : public internal::window_base< dpoint<M, C>, line<M,i,C> >,
+ public internal::dpoints_base_< dpoint<M, C>, line<M,i,C> >
{
- /// Point associated type.
- typedef point<M, int> point;
-
- /// Psite associated type.
- typedef point psite;
-
- /// Dpoint associated type.
- typedef dpoint<M, int> dpoint;
-
- /// Site_Iterator type to browse a line forward
- typedef dpoints_fwd_piter<dpoint> fwd_qiter;
-
- /// Site_Iterator type to browse a line backward
- typedef dpoints_bkd_piter<dpoint> bkd_qiter;
-
- /// Same as fwd_qiter
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length of the line.
@@ -140,11 +121,11 @@
{
metal::bool_< i < M::dim >::check();
mln_precondition(length % 2 == 1);
+ dpoint<M,C> n;
+ n.set_all(0);
const int dc = length / 2;
for (int c = - dc; c <= dc; ++c)
{
- dpoint n;
- n.set_all(0);
n[i] = c;
this->insert(n);
}
Index: mln/win/rectangle2d.hh
--- mln/win/rectangle2d.hh (revision 2228)
+++ mln/win/rectangle2d.hh (working copy)
@@ -35,7 +35,9 @@
* \todo Reactivate includes at EOF.
*/
-# include <mln/core/alias/window2d.hh>
+# include <mln/core/internal/window_base.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/alias/dpoint2d.hh>
namespace mln
@@ -55,22 +57,9 @@
* o o o o o \n
* is defined with height = 3 and width = 5.
*/
- struct rectangle2d : public internal::window_base< dpoint2d, rectangle2d >
+ struct rectangle2d : public internal::window_base< dpoint2d, rectangle2d >,
+ public internal::dpoints_base_< dpoint2d, rectangle2d >
{
-
- /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpsites_fwd_piter<rectangle2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpsites_fwd_piter<rectangle2d> bkd_qiter;
-
- typedef fwd_qiter qiter;
-
-
/*! \brief Constructor.
*
* \param[in] height Height of the rectangle2d.
@@ -117,7 +106,6 @@
protected:
unsigned height_, width_;
- window2d win_;
};
@@ -146,7 +134,7 @@
const int drow = height / 2, dcol = width / 2;
for (int row = - drow; row <= drow; ++row)
for (int col = - dcol; col <= dcol; ++col)
- win_.insert(row, col);
+ this->insert(dpoint2d(row, col));
}
inline
@@ -215,8 +203,8 @@
// When rectangle2d is involved, one surely also wants:
-// # include <mln/win/hline2d.hh>
-// # include <mln/win/vline2d.hh>
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
#endif // ! MLN_WIN_RECTANGLE2D_HH
Index: mln/win/diag2d.hh
--- mln/win/diag2d.hh (revision 2228)
+++ mln/win/diag2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::diag2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -58,29 +57,9 @@
* o \n
* is defined with length = 5.
*/
- struct diag2d : public Window< diag2d >,
+ struct diag2d : public internal::window_base< dpoint2d, diag2d >,
public internal::dpoints_base_< dpoint2d, diag2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \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 Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus width, of the diagonal line.
Index: mln/win/backdiag2d.hh
--- mln/win/backdiag2d.hh (revision 2228)
+++ mln/win/backdiag2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::backdiag2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -58,29 +57,9 @@
* o \n
* is defined with length = 5.
*/
- struct backdiag2d : public Window< backdiag2d >,
+ struct backdiag2d : public internal::window_base< dpoint2d, backdiag2d >,
public internal::dpoints_base_< dpoint2d, backdiag2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \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 Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus width, of the diagonal line.
Index: mln/win/cuboid3d.hh
--- mln/win/cuboid3d.hh (revision 2228)
+++ mln/win/cuboid3d.hh (working copy)
@@ -31,10 +31,9 @@
/// \file mln/win/cuboid3d.hh
/// \brief Definition of the mln::win::cuboid3d window.
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint3d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -74,29 +73,9 @@
Reference:
http://en.wikipedia.org/wiki/Cuboid
*/
- struct cuboid3d : public Window< cuboid3d >,
+ struct cuboid3d : public internal::window_base< dpoint3d, cuboid3d >,
public internal::dpoints_base_< dpoint3d, cuboid3d >
{
- /// Point Site associated type.
- typedef point3d psite;
-
- /// Point associated type.
- typedef point3d point;
-
- /// Dpoint associated type.
- typedef dpoint3d dpoint;
-
- /// \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 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;
-
-
/// \brief Constructor.
///
/// \param[in] depth The depth of the cuboid3d.
Index: mln/win/octagon2d.hh
--- mln/win/octagon2d.hh (revision 2228)
+++ mln/win/octagon2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::octagon2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -62,29 +61,9 @@
* o o o \n
* is defined with L = 7 (l = 1).
*/
- struct octagon2d : public Window< octagon2d >,
+ struct octagon2d : public internal::window_base< dpoint2d, octagon2d >,
public internal::dpoints_base_< dpoint2d, octagon2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \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 Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, of the octagon.
Index: mln/win/disk2d.hh
--- mln/win/disk2d.hh (revision 2228)
+++ mln/win/disk2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::disk2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -50,29 +49,9 @@
* An disk2d is centered and symmetric.
*
*/
- struct disk2d : public Window< disk2d >,
+ struct disk2d : public internal::window_base< dpoint2d, disk2d >,
public internal::dpoints_base_< dpoint2d, disk2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \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 Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus diameter.
1
0
12 Sep '08
#65: Review the trunk/milena/mln/win directory.
----------------------+-----------------------------------------------------
Reporter: nivault | Owner: Olena Team
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/65#comment:3>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#55: Review the trunk/milena/mln/trait directory.
----------------------+-----------------------------------------------------
Reporter: theo | Owner: theo
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/55#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#77: Review the trunk/milena/mln/trace directory
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
-----------------------+----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/77#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0