* mln/topo/face.hh
(operator!=(const face<D>&, const face<D>&))
* mln/topo/n_face.hh
(operator!=(const n_face<N, D>&, const n_face<N, D>&)):
New operators.
---
milena/ChangeLog | 10 ++++++++++
milena/mln/topo/face.hh | 25 +++++++++++++++++++++----
milena/mln/topo/n_face.hh | 25 +++++++++++++++++++++----
3 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c2b1c36..583c73e 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,15 @@
2008-10-05 Roland Levillain <roland(a)lrde.epita.fr>
+ Add operator!= on face handles.
+
+ * mln/topo/face.hh
+ (operator!=(const face<D>&, const face<D>&))
+ * mln/topo/n_face.hh
+ (operator!=(const n_face<N, D>&, const n_face<N, D>&)):
+ New operators.
+
+2008-10-05 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a centered window of lower/higher-dim. adjacent complex faces.
* mln/core/image/complex_lower_higher_neighborhood.hh: New.
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
index 686c50a..ac02877 100644
--- a/milena/mln/topo/face.hh
+++ b/milena/mln/topo/face.hh
@@ -121,13 +121,20 @@ namespace mln
/// Comparison of two instances of mln::topo::face.
/// \{
+
/// \brief Is \a lhs equal to \a rhs?
///
/// \pre Arguments \a lhs and \a rhs must belong to the same
/// mln::topo::complex.
template <unsigned D>
- bool
- operator==(const face<D>& lhs, const face<D>& rhs);
+ bool operator==(const face<D>& lhs, const face<D>& rhs);
+
+ /// \brief Is \a lhs different from \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned D>
+ bool operator!=(const face<D>& lhs, const face<D>& rhs);
/// \brief Is \a lhs ``less'' than \a rhs?
///
@@ -137,8 +144,8 @@ namespace mln
/// mln::topo::complex.
/// \pre Arguments \a lhs and \a rhs must have the same dimension.
template <unsigned D>
- bool
- operator< (const face<D>& lhs, const face<D>& rhs);
+ bool operator< (const face<D>& lhs, const face<D>& rhs);
+
/// \}
@@ -387,6 +394,16 @@ namespace mln
template <unsigned D>
inline
bool
+ operator!=(const face<D>& lhs, const face<D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return !(lhs == rhs);
+ }
+
+ template <unsigned D>
+ inline
+ bool
operator< (const face<D>& lhs, const face<D>& rhs)
{
// Ensure LHS and RHS belong to the same complex.
diff --git a/milena/mln/topo/n_face.hh b/milena/mln/topo/n_face.hh
index 343f7b0..6cf3b37 100644
--- a/milena/mln/topo/n_face.hh
+++ b/milena/mln/topo/n_face.hh
@@ -110,13 +110,20 @@ namespace mln
/// Comparison of two instances of mln::topo::n_face.
/// \{
+
/// \brief Is \a lhs equal to \a rhs?
///
/// \pre Arguments \a lhs and \a rhs must belong to the same
/// mln::topo::complex.
template <unsigned N, unsigned D>
- bool
- operator==(const n_face<N, D>& lhs, const n_face<N, D>& rhs);
+ bool operator==(const n_face<N, D>& lhs, const n_face<N, D>&
rhs);
+
+ /// \brief Is \a lhs different from \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned N, unsigned D>
+ bool operator!=(const n_face<N, D>& lhs, const n_face<N, D>&
rhs);
/// \brief Is \a lhs ``less'' than \a rhs?
///
@@ -125,8 +132,8 @@ namespace mln
/// \pre Arguments \a lhs and \a rhs must belong to the same
/// mln::topo::complex.
template <unsigned N, unsigned D>
- bool
- operator< (const n_face<N, D>& lhs, const n_face<N, D>& rhs);
+ bool operator< (const n_face<N, D>& lhs, const n_face<N, D>&
rhs);
+
/// \}
@@ -246,6 +253,16 @@ namespace mln
template <unsigned N, unsigned D>
inline
bool
+ operator!=(const n_face<N, D>& lhs, const n_face<N, D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return !(lhs == rhs);
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ bool
operator< (const n_face<N, D>& lhs, const n_face<N, D>& rhs)
{
// Ensure LHS and RHS belong to the same complex.
--
1.6.0.1