* mln/morpho/line_gradient.hh (mln::morpho::line_gradient): Here.
---
milena/ChangeLog | 6 ++++++
milena/mln/morpho/line_gradient.hh | 9 +++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 329f88a..e225c93 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Improve the handling of a possibly unused variable in line_gradient.
+
+ * mln/morpho/line_gradient.hh (mln::morpho::line_gradient): Here.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix a bug in morpho::line_gradient.
* mln/morpho/line_gradient.hh (mln::morpho::line_gradient):
diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh
index c802d9a..f9b32b2 100644
--- a/milena/mln/morpho/line_gradient.hh
+++ b/milena/mln/morpho/line_gradient.hh
@@ -100,13 +100,10 @@ namespace mln
for_all (q)
if (ima.domain().has(q))
{
- // Avoid a warning about an undefined variable when the
- // NDEBUG is not defined.
-#ifdef NDEBUG
- g.add_edge(points[p], points[q]);
-#else // !NDEBUG
util::edge_id id = g.add_edge(points[p], points[q]);
-#endif //!NDEBUG
+ // Avoid a warning about an undefined variable when NDEBUG
+ // is not defined.
+ (void) id;
// The computed value is a norm of the gradient between P and Q.
edge_values.push_back(math::abs(ima(p) - ima(q)));
mln_assertion(id != mln_max(util::edge_id::equiv));
--
1.6.0.1
* mln/morpho/line_gradient.hh (mln::morpho::line_gradient):
Iterate on the domain, not the extensible domain.
---
milena/ChangeLog | 7 +++++++
milena/mln/morpho/line_gradient.hh | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0b74ec4..329f88a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix a bug in morpho::line_gradient.
+
+ * mln/morpho/line_gradient.hh (mln::morpho::line_gradient):
+ Iterate on the domain, not the extensible domain.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Use util::ord in morpho::line_gradient instead of ad hoc code.
* mln/morpho/line_gradient.hh
diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh
index fb42d13..c802d9a 100644
--- a/milena/mln/morpho/line_gradient.hh
+++ b/milena/mln/morpho/line_gradient.hh
@@ -98,7 +98,7 @@ namespace mln
mln_fwd_qiter_(window2d) q(next_c4_win, p);
for_all (p)
for_all (q)
- if (ima.has(q))
+ if (ima.domain().has(q))
{
// Avoid a warning about an undefined variable when the
// NDEBUG is not defined.
--
1.6.0.1