26 #ifndef MLN_WIN_DIFF_HH
27 # define MLN_WIN_DIFF_HH
33 # include <mln/trait/op/minus.hh>
34 # include <mln/core/window.hh>
35 # include <mln/core/neighb.hh>
48 template <
typename W1,
typename W2>
56 template <typename N1, typename N2>
67 template <typename W1, typename W2>
74 template <typename N1, typename N2>
75 neighb<mln_deduce(N1, window, regular)>
82 template <
typename W1,
typename W2>
89 template <
typename N1,
typename N2>
99 # ifndef MLN_INCLUDE_ONLY
104 template <
typename W1,
typename W2>
107 diff(const Window<W1>& win1_, const Window<W2>& win2_)
109 mln_trace(
"win::diff");
111 mln_is_simple_window(W1)::check();
112 mln_is_simple_window(W2)::check();
114 const W1& win1 =
exact(win1_);
118 const
unsigned n = win1.size();
119 for (
unsigned i = 0; i < n; ++i)
121 if (win2.has(win1.dp(i)))
123 tmp.insert(win1.dp(i));
129 template <
typename N1,
typename N2>
130 neighb<mln_deduce(N1, window, regular)>
131 diff(
const Neighborhood<N1>& nbh1,
const Neighborhood<N2>& nbh2)
133 typedef mln_deduce(N1, window, regular) W1;
144 template <typename W1, typename W2>
147 operator-(const Window<W1>& win1, const Window<W2>& win2)
152 template <
typename N1,
typename N2>
153 neighb<mln_deduce(N1, window, regular)>
154 operator-(
const Neighborhood<N1>& nbh1,
const Neighborhood<N2>& nbh2)
159 # endif // ! MLN_INCLUDE_ONLY
164 #endif // ! MLN_WIN_DIFF_HH