https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
Index: ChangeLog
from Alexandre Abraham <abraham(a)lrde.epita.fr>
Fix bad comparison sign.
* markov/markov.hh: .
markov.hh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: markov/markov.hh
--- markov/markov.hh (revision 2910)
+++ markov/markov.hh (working copy)
@@ -26,10 +26,10 @@
mln_niter(N) n(nbh, p);
for_all(n)
{
- diff_sum += abs(out(p) - out(n));
+ diff_sum += abs(xi - out(n));
}
- return u + 100 * diff_sum;
+ return u + 0.25 * diff_sum;
}
template <typename I, typename N> // I == int_u8
@@ -66,9 +66,9 @@
double d_u = up - u;
double proba = exp(-d_u / temp);
- // std::cout << "Difference : " << d_u << std::endl;
+ // std::cout << "u : " << u << " up : " <<
up << "Difference : " << d_u << std::endl;
- if (d_u < 0 || !gradient && (p_random.get() < proba))
+ if (d_u < 0 || !gradient && (p_random.get() > proba))
{
out(p) = v;
modifications ++;