* mln/core/concept/image.hh: Always include data/compare.hh.
* tests/Makefile.am,
* tests/core/other/graph_elt_neighborhood.cc,
* mln/core/site_set/p_vertices.hh,
* mln/core/site_set/p_vertices_psite.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/site_iterator_base.hh: Revamp header.
* mln/core/site_set/p_array.hh: Add 'resize' member.
* mln/draw/line.hh: Make a warning more explicit.
* mln/fun/accu_result.hh: Fix guards.
* mln/labeling/superpose.hh: Add missing includes.
* mln/morpho/opening/all.hh: Reindent.
* mln/util/array.hh: Fix an invalid return type in obj_().
* mln/util/vertex.hh: Add a missing precondition.
* mln/value/lut_vec.hh: Fix wrong documentation.
---
milena/ChangeLog | 29 +++++++++++++++++++++
milena/mln/core/concept/image.hh | 1 +
milena/mln/core/internal/image_base.hh | 3 +-
milena/mln/core/internal/site_iterator_base.hh | 3 +-
milena/mln/core/site_set/p_array.hh | 14 +++++++++-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/core/site_set/p_vertices_psite.hh | 13 +++++++--
milena/mln/draw/line.hh | 9 ++++--
milena/mln/fun/accu_result.hh | 5 ++-
milena/mln/labeling/superpose.hh | 2 +
milena/mln/morpho/opening/all.hh | 15 +++++------
milena/mln/util/array.hh | 14 ++++++---
milena/mln/util/vertex.hh | 4 ++-
milena/mln/value/lut_vec.hh | 6 ++--
milena/tests/Makefile.am | 3 +-
milena/tests/core/other/graph_elt_neighborhood.cc | 3 +-
16 files changed, 96 insertions(+), 32 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5f80dc6..1d123b0 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,32 @@
+2009-08-19 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes.
+
+ * mln/core/concept/image.hh: Always include data/compare.hh.
+
+ * tests/Makefile.am,
+ * tests/core/other/graph_elt_neighborhood.cc,
+ * mln/core/site_set/p_vertices.hh,
+ * mln/core/site_set/p_vertices_psite.hh,
+ * mln/core/internal/image_base.hh,
+ * mln/core/internal/site_iterator_base.hh: Revamp header.
+
+ * mln/core/site_set/p_array.hh: Add 'resize' member.
+
+ * mln/draw/line.hh: Make a warning more explicit.
+
+ * mln/fun/accu_result.hh: Fix guards.
+
+ * mln/labeling/superpose.hh: Add missing includes.
+
+ * mln/morpho/opening/all.hh: Reindent.
+
+ * mln/util/array.hh: Fix an invalid return type in obj_().
+
+ * mln/util/vertex.hh: Add a missing precondition.
+
+ * mln/value/lut_vec.hh: Fix wrong documentation.
+
2009-08-17 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Some changes to help Edwin find a bug.
diff --git a/milena/mln/core/concept/image.hh b/milena/mln/core/concept/image.hh
index 8c620bc..6c0d860 100644
--- a/milena/mln/core/concept/image.hh
+++ b/milena/mln/core/concept/image.hh
@@ -47,6 +47,7 @@
# include <mln/tag/init.hh>
+# include <mln/data/compare.hh>
namespace mln
{
diff --git a/milena/mln/core/internal/image_base.hh
b/milena/mln/core/internal/image_base.hh
index 8975256..f1ba4f9 100644
--- a/milena/mln/core/internal/image_base.hh
+++ b/milena/mln/core/internal/image_base.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/core/internal/site_iterator_base.hh
b/milena/mln/core/internal/site_iterator_base.hh
index e5fd07d..4f45287 100644
--- a/milena/mln/core/internal/site_iterator_base.hh
+++ b/milena/mln/core/internal/site_iterator_base.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh
index 27c739b..218a95a 100644
--- a/milena/mln/core/site_set/p_array.hh
+++ b/milena/mln/core/site_set/p_array.hh
@@ -145,6 +145,9 @@ namespace mln
/// Clear this set.
void clear();
+ /// Update the size of this array.
+ void resize(size_t size);
+
/// Return the \p i-th site (constant).
const P& operator[](unsigned i) const;
@@ -211,7 +214,7 @@ namespace mln
bool is_valid() const;
operator util::index() const;
- operator int() const; // To interoperate, e.g., with fun::i2v expecting an int.
+ operator int() const; // To interoperate, e.g., with fun::i2v expecting an int.
operator unsigned() const; // To avoid ambiguity when an unsigned is expected.
void update_() const;
@@ -437,6 +440,15 @@ namespace mln
template <typename P>
inline
+ void
+ p_array<P>::resize(size_t size)
+ {
+ mln_precondition(size >= 0);
+ vect_.resize(size);
+ }
+
+ template <typename P>
+ inline
const P&
p_array<P>::operator[](unsigned i) const
{
diff --git a/milena/mln/core/site_set/p_vertices.hh
b/milena/mln/core/site_set/p_vertices.hh
index ddb6a7c..c8497c0 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -1,5 +1,5 @@
-
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/core/site_set/p_vertices_psite.hh
b/milena/mln/core/site_set/p_vertices_psite.hh
index 8249f74..320796f 100644
--- a/milena/mln/core/site_set/p_vertices_psite.hh
+++ b/milena/mln/core/site_set/p_vertices_psite.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -38,9 +39,14 @@
namespace mln
{
- // Forward declaration.
+ // Forward declarations.
template <typename G, typename F> class p_vertices;
- namespace internal { template <typename Subject, typename E> struct subject_impl;
}
+ namespace internal
+ {
+
+ template <typename Subject, typename E> struct subject_impl;
+
+ }
template <typename G, typename F>
@@ -187,6 +193,7 @@ namespace mln
} // end of namespace mln::internal
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
diff --git a/milena/mln/draw/line.hh b/milena/mln/draw/line.hh
index 74445be..f5cbffb 100644
--- a/milena/mln/draw/line.hh
+++ b/milena/mln/draw/line.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -73,8 +74,10 @@ namespace mln
{
I& ima = exact(ima_);
mln_precondition(ima.is_valid());
- if (! ima.has(beg) || ! ima.has(end))
- trace::warning("Begin or end site is not part of the given image.");
+ if (! ima.has(beg))
+ trace::warning("Begin site is not part of the given image.");
+ if (! ima.has(end))
+ trace::warning("End site is not part of the given image.");
data::paste(pw::cst(v) | p_line2d(beg, end),
safe(ima).rw());
}
diff --git a/milena/mln/fun/accu_result.hh b/milena/mln/fun/accu_result.hh
index da36fc2..77bf47a 100644
--- a/milena/mln/fun/accu_result.hh
+++ b/milena/mln/fun/accu_result.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -66,4 +67,4 @@ namespace mln
} // end of namespace mln
-#endif /* ! MLN_FUN_ACCU_RESULT_HH */
+#endif // ! MLN_FUN_ACCU_RESULT_HH
diff --git a/milena/mln/labeling/superpose.hh b/milena/mln/labeling/superpose.hh
index 2054649..7d0b3e3 100644
--- a/milena/mln/labeling/superpose.hh
+++ b/milena/mln/labeling/superpose.hh
@@ -34,6 +34,8 @@
# include <mln/core/concept/image.hh>
# include <mln/util/array.hh>
# include <mln/labeling/relabel.hh>
+# include <mln/data/paste.hh>
+# include <mln/pw/all.hh>
namespace mln
{
diff --git a/milena/mln/morpho/opening/all.hh b/milena/mln/morpho/opening/all.hh
index 7092503..ccfd1d5 100644
--- a/milena/mln/morpho/opening/all.hh
+++ b/milena/mln/morpho/opening/all.hh
@@ -31,13 +31,12 @@
/// File that includes all opening operators.
-#include <mln/morpho/opening/algebraic.hh>
-#include <mln/morpho/opening/area.hh>
-#include <mln/morpho/opening/area_on_vertices.hh>
-#include <mln/morpho/opening/height.hh>
-#include <mln/morpho/opening/leveling.hh>
-#include <mln/morpho/opening/structural.hh>
-#include <mln/morpho/opening/volume.hh>
-
+# include <mln/morpho/opening/algebraic.hh>
+# include <mln/morpho/opening/area.hh>
+# include <mln/morpho/opening/area_on_vertices.hh>
+# include <mln/morpho/opening/height.hh>
+# include <mln/morpho/opening/leveling.hh>
+# include <mln/morpho/opening/structural.hh>
+# include <mln/morpho/opening/volume.hh>
#endif // ! MLN_MORPHO_OPENING_ALL_HH
diff --git a/milena/mln/util/array.hh b/milena/mln/util/array.hh
index d94534d..b9f4798 100644
--- a/milena/mln/util/array.hh
+++ b/milena/mln/util/array.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -223,6 +224,7 @@ namespace mln
array_fwd_iter<T> >
{
public:
+ typedef typename array<T>::ro_result subj_t;
/// Constructors
/// @{
@@ -252,7 +254,7 @@ namespace mln
T element() const;
// As a Proxy.
- T subj_();
+ subj_t subj_();
/// Give the current index.
unsigned index_() const;
@@ -273,6 +275,8 @@ namespace mln
array_bkd_iter<T> >
{
public:
+ typedef typename array<T>::ro_result subj_t;
+
/// Constructors
/// @{
/// Constructor without argument.
@@ -301,7 +305,7 @@ namespace mln
T element() const;
// As a Proxy.
- T subj_();
+ subj_t subj_();
/// Give the current index.
unsigned index_() const;
@@ -639,7 +643,7 @@ namespace mln
template <typename T>
inline
- T
+ typename array_fwd_iter<T>::subj_t
array_fwd_iter<T>::subj_()
{
mln_precondition(is_valid());
@@ -733,7 +737,7 @@ namespace mln
template <typename T>
inline
- T
+ typename array_bkd_iter<T>::subj_t
array_bkd_iter<T>::subj_()
{
mln_precondition(is_valid());
diff --git a/milena/mln/util/vertex.hh b/milena/mln/util/vertex.hh
index f6bece5..e1a151c 100644
--- a/milena/mln/util/vertex.hh
+++ b/milena/mln/util/vertex.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -327,6 +328,7 @@ namespace mln
void
vertex<G>::change_graph(const G& g)
{
+ mln_precondition(g.is_valid());
g_ = g;
}
diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh
index 58379d7..7886dc1 100644
--- a/milena/mln/value/lut_vec.hh
+++ b/milena/mln/value/lut_vec.hh
@@ -95,15 +95,15 @@ namespace mln
/// Constructors
/// @{
- /// Constructor from a Site_set and any Function_v2v.
+ /// Constructor from a value set and any Function_v2v.
template <typename F>
lut_vec(const S& vset, const Function_v2v<F>& f);
- /// Constructor from a Site_set and any fun::i2v::array.
+ /// Constructor from a value set and any fun::i2v::array.
template <typename V>
lut_vec(const S& vset, const Function_v2v< fun::i2v::array<V>
>& f);
- /// Constructor from a Site_set and any util::array.
+ /// Constructor from a value set and any util::array.
template <typename V>
lut_vec(const S& vset, const Function_v2v< util::array<V> >&
f);
/// @}
diff --git a/milena/tests/Makefile.am b/milena/tests/Makefile.am
index b4acaa9..39987d0 100644
--- a/milena/tests/Makefile.am
+++ b/milena/tests/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+# Laboratory (LRDE).
#
# This file is part of Olena.
#
diff --git a/milena/tests/core/other/graph_elt_neighborhood.cc
b/milena/tests/core/other/graph_elt_neighborhood.cc
index 40b8cea..7206d92 100644
--- a/milena/tests/core/other/graph_elt_neighborhood.cc
+++ b/milena/tests/core/other/graph_elt_neighborhood.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
--
1.5.6.5