https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Minor cleanup in set diff and geom shift.
* mln/core/dpoints_pixter.hh: Remove dead code.
* mln/geom/shift.hh: New static check.
* mln/set/diff.hh: New static checks.
(diff): De-activate the erroneous version with Site_Set.
core/dpoints_pixter.hh | 2 --
geom/shift.hh | 1 +
set/diff.hh | 30 +++++++++++++++++-------------
3 files changed, 18 insertions(+), 15 deletions(-)
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh (revision 2242)
+++ mln/core/dpoints_pixter.hh (working copy)
@@ -226,7 +226,6 @@
{
mln_precondition(image.has_data());
internal::get_adr(p_ref_, p_ref);
-// p_ref_ = & exact(p_ref).to_site();
value_ref_ = 0;
init_(dps);
}
@@ -338,7 +337,6 @@
{
mln_precondition(image.has_data());
internal::get_adr(p_ref_, p_ref);
-// p_ref_ = & exact(p_ref).to_site();
value_ref_ = 0;
init_(dps);
}
Index: mln/geom/shift.hh
--- mln/geom/shift.hh (revision 2242)
+++ mln/geom/shift.hh (working copy)
@@ -56,6 +56,7 @@
window<mln_dpsite(W)>
shift(const Window<W>& win_, const mln_dpsite(W)& dp)
{
+ mlc_is_a(mln_site(W), Gpoint)::check();
const W& win = exact(win_);
window<mln_dpsite(W)> tmp;
Index: mln/set/diff.hh
--- mln/set/diff.hh (revision 2242)
+++ mln/set/diff.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -74,7 +74,9 @@
diff(const Window<Wl>& lhs_, const Window<Wr>& rhs_)
{
trace::entering("set::diff");
- mlc_equal(mln_dpsite(Wl), mln_dpsite(Wr))::check();
+ mlc_is_a(mln_site(Wl), Gpoint)::check();
+ mlc_is_a(mln_site(Wr), Gpoint)::check();
+ mlc_converts_to(mln_dpsite(Wl), mln_dpsite(Wr))::check();
const Wl& lhs = exact(lhs_);
const Wr& rhs = exact(rhs_);
@@ -94,21 +96,23 @@
template <typename Wl, typename Wr>
inline
- p_set<mln_point(Wl)>
+ p_set<mln_site(Wl)>
diff(const Site_Set<Wl>& lhs, const Site_Set<Wr>& rhs)
{
trace::entering("set::diff");
- mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check();
- typedef mln_point(Wl) P;
- std::set<P>
- sl = convert::to_std_set(lhs),
- sr = convert::to_std_set(rhs),
- s;
- std::set_difference(sl.begin(), sl.end(),
- sr.begin(), sr.end(),
- std::inserter(s, s.begin()));
+ p_set<mln_site(Wl)> s;
+ abort();
+// mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check();
+// typedef mln_point(Wl) P;
+// std::set<P>
+// sl = convert::to_std_set(lhs),
+// sr = convert::to_std_set(rhs),
+// s;
+// std::set_difference(sl.begin(), sl.end(),
+// sr.begin(), sr.end(),
+// std::inserter(s, s.begin()));
trace::exiting("set::diff");
- return convert::to_p_set(s);
+ return s;
}
# endif // ! MLN_INCLUDE_ONLY