https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add inclusion operators for mln::p_graph and mln::p_line_graph.
* mln/core/p_graph.hh
(operator<=(const p_graph<P>&, const p_graph<P>&))
* mln/core/p_line_graph.hh
(operator<=(const p_line_graph<P>&, const p_line_graph<P>&)):
New operators.
p_graph.hh | 19 +++++++++++++++++++
p_line_graph.hh | 19 +++++++++++++++++++
2 files changed, 38 insertions(+)
Index: mln/core/p_graph.hh
--- mln/core/p_graph.hh (revision 1828)
+++ mln/core/p_graph.hh (working copy)
@@ -126,6 +126,18 @@
bool
operator==(const p_graph<P>& lhs, const p_graph<P>& rhs);
+ /// \brief Inclusion of a mln::p_graph in another one.
+ ///
+ /// This inclusion relation is very strict for the moment, since our
+ /// infrastrure for graphs i simple: a mln::p_graph is included
+ /// in another one if their are equal.
+ ///
+ /// \todo Refine this later, when we are able to express subgraph
+ /// relations.
+ template <typename P>
+ bool
+ operator<=(const p_graph<P>& lhs, const p_graph<P>& rhs);
+
# ifndef MLN_INCLUDE_ONLY
@@ -273,6 +285,13 @@
return lhs.gr_.ptr_ == rhs.gr_.ptr_;
}
+ template <typename P>
+ bool
+ operator<=(const p_graph<P>& lhs, const p_graph<P>& rhs)
+ {
+ return lhs == rhs;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of mln
Index: mln/core/p_line_graph.hh
--- mln/core/p_line_graph.hh (revision 1828)
+++ mln/core/p_line_graph.hh (working copy)
@@ -105,6 +105,18 @@
bool
operator==(const p_line_graph<P>& lhs, const p_line_graph<P>&
rhs);
+ /// \brief Inclusion of a mln::p_line_graph in another one.
+ ///
+ /// This inclusion relation is very strict for the moment, since our
+ /// infrastrure for graphs i simple: a mln::p_line_graph is included
+ /// in another one if their are equal.
+ ///
+ /// \todo Refine this later, when we are able to express subgraph
+ /// relations.
+ template <typename P>
+ bool
+ operator<=(const p_line_graph<P>& lhs, const p_line_graph<P>&
rhs);
+
# ifndef MLN_INCLUDE_ONLY
@@ -173,6 +185,13 @@
return lhs.gr_.ptr_ == rhs.gr_.ptr_;
}
+ template <typename P>
+ bool
+ operator<=(const p_line_graph<P>& lhs, const p_line_graph<P>&
rhs)
+ {
+ return lhs == rhs;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of mln