https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
Index: ChangeLog
from Alexandre Abraham <abraham(a)lrde.epita.fr>
Little fixes.
* markov/markov.hh: .
markov.hh | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Index: markov/markov.hh
--- markov/markov.hh (revision 2911)
+++ markov/markov.hh (working copy)
@@ -22,14 +22,19 @@
// u(x) is cst so we don't care
double diff_sum = 0;
+ double coeff = 0;
mln_niter(N) n(nbh, p);
for_all(n)
+ if (ima.domain().has(n))
{
diff_sum += abs(xi - out(n));
+ coeff ++;
}
- return u + 0.25 * diff_sum;
+ diff_sum /= coeff;
+
+ return 0.5 * (u + diff_sum);
}
template <typename I, typename N> // I == int_u8