
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Bug fix. * tests/linear_gaussian.cc: Remove useless include. * mln/convert/to_image.hh (to_image): Fix bug in histogram version. * mln/core/image1d_b.hh (point_at_offset): Fix bug. * mln/level/sort_points.hh (sort_points_decreasing_): Fix bug. mln/convert/to_image.hh | 2 +- mln/core/image1d_b.hh | 6 +++++- mln/level/sort_points.hh | 2 +- tests/linear_gaussian.cc | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) Index: tests/linear_gaussian.cc --- tests/linear_gaussian.cc (revision 1115) +++ tests/linear_gaussian.cc (working copy) @@ -38,7 +38,6 @@ #include <mln/io/pgm/save.hh> #include <mln/level/transform.hh> -#include <mln/level/saturate.hh> #include <mln/math/round.hh> #include <mln/linear/gaussian.hh> Index: mln/convert/to_image.hh --- mln/convert/to_image.hh (revision 1115) +++ mln/convert/to_image.hh (working copy) @@ -182,7 +182,7 @@ v_max = h.vset()[h.vset().nvalues() - 1]; image1d_b<std::size_t> ima(make::box1d(v_min, v_max)); for(std::size_t i = 0; i < h.vset().nvalues(); ++i) - ima[i] = h[i]; + ima(make::point1d(i)) = h[i]; return ima; } Index: mln/core/image1d_b.hh --- mln/core/image1d_b.hh (revision 1115) +++ mln/core/image1d_b.hh (working copy) @@ -330,6 +330,10 @@ bool image1d_b<T>::owns_(const point1d& p) const { + if (! vb_.has(p)) + { + std::cout << " p = " << p << std::endl; + } mln_precondition(this->has_data()); return vb_.has(p); } @@ -418,7 +422,7 @@ image1d_b<T>::point_at_offset(unsigned o) const { mln_precondition(o < ncells()); - point1d p = make::point1d(o); + point1d p = make::point1d(o + vb_.min_ind()); mln_postcondition(& this->operator()(p) = this->buffer_ + o); return p; } Index: mln/level/sort_points.hh --- mln/level/sort_points.hh (revision 1115) +++ mln/level/sort_points.hh (working copy) @@ -170,7 +170,7 @@ // preparing output data std::vector<unsigned> loc(vset.nvalues()); loc[n-1] = 0; - for (unsigned i = n - 2; i != 0; --i) + for (int i = n - 2; i >= 0; --i) loc[i] = loc[i+1] + h[i+1]; // computing output data