* mln/morpho/line_gradient.hh
(mln::morpho::internal::point2_lexicographical_less): Remove.
(mln::morpho::line_gradient()::points): Use util::ord<point2d>
instead of morpho::internal::point2d_lexicographical_less.
---
milena/ChangeLog | 9 +++++++++
milena/mln/morpho/line_gradient.hh | 21 +++------------------
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2180a84..0b74ec4 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
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
+ (mln::morpho::internal::point2_lexicographical_less): Remove.
+ (mln::morpho::line_gradient()::points): Use util::ord<point2d>
+ instead of morpho::internal::point2d_lexicographical_less.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Have morpho::line_gradient compile again
* 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 50c66dc..fb42d13 100644
--- a/milena/mln/morpho/line_gradient.hh
+++ b/milena/mln/morpho/line_gradient.hh
@@ -38,6 +38,8 @@
# include <mln/math/abs.hh>
+# include <mln/util/ord.hh>
+
# include <mln/core/image/image2d.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/core/image/line_graph_image.hh>
@@ -62,22 +64,6 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
- // FIXME: We should have mixins to add such a comparison operator.
- namespace internal
- {
- struct point2d_lexicographical_less
- : std::binary_function<const point2d&, const point2d&, bool>
- {
- bool operator()(const point2d& lhs, const point2d& rhs)
- {
- return
- lhs.row() < rhs.row() ||
- (lhs.row() == rhs.row() && lhs.col() < rhs.col());
- }
- };
- } // end of namespace mln::morpho::internal
-
-
template <typename T>
mln::line_graph_image<mln::point2d, T>
line_gradient(const mln::image2d<T>& ima)
@@ -92,8 +78,7 @@ namespace mln
exhibits the lack of a service from util::graph (or a another,
missing tool) regarding the retrieval of vertices' ids from
points. */
- std::map< mln::point2d, util::vertex_id,
- morpho::internal::point2d_lexicographical_less > points;
+ std::map< mln::point2d, util::vertex_id, util::ord<point2d> > points;
// Vertices.
std::vector<value_t> vertex_values;
--
1.6.0.1
Show replies by date