URL:
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008
ChangeLog:
2008-09-16 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix various test related files (again).
* milena/tests/convert/to_image.cc,
* milena/tests/convert/to_window.cc,
* milena/tests/histo/compute.cc,
* milena/tests/histo/to_image1d.cc,
* milena/tests/morpho/hit_or_miss.cc,
* milena/tests/morpho/thinning.cc,
* milena/tests/set/inter.cc,
* milena/tests/set/is_subset_of.cc,
* milena/tests/set/sym_diff.cc,
* milena/tests/set/uni.cc: Make the test compile.
* milena/mln/fun/x2x/rotation.hh,
* milena/mln/set/diff.hh,
* milena/mln/labeling/regional_minima.hh,
* milena/mln/border/resize.hh,
* milena/mln/level/fill.hh,
* milena/mln/level/fill_with_image.hh,
* milena/mln/level/fill_with_value.hh:
Avoid compilation warning when compiled with -DNDEBUG.
* milena/mln/convert/to_p_array.hh: Add a missing exact().
* milena/mln/set/inter.hh,
* milena/mln/convert/to_image.hh,
* milena/mln/convert/to_p_set.hh,
* milena/mln/convert/to_std_set.hh,
* milena/mln/convert/to_window.hh: Rename mln_point.
* milena/mln/core/alias/box1d.hh: Add full namespace name.
* milena/mln/draw/label.hh: Use sub_image instead of image_if_value.
* milena/mln/level/transform.spe.hh,
* milena/mln/level/median.hh: use values_eligible() instead of values().
* milena/mln/morpho/Rd.hh: Use greater_point instead of operator<.
* milena/mln/morpho/erosion.spe.hh: Add a missing include.
* milena/tests/morpho/Makefile.am: Disable graph related tests.
---
mln/border/resize.hh | 10 +++++++
mln/convert/to_image.hh | 6 ++--
mln/convert/to_p_array.hh | 5 ++-
mln/convert/to_p_set.hh | 30 ++++++++++++++-------
mln/convert/to_std_set.hh | 2 -
mln/convert/to_window.hh | 24 ++++++++---------
mln/core/alias/box1d.hh | 2 -
mln/draw/label.hh | 7 ++---
mln/fun/x2x/rotation.hh | 5 +++
mln/labeling/regional_minima.hh | 13 +++++++--
mln/level/fill.hh | 4 ++
mln/level/fill_with_image.hh | 5 +++
mln/level/fill_with_value.hh | 4 ++
mln/level/median.hh | 4 +-
mln/level/transform.spe.hh | 2 -
mln/morpho/Rd.hh | 5 ++-
mln/morpho/erosion.spe.hh | 1
mln/set/diff.hh | 11 +++++---
mln/set/inter.hh | 16 +++++------
tests/convert/to_image.cc | 1
tests/convert/to_window.cc | 14 +++++-----
tests/histo/compute.cc | 2 -
tests/histo/to_image1d.cc | 2 -
tests/morpho/Makefile.am | 4 +-
tests/morpho/hit_or_miss.cc | 2 +
tests/morpho/thinning.cc | 2 +
tests/set/inter.cc | 55 ++++++++++++++++++----------------------
tests/set/is_subset_of.cc | 41 +++++++++++++----------------
tests/set/sym_diff.cc | 48 ++++++++++++++++------------------
tests/set/uni.cc | 48 ++++++++++++++++------------------
30 files changed, 210 insertions(+), 165 deletions(-)
Index: branches/cleanup-2008/milena/tests/histo/compute.cc
===================================================================
--- branches/cleanup-2008/milena/tests/histo/compute.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/histo/compute.cc (revision 2280)
@@ -50,7 +50,7 @@
// Test on 'bool'.
{
- accu::histo< value::set<bool> > h;
+ accu::histo<bool> h;
for (unsigned i = 0; i < 5; ++i)
h.take(false);
Index: branches/cleanup-2008/milena/tests/histo/to_image1d.cc
===================================================================
--- branches/cleanup-2008/milena/tests/histo/to_image1d.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/histo/to_image1d.cc (revision 2280)
@@ -51,7 +51,7 @@
using value::int_u8;
{
- accu::histo< value::set<bool> > h;
+ accu::histo<bool> h;
for (unsigned i = 0; i < 5; ++i)
h.take(false);
Index: branches/cleanup-2008/milena/tests/convert/to_image.cc
===================================================================
--- branches/cleanup-2008/milena/tests/convert/to_image.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/convert/to_image.cc (revision 2280)
@@ -37,6 +37,7 @@
#include <mln/level/compare.hh>
#include <mln/convert/to_image.hh>
+#include <mln/convert/to.hh>
#include <mln/debug/println.hh>
Index: branches/cleanup-2008/milena/tests/convert/to_window.cc
===================================================================
--- branches/cleanup-2008/milena/tests/convert/to_window.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/convert/to_window.cc (revision 2280)
@@ -61,7 +61,10 @@
d(0,-1);
window2d ref;
- ref.insert(a).insert(b).insert(c).insert(d);
+ ref.insert(a);
+ ref.insert(b);
+ ref.insert(c);
+ ref.insert(d);
// Reference constructed.
// Nbh :
@@ -78,11 +81,10 @@
// Window :
p_set<point2d> setp;
- setp
- .insert(point2d::origin + a)
- .insert(point2d::origin + b)
- .insert(point2d::origin + c)
- .insert(point2d::origin + d);
+ setp.insert(point2d::origin + a);
+ setp.insert(point2d::origin + b);
+ setp.insert(point2d::origin + c);
+ setp.insert(point2d::origin + d);
window2d test_setp = convert::to_window(setp);
test(ref, test_setp);
Index: branches/cleanup-2008/milena/tests/set/uni.cc
===================================================================
--- branches/cleanup-2008/milena/tests/set/uni.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/set/uni.cc (revision 2280)
@@ -39,20 +39,18 @@
{
window<dpoint2d> win1;
- win1
- .insert( 2, 7)
- .insert( 2, 1)
- .insert(-4, 0)
- .insert( 0, 0)
- .insert( 1, 1)
- .insert( 6, 5);
+ win1.insert( 2, 7);
+ win1.insert( 2, 1);
+ win1.insert(-4, 0);
+ win1.insert( 0, 0);
+ win1.insert( 1, 1);
+ win1.insert( 6, 5);
window<dpoint2d> win2;
- win2
- .insert( 2, 7)
- .insert(-2, 1)
- .insert(-4, 0)
- .insert( 1,-1)
- .insert( 6, 5);
+ win2.insert( 2, 7);
+ win2.insert(-2, 1);
+ win2.insert(-4, 0);
+ win2.insert( 1,-1);
+ win2.insert( 6, 5);
window<dpoint2d> win3 = set::uni(win1, win2);
mln_assertion(win3.has(dpoint2d( 2, 1)));
mln_assertion(win3.has(dpoint2d( 0, 0)));
@@ -66,20 +64,18 @@
{
p_set<point2d> pst1;
- pst1
- .insert(point2d( 2, 7))
- .insert(point2d( 2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 0, 0))
- .insert(point2d( 1, 1))
- .insert(point2d( 6, 5));
+ pst1.insert(point2d( 2, 7));
+ pst1.insert(point2d( 2, 1));
+ pst1.insert(point2d(-4, 0));
+ pst1.insert(point2d( 0, 0));
+ pst1.insert(point2d( 1, 1));
+ pst1.insert(point2d( 6, 5));
p_set<point2d> pst2;
- pst2
- .insert(point2d( 2, 7))
- .insert(point2d(-2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 1,-1))
- .insert(point2d( 6, 5));
+ pst2.insert(point2d( 2, 7));
+ pst2.insert(point2d(-2, 1));
+ pst2.insert(point2d(-4, 0));
+ pst2.insert(point2d( 1,-1));
+ pst2.insert(point2d( 6, 5));
p_set<point2d> pst3 = set::uni(pst1, pst2);
mln_assertion(pst3.has(point2d( 2, 1)));
mln_assertion(pst3.has(point2d( 0, 0)));
Index: branches/cleanup-2008/milena/tests/set/sym_diff.cc
===================================================================
--- branches/cleanup-2008/milena/tests/set/sym_diff.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/set/sym_diff.cc (revision 2280)
@@ -39,20 +39,18 @@
{
window<dpoint2d> win1;
- win1
- .insert( 2, 7)
- .insert( 2, 1)
- .insert(-4, 0)
- .insert( 0, 0)
- .insert( 1, 1)
- .insert( 6, 5);
+ win1.insert( 2, 7);
+ win1.insert( 2, 1);
+ win1.insert(-4, 0);
+ win1.insert( 0, 0);
+ win1.insert( 1, 1);
+ win1.insert( 6, 5);
window<dpoint2d> win2;
- win2
- .insert( 2, 7)
- .insert(-2, 1)
- .insert(-4, 0)
- .insert( 1,-1)
- .insert( 6, 5);
+ win2.insert( 2, 7);
+ win2.insert(-2, 1);
+ win2.insert(-4, 0);
+ win2.insert( 1,-1);
+ win2.insert( 6, 5);
window<dpoint2d> win3 = set::sym_diff(win1, win2);
mln_assertion(win3.has(dpoint2d( 2, 1)));
mln_assertion(win3.has(dpoint2d( 0, 0)));
@@ -66,20 +64,18 @@
{
p_set<point2d> pst1;
- pst1
- .insert(point2d( 2, 7))
- .insert(point2d( 2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 0, 0))
- .insert(point2d( 1, 1))
- .insert(point2d( 6, 5));
+ pst1.insert(point2d( 2, 7));
+ pst1.insert(point2d( 2, 1));
+ pst1.insert(point2d(-4, 0));
+ pst1.insert(point2d( 0, 0));
+ pst1.insert(point2d( 1, 1));
+ pst1.insert(point2d( 6, 5));
p_set<point2d> pst2;
- pst2
- .insert(point2d( 2, 7))
- .insert(point2d(-2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 1,-1))
- .insert(point2d( 6, 5));
+ pst2.insert(point2d( 2, 7));
+ pst2.insert(point2d(-2, 1));
+ pst2.insert(point2d(-4, 0));
+ pst2.insert(point2d( 1,-1));
+ pst2.insert(point2d( 6, 5));;
p_set<point2d> pst3 = set::sym_diff(pst1, pst2);
mln_assertion(pst3.has(point2d( 2, 1)));
mln_assertion(pst3.has(point2d( 0, 0)));
Index: branches/cleanup-2008/milena/tests/set/inter.cc
===================================================================
--- branches/cleanup-2008/milena/tests/set/inter.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/set/inter.cc (revision 2280)
@@ -32,6 +32,7 @@
#include <mln/set/inter.hh>
#include <mln/core/alias/dpoint2d.hh>
+#include <mln/core/alias/window2d.hh>
int main()
@@ -39,22 +40,20 @@
using namespace mln;
{
- window<dpoint2d> win1;
- win1
- .insert( 2, 7)
- .insert( 2, 1)
- .insert(-4, 0)
- .insert( 0, 0)
- .insert( 1, 1)
- .insert( 6, 5);
- window<dpoint2d> win2;
- win2
- .insert( 2, 7)
- .insert(-2, 1)
- .insert(-4, 0)
- .insert( 1,-1)
- .insert( 6, 5);
- window<dpoint2d> win3 = set::inter(win1, win2);
+ window2d win1;
+ win1.insert( 2, 7);
+ win1.insert( 2, 1);
+ win1.insert(-4, 0);
+ win1.insert( 0, 0);
+ win1.insert( 1, 1);
+ win1.insert( 6, 5);
+ window2d win2;
+ win2.insert( 2, 7);
+ win2.insert(-2, 1);
+ win2.insert(-4, 0);
+ win2.insert( 1,-1);
+ win2.insert( 6, 5);
+ window2d win3 = set::inter(win1, win2);
mln_assertion(!win3.has(dpoint2d( 2, 1)));
mln_assertion(!win3.has(dpoint2d( 0, 0)));
mln_assertion(!win3.has(dpoint2d( 1, 1)));
@@ -67,20 +66,18 @@
{
p_set<point2d> pst1;
- pst1
- .insert(point2d( 2, 7))
- .insert(point2d( 2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 0, 0))
- .insert(point2d( 1, 1))
- .insert(point2d( 6, 5));
+ pst1.insert(point2d( 2, 7));
+ pst1.insert(point2d( 2, 1));
+ pst1.insert(point2d(-4, 0));
+ pst1.insert(point2d( 0, 0));
+ pst1.insert(point2d( 1, 1));
+ pst1.insert(point2d( 6, 5));
p_set<point2d> pst2;
- pst2
- .insert(point2d( 2, 7))
- .insert(point2d(-2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 1,-1))
- .insert(point2d( 6, 5));
+ pst2.insert(point2d( 2, 7));
+ pst2.insert(point2d(-2, 1));
+ pst2.insert(point2d(-4, 0));
+ pst2.insert(point2d( 1,-1));
+ pst2.insert(point2d( 6, 5));
p_set<point2d> pst3 = set::inter(pst1, pst2);
mln_assertion(!pst3.has(point2d( 2, 1)));
mln_assertion(!pst3.has(point2d( 0, 0)));
Index: branches/cleanup-2008/milena/tests/set/is_subset_of.cc
===================================================================
--- branches/cleanup-2008/milena/tests/set/is_subset_of.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/set/is_subset_of.cc (revision 2280)
@@ -43,28 +43,25 @@
p_set<point2d> pst2;
p_set<point2d> pst3;
p_set<point2d> pst4;
- pst1
- .insert(point2d( 2, 7))
- .insert(point2d( 2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 0, 0))
- .insert(point2d( 1, 1))
- .insert(point2d( 6, 5));
- pst2
- .insert(point2d( 2, 7))
- .insert(point2d(-2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 1,-1))
- .insert(point2d( 6, 5));
- pst3
- .insert(point2d( 2, 7))
- .insert(point2d( 2, 1))
- .insert(point2d(-4, 0))
- .insert(point2d( 0, 0))
- .insert(point2d( 1, 1))
- .insert(point2d( 6, 5))
- .insert(point2d(-2, 1))
- .insert(point2d( 1,-1));
+ pst1.insert(point2d( 2, 7));
+ pst1.insert(point2d( 2, 1));
+ pst1.insert(point2d(-4, 0));
+ pst1.insert(point2d( 0, 0));
+ pst1.insert(point2d( 1, 1));
+ pst1.insert(point2d( 6, 5));
+ pst2.insert(point2d( 2, 7));
+ pst2.insert(point2d(-2, 1));
+ pst2.insert(point2d(-4, 0));
+ pst2.insert(point2d( 1,-1));
+ pst2.insert(point2d( 6, 5));
+ pst3.insert(point2d( 2, 7));
+ pst3.insert(point2d( 2, 1));
+ pst3.insert(point2d(-4, 0));
+ pst3.insert(point2d( 0, 0));
+ pst3.insert(point2d( 1, 1));
+ pst3.insert(point2d( 6, 5));
+ pst3.insert(point2d(-2, 1));
+ pst3.insert(point2d( 1,-1));
mln_assertion(set::is_subset_of(pst1, pst3));
mln_assertion(set::is_subset_of(pst2, pst3));
Index: branches/cleanup-2008/milena/tests/morpho/thinning.cc
===================================================================
--- branches/cleanup-2008/milena/tests/morpho/thinning.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/morpho/thinning.cc (revision 2280)
@@ -43,6 +43,8 @@
#include <mln/morpho/thinning.hh>
+#include<mln/convert/to.hh>
+
#include "tests/data.hh"
Index: branches/cleanup-2008/milena/tests/morpho/hit_or_miss.cc
===================================================================
--- branches/cleanup-2008/milena/tests/morpho/hit_or_miss.cc (revision 2279)
+++ branches/cleanup-2008/milena/tests/morpho/hit_or_miss.cc (revision 2280)
@@ -44,6 +44,8 @@
#include <mln/morpho/hit_or_miss.hh>
+# include <mln/convert/to.hh>
+
#include "tests/data.hh"
Index: branches/cleanup-2008/milena/tests/morpho/Makefile.am
===================================================================
--- branches/cleanup-2008/milena/tests/morpho/Makefile.am (revision 2279)
+++ branches/cleanup-2008/milena/tests/morpho/Makefile.am (revision 2280)
@@ -17,9 +17,9 @@
gradient_elementary \
hit_or_miss \
laplacian \
- lena_line_graph_image_wst1 \
+## lena_line_graph_image_wst1 \
lena_line_graph_image_wst2 \
- line_graph_image_wst \
+## line_graph_image_wst \
meyer_wst \
meyer_wst_long \
opening_area \
Index: branches/cleanup-2008/milena/mln/core/alias/box1d.hh
===================================================================
--- branches/cleanup-2008/milena/mln/core/alias/box1d.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/core/alias/box1d.hh (revision 2280)
@@ -46,7 +46,7 @@
*
* \see mln::win::rectangle1d.
*/
- typedef box<point1d> box1d;
+ typedef box<mln::point1d> box1d;
} // end of namespace mln
Index: branches/cleanup-2008/milena/mln/draw/label.hh
===================================================================
--- branches/cleanup-2008/milena/mln/draw/label.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/draw/label.hh (revision 2280)
@@ -39,13 +39,12 @@
# include <mln/pw/cst.hh>
# include <mln/trait/image_from_mesh.hh>
-# include <mln/core/image_if_value.hh>
+# include <mln/core/image/sub_image.hh>
# include <mln/value/rgb8.hh>
# include <mln/level/fill.hh>
# include <mln/level/paste.hh>
# include <mln/core/site_set/p_set.hh>
# include <mln/metal/is_not.hh>
-# include <mln/core/image_if_value.hh>
# include <mln/debug/println.hh>
namespace mln
@@ -77,7 +76,7 @@
{
typedef mln_value(I) V;
typedef mln_ch_value(I, value::rgb8) O;
- typedef const mln::p_if<mln_pset(I),
mln::fun::eq_p2b_expr_<mln::pw::value_<I>, mln::pw::cst_<V> > > F;
+ typedef sub_image<I,V> F;
I in = exact(input);
mln_precondition(in.has_data());
@@ -102,7 +101,7 @@
break;
}
V val = ref(p);
- image_if_value<I> ima_if = ref | val;
+ F ima_if = ref | val;
mln_piter(F) l (ima_if.domain());
for_all (l)
out(l) = color;
Index: branches/cleanup-2008/milena/mln/level/fill_with_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/level/fill_with_image.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/level/fill_with_image.hh (revision 2280)
@@ -72,6 +72,11 @@
inline
void fill_with_image_tests(Image<I>& ima, const Image<J>&
data)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void)ima;
+ (void)data;
+
mlc_is(mln_trait_image_value_io(I),
mln::trait::image::value_io::read_write)::check();
mlc_converts_to(mln_value(J), mln_value(I))::check();
Index: branches/cleanup-2008/milena/mln/level/fill.hh
===================================================================
--- branches/cleanup-2008/milena/mln/level/fill.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/level/fill.hh (revision 2280)
@@ -72,6 +72,10 @@
inline
void fill_tests(Image<I>& ima, const D&)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) ima;
+
mlc_is(mln_trait_image_value_io(I), trait::image::value_io::read_write)::check();
mln_precondition(exact(ima).has_data());
// FIXME: check for ambiguities...
Index: branches/cleanup-2008/milena/mln/level/median.hh
===================================================================
--- branches/cleanup-2008/milena/mln/level/median.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/level/median.hh (revision 2280)
@@ -123,7 +123,7 @@
win(exact(win_)),
output(exact(output_)),
// aux data
- med(input.values()),
+ med(input.values_eligible()),
p(),
win_fp(set::diff(win, geom::shift(win, left))),
win_fm(set::diff(geom::shift(win, left), win)),
@@ -208,7 +208,7 @@
output(exact(output)),
// aux data
p(),
- med(input.values())
+ med(input.values_eligible())
{
}
Index: branches/cleanup-2008/milena/mln/level/transform.spe.hh
===================================================================
--- branches/cleanup-2008/milena/mln/level/transform.spe.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/level/transform.spe.hh (revision 2280)
@@ -85,7 +85,7 @@
const F& f = exact(f_);
O& output = exact(output_);
- value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values(), f);
+ value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values_eligible(), f);
mln_piter(I) p(input.domain());
for_all(p)
output(p) = lut(input(p));
Index: branches/cleanup-2008/milena/mln/level/fill_with_value.hh
===================================================================
--- branches/cleanup-2008/milena/mln/level/fill_with_value.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/level/fill_with_value.hh (revision 2280)
@@ -83,6 +83,10 @@
inline
void fill_with_value_tests(Image<I>& ima, const V&)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) ima;
+
mlc_is(mln_trait_image_value_io(I),
mln::trait::image::value_io::read_write)::check();
mlc_converts_to(mln_exact(V), mln_value(I))::check();
Index: branches/cleanup-2008/milena/mln/border/resize.hh
===================================================================
--- branches/cleanup-2008/milena/mln/border/resize.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/border/resize.hh (revision 2280)
@@ -113,6 +113,11 @@
void resize_(trait::image::ext_domain::none,
const I& ima, unsigned thickness)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) ima;
+ (void) thickness;
+
// No-op.
}
@@ -121,6 +126,11 @@
void resize_(trait::image::ext_domain::fixed,
const I& ima, unsigned thickness)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) ima;
+ (void) thickness;
+
// No-op.
}
Index: branches/cleanup-2008/milena/mln/convert/to_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/convert/to_image.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/convert/to_image.hh (revision 2280)
@@ -66,7 +66,7 @@
template <typename T>
struct helper_dim_
{
- typedef mln_site(T) P;
+ typedef mln_psite(T) P;
enum { value = P::dim };
};
@@ -152,7 +152,7 @@
const W& win = exact(win_);
mln_precondition(! win.is_empty());
- typedef mln_site(W) P;
+ typedef mln_psite(W) P;
box<P> b = geom::bbox(win);
mln_image_from(W, bool) ima(b);
level::fill(ima, false);
@@ -176,7 +176,7 @@
const W& w_win = exact(w_win_);
mln_precondition(! w_win.is_empty());
- typedef mln_site(W) P;
+ typedef mln_psite(W) P;
box<P> b = geom::bbox(w_win);
mln_image_from(W, mln_weight(W)) ima(b);
// Fill the image with zeros, as (weighted) windows are not
Index: branches/cleanup-2008/milena/mln/convert/to_std_set.hh
===================================================================
--- branches/cleanup-2008/milena/mln/convert/to_std_set.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/convert/to_std_set.hh (revision 2280)
@@ -61,7 +61,7 @@
std::set<mln_dpsite(W)> to_std_set(const Window<W>& win)
{
typedef mln_dpsite(W) D;
- typedef mln_point(D) P;
+ typedef mln_psite(D) P;
std::set<D> s;
mln_qiter(W) q(exact(win), P::origin);
for_all(q)
Index: branches/cleanup-2008/milena/mln/convert/to_window.hh
===================================================================
--- branches/cleanup-2008/milena/mln/convert/to_window.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/convert/to_window.hh (revision 2280)
@@ -59,7 +59,7 @@
// Default case.
template <typename N>
struct nbh_to_win_trait
- { typedef window<mln_dpoint(N)> ret; };
+ { typedef window<mln_dpsite(N)> ret; };
// Case of line_graph_elt_neighborhood<P>.
template <typename P>
@@ -75,11 +75,11 @@
template <typename I>
window<mln_dpsite(I)> to_window(const Image<I>& ima);
- /// Convert a point set \p pset into a window.
+ /// Convert a site set \p pset into a window.
template <typename S>
- window<mln_dpoint(S)> to_window(const Site_Set<S>& pset);
+ window<mln_dpsite(S)> to_window(const Site_Set<S>& pset);
- /// Convert an std::set \p s of delta-points into a window.
+ /// Convert an std::set \p s of delta-sites into a window.
template <typename D>
window<D> to_window(const std::set<D>& s);
@@ -95,11 +95,11 @@
template <typename N>
inline
- window<mln_dpoint(N)> to_window(const N& nbh_)
+ window<mln_dpsite(N)> to_window(const N& nbh_)
{
const N& nbh = exact(nbh_);
- typedef mln_dpoint(N) D;
- typedef mln_point(D) P;
+ typedef mln_dpsite(N) D;
+ typedef mln_psite(D) P;
window<D> win;
mln_niter(N) n(nbh, P::origin);
for_all(n)
@@ -131,9 +131,9 @@
`------------------------------*/
/* FIXME: According to milena/core/concepts/README, windows are
- not necessarily based on a set of dpoints. So the current
- algorithm won't work on non dpoint-set-based windows. In the
- general case (of windows not being a set of dpoints), the
+ not necessarily based on a set of dpsites. So the current
+ algorithm won't work on non dpsite-set-based windows. In the
+ general case (of windows not being a set of dpsites), the
window resulting from this conversion (as well as the iterators
based on such windows!) should depend on the initial
neighborhood (i.e., delegate the actual iteration to the
@@ -147,7 +147,7 @@
mln_precondition(ima.has_data());
// FIXME: Check that ima is binary!
typedef mln_dpsite(I) D;
- typedef mln_point(D) P;
+ typedef mln_psite(D) P;
window<D> win;
mln_piter(I) p(ima.domain());
for_all(p)
@@ -162,7 +162,7 @@
template <typename S>
inline
- window<mln_dpoint(S)> to_window(const Site_Set<S>& pset)
+ window<mln_dpsite(S)> to_window(const Site_Set<S>& pset)
{
return to_window(pw::cst(true) | pset);
}
Index: branches/cleanup-2008/milena/mln/convert/to_p_set.hh
===================================================================
--- branches/cleanup-2008/milena/mln/convert/to_p_set.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/convert/to_p_set.hh (revision 2280)
@@ -53,30 +53,36 @@
/// Convert a neighborhood \p nbh into a point set.
template <typename N>
- p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh);
+ p_set<mln_psite(N)>
+ to_p_set(const Neighborhood<N>& nbh);
/// Convert a binary image \p ima into a point set.
template <typename I>
- p_set<mln_psite(I)> to_p_set(const Image<I>& ima);
+ p_set<mln_psite(I)>
+ to_p_set(const Image<I>& ima);
/// Convert a Window \p win into a point set.
template <typename W>
- p_set<mln_site(W)> to_p_set(const Window<W>& win);
+ p_set<mln_psite(W)>
+ to_p_set(const Window<W>& win);
/// Convert an std::set \p s of points into a point set.
template <typename P>
- p_set<P> to_p_set(const std::set<P>& s);
+ p_set<P>
+ to_p_set(const std::set<P>& s);
/// Convert any point set \p ps into a 'mln::p_set' point set.
template <typename S>
- p_set<mln_psite(S)> to_p_set(const Site_Set<S>& ps);
+ p_set<mln_psite(S)>
+ to_p_set(const Site_Set<S>& ps);
# ifndef MLN_INCLUDE_ONLY
template <typename N>
inline
- p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh_)
+ p_set<mln_point(N)>
+ to_p_set(const Neighborhood<N>& nbh_)
{
const N& nbh = exact(nbh_);
typedef mln_dpoint(N) D;
@@ -90,7 +96,8 @@
template <typename I>
inline
- p_set<mln_psite(I)> to_p_set(const Image<I>& ima_)
+ p_set<mln_psite(I)>
+ to_p_set(const Image<I>& ima_)
{
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
@@ -110,7 +117,8 @@
template <typename W>
inline
- p_set<mln_site(W)> to_p_set(const Window<W>& win)
+ p_set<mln_site(W)>
+ to_p_set(const Window<W>& win)
{
typedef mln_site(W) P;
p_set<P> pset;
@@ -122,7 +130,8 @@
template <typename P>
inline
- p_set<P> to_p_set(const std::set<P>& s)
+ p_set<P>
+ to_p_set(const std::set<P>& s)
{
mln::metal::is_a<P, Point_Site>::check();
p_set<P> pset;
@@ -134,7 +143,8 @@
template <typename S>
inline
- p_set<mln_psite(S)> to_p_set(const Site_Set<S>& ps_)
+ p_set<mln_psite(S)>
+ to_p_set(const Site_Set<S>& ps_)
{
const S& ps = exact(ps_);
p_set<mln_psite(S)> tmp;
Index: branches/cleanup-2008/milena/mln/convert/to_p_array.hh
===================================================================
--- branches/cleanup-2008/milena/mln/convert/to_p_array.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/convert/to_p_array.hh (revision 2280)
@@ -78,11 +78,12 @@
template <typename W>
inline
- p_array<mln_psite(W)> to_p_array(const Window<W>& win,
+ p_array<mln_psite(W)> to_p_array(const Window<W>& win_,
const mln_psite(W)& p)
{
+ const W& win = exact(win_);
p_array<mln_psite(W)> v;
- v.reserve(exact(win).size());
+ v.reserve(win.size());
mln_qiter(W) q(win, p);
for_all(q)
v.append(q);
Index: branches/cleanup-2008/milena/mln/fun/x2x/rotation.hh
===================================================================
--- branches/cleanup-2008/milena/mln/fun/x2x/rotation.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/fun/x2x/rotation.hh (revision 2280)
@@ -100,6 +100,11 @@
algebra::h_mat<2, C>
get_rot_h_mat(const float alpha_, const algebra::vec<2,C>& axis_)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) alpha_;
+ (void) axis_;
+
assert(!"not implemented yet");
}
}
Index: branches/cleanup-2008/milena/mln/set/inter.hh
===================================================================
--- branches/cleanup-2008/milena/mln/set/inter.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/set/inter.hh (revision 2280)
@@ -52,7 +52,7 @@
* \relates mln::Window
*/
template <typename Wl, typename Wr>
- window<mln_dpoint(Wl)>
+ window<mln_dpsite(Wl)>
inter(const Window<Wl>& lhs, const Window<Wr>& rhs);
/*! \brief Intersection between a couple of point sets.
@@ -60,19 +60,19 @@
* \relates mln::Site_Set
*/
template <typename Wl, typename Wr>
- p_set<mln_point(Wl)>
+ p_set<mln_psite(Wl)>
inter(const Site_Set<Wl>& lhs, const Site_Set<Wr>& rhs);
# ifndef MLN_INCLUDE_ONLY
template <typename Wl, typename Wr>
inline
- window<mln_dpoint(Wl)>
+ window<mln_dpsite(Wl)>
inter(const Window<Wl>& lhs, const Window<Wr>& rhs)
{
trace::entering("set::inter");
- mln::metal::equal<mln_dpoint(Wl), mln_dpoint(Wr)>::check();
- typedef mln_dpoint(Wl) D;
+ mln::metal::equal<mln_dpsite(Wl), mln_dpsite(Wr)>::check();
+ typedef mln_dpsite(Wl) D;
std::set<D>
sl = convert::to_std_set(lhs),
sr = convert::to_std_set(rhs),
@@ -86,12 +86,12 @@
template <typename Wl, typename Wr>
inline
- p_set<mln_point(Wl)>
+ p_set<mln_psite(Wl)>
inter(const Site_Set<Wl>& lhs, const Site_Set<Wr>& rhs)
{
trace::entering("set::inter");
- mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check();
- typedef mln_point(Wl) P;
+ mln::metal::equal<mln_psite(Wl), mln_psite(Wr)>::check();
+ typedef mln_psite(Wl) P;
std::set<P>
sl = convert::to_std_set(lhs),
sr = convert::to_std_set(rhs),
Index: branches/cleanup-2008/milena/mln/set/diff.hh
===================================================================
--- branches/cleanup-2008/milena/mln/set/diff.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/set/diff.hh (revision 2280)
@@ -62,7 +62,7 @@
* \relates mln::Site_Set
*/
template <typename Wl, typename Wr>
- p_set<mln_point(Wl)>
+ p_set<mln_psite(Wl)>
diff(const Site_Set<Wl>& lhs, const Site_Set<Wr>& rhs);
@@ -96,11 +96,16 @@
template <typename Wl, typename Wr>
inline
- p_set<mln_site(Wl)>
+ p_set<mln_psite(Wl)>
diff(const Site_Set<Wl>& lhs, const Site_Set<Wr>& rhs)
{
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) lhs;
+ (void) rhs;
+
trace::entering("set::diff");
- p_set<mln_site(Wl)> s;
+ p_set<mln_psite(Wl)> s;
abort();
// mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check();
// typedef mln_point(Wl) P;
Index: branches/cleanup-2008/milena/mln/morpho/erosion.spe.hh
===================================================================
--- branches/cleanup-2008/milena/mln/morpho/erosion.spe.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/morpho/erosion.spe.hh (revision 2280)
@@ -32,6 +32,7 @@
# error "Forbidden inclusion of *.spe.hh"
# endif // ! MLN_MORPHO_EROSION_HH
+# include <mln/core/alias/window2d.hh>
# include <mln/win/octagon2d.hh>
# include <mln/win/rectangle2d.hh>
# include <mln/geom/shift.hh>
Index: branches/cleanup-2008/milena/mln/morpho/Rd.hh
===================================================================
--- branches/cleanup-2008/milena/mln/morpho/Rd.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/morpho/Rd.hh (revision 2280)
@@ -47,7 +47,7 @@
# include <mln/level/fill.hh>
# include <mln/level/compare.hh>
-
+# include <mln/util/greater_point.hh>
namespace mln
{
@@ -161,7 +161,8 @@
inline
bool is_proc__(const point& n, const point& p) const
{
- return g(n) > g(p) || (g(n) == g(p) && n < p);
+ util::greater_point<I> greater_than(g);
+ return g(n) > g(p) || (g(n) == g(p) && greater_than(p,n));
}
inline
Index: branches/cleanup-2008/milena/mln/labeling/regional_minima.hh
===================================================================
--- branches/cleanup-2008/milena/mln/labeling/regional_minima.hh (revision 2279)
+++ branches/cleanup-2008/milena/mln/labeling/regional_minima.hh (revision 2280)
@@ -88,9 +88,16 @@
bool labels(const P& p) const { return attr(p); }
bool equiv(const P& n, const P& p) const { return input(n) ==
input(p); }
- void do_no_union(const P& n, const P& p) { mln_invariant(input(n) <
- input(p));
- attr(p) = false; }
+ void do_no_union(const P& n, const P& p)
+ {
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void)n;
+
+ mln_invariant(input(n) < input(p));
+ attr(p) = false;
+ }
+
void init_attr(const P&) {}
void merge_attr(const P& r, const P& p) { attr(p) = attr(p) &&
attr(r); }