27 #ifndef MLN_DATA_COMPARE_HH
28 # define MLN_DATA_COMPARE_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/fun/vv2b/eq.hh>
36 # include <mln/fun/vv2b/le.hh>
37 # include <mln/fun/vv2b/lt.hh>
38 # include <mln/test/predicate.hh>
54 template <
typename L,
typename R>
68 template <
typename L,
typename R>
69 bool operator < (const Image<L>& lhs,
const Image<R>&
rhs);
82 template <
typename L,
typename R>
83 bool operator <= (const Image<L>& lhs,
const Image<R>&
rhs);
87 # ifndef MLN_INCLUDE_ONLY
90 template <
typename L,
typename R>
92 bool operator == (
const Image<L>& lhs_,
const Image<R>& rhs_)
94 mln_trace(
"data::compare (==)");
96 const L& lhs =
exact(lhs_);
99 mln_precondition(lhs.is_valid());
100 mln_precondition(rhs.is_valid());
101 mln_precondition(lhs.domain() == rhs.domain());
103 typedef fun::vv2b::eq<mln_value(L), mln_value(R)> F;
110 template <
typename L,
typename R>
112 bool operator < (const Image<L>& lhs_,
const Image<R>& rhs_)
114 mln_trace(
"data::compare (<)");
116 const L& lhs =
exact(lhs_);
117 const R& rhs =
exact(rhs_);
119 mln_precondition(lhs.domain() == rhs.domain());
121 typedef fun::vv2b::lt<mln_value(L), mln_value(R)> F;
128 template <
typename L,
typename R>
130 bool operator <= (const Image<L>& lhs_,
const Image<R>& rhs_)
132 mln_trace(
"data::compare (<=)");
134 const L& lhs =
exact(lhs_);
135 const R& rhs =
exact(rhs_);
137 mln_precondition(lhs.domain() == rhs.domain());
139 typedef fun::vv2b::le<mln_value(L), mln_value(R)> F;
145 # endif // ! MLN_INCLUDE_ONLY
150 #endif // ! MLN_DATA_COMPARE_HH