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;
}