* milena/mln/util/graph.hh: add is_valid and invalidate. These methods
should be fixed later.
* milena/mln/core/site_set/p_edges.hh,
* milena/mln/core/site_set/p_vertices.hh,
* milena/mln/util/edge.hh,
* milena/mln/util/vertex.hh: make use of the new graph methods.
---
milena/ChangeLog | 12 ++++++++++++
milena/mln/core/site_set/p_edges.hh | 7 ++++---
milena/mln/core/site_set/p_vertices.hh | 7 ++++---
milena/mln/util/edge.hh | 7 ++++---
milena/mln/util/graph.hh | 25 +++++++++++++++++++++++--
milena/mln/util/vertex.hh | 5 +++--
6 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f0f8199..cc285f0 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,17 @@
2009-01-05 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add is_valid and invalidate to util::graph
+
+ * milena/mln/util/graph.hh: add is_valid and invalidate. These methods
+ should be fixed later.
+
+ * milena/mln/core/site_set/p_edges.hh,
+ * milena/mln/core/site_set/p_vertices.hh,
+ * milena/mln/util/edge.hh,
+ * milena/mln/util/vertex.hh: make use of the new graph methods.
+
+2009-01-05 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add graph_elt_neighborhood and line_graph_elt_neighborhood aliases.
* milena/headers.mk: add new headers to distribution.
diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh
index a987e73..5111c93 100644
--- a/milena/mln/core/site_set/p_edges.hh
+++ b/milena/mln/core/site_set/p_edges.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -204,7 +205,7 @@ namespace mln
bool
p_edges<G, F>::is_valid() const
{
- return true;/* FIXME: g.is_valid(); */
+ return g_.is_valid();
}
template <typename G, typename F>
@@ -212,7 +213,7 @@ namespace mln
void
p_edges<G, F>::invalidate()
{
- /* FIXME: g.invalidate(); */
+ g_.invalidate();
}
template <typename G, typename F>
diff --git a/milena/mln/core/site_set/p_vertices.hh
b/milena/mln/core/site_set/p_vertices.hh
index cf78f0a..a095af3 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -227,7 +228,7 @@ namespace mln
bool
p_vertices<G,F>::is_valid() const
{
- return true; /* FIXME: g_.is_valid() */;
+ return g_.is_valid();
}
template <typename G, typename F>
@@ -235,7 +236,7 @@ namespace mln
void
p_vertices<G,F>::invalidate()
{
- /* FIXME: g_.invalidate() ;*/
+ g_.invalidate();
}
template <typename G, typename F>
diff --git a/milena/mln/util/edge.hh b/milena/mln/util/edge.hh
index e98370b..9d9c3fc 100644
--- a/milena/mln/util/edge.hh
+++ b/milena/mln/util/edge.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -201,7 +202,7 @@ namespace mln
edge<G>::edge(const G& g, unsigned id)
: g_(g), id_(id)
{
- mln_precondition(/* FIXME: g_.is_valid() && */ g.has_e(id));
+ mln_precondition(g_.is_valid() && g.has_e(id));
}
template <typename G>
@@ -248,7 +249,7 @@ namespace mln
bool
edge<G>::is_valid() const
{
- return /* FIXME: g_.is_valid() && */ g_.has_e(id_);
+ return g_.is_valid() && g_.has_e(id_);
}
template <typename G>
diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh
index a3f5df5..2aed416 100644
--- a/milena/mln/util/graph.hh
+++ b/milena/mln/util/graph.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -143,6 +143,12 @@ namespace mln
graph(unsigned nvertices);
+ /// Return true if this graph is valid.
+ /// FIXME: currently it always returns true.
+ bool is_valid() const;
+ /// Invalidate the graph.
+ /// FIXME: does nothing!
+ void invalidate();
/// Vertex oriented.
/// \{
@@ -282,6 +288,21 @@ namespace mln
this->data_ = new mln::internal::data<util::graph>(nvertices);
}
+ inline
+ bool
+ graph::is_valid() const
+ {
+ //FIXME: should not always return true!
+ return true;
+ }
+
+ inline
+ void
+ graph::invalidate()
+ {
+ //FIXME: No op! Should do something.
+ }
+
/*---------------.
| Vertex related |
`---------------*/
diff --git a/milena/mln/util/vertex.hh b/milena/mln/util/vertex.hh
index fcb6f5b..9b55f9b 100644
--- a/milena/mln/util/vertex.hh
+++ b/milena/mln/util/vertex.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -205,7 +206,7 @@ namespace mln
bool
vertex<G>::is_valid() const
{
- return /* FIXME: g_.is_valid() && */ g_.has_v(id_);
+ return g_.is_valid() && g_.has_v(id_);
}
template<typename G>
--
1.5.6.5