olena-2.0-192-gc8f12e3 mln/world/kn/compute_tree_of_shapes.hh: Do not use random anymore.

--- milena/ChangeLog | 5 ++++ milena/mln/world/kn/compute_tree_of_shapes.hh | 33 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 521a626..f6fc620 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,10 @@ 2013-02-11 Guillaume Lazzara <z@lrde.epita.fr> + * mln/world/kn/compute_tree_of_shapes.hh: Do not use random + anymore. + +2013-02-11 Guillaume Lazzara <z@lrde.epita.fr> + Add a new structure for compressed tree. * mln/util/tree_of_shapes.hh: Remove methods related to compressed diff --git a/milena/mln/world/kn/compute_tree_of_shapes.hh b/milena/mln/world/kn/compute_tree_of_shapes.hh index c29be4d..8abeb54 100644 --- a/milena/mln/world/kn/compute_tree_of_shapes.hh +++ b/milena/mln/world/kn/compute_tree_of_shapes.hh @@ -308,6 +308,38 @@ namespace mln EV l_; bool found; + static bool up = true; + if (up) + { + l_ = upper_level_next_to_lcur(q, found); + if (found) + return l_; + else + { + up = false; + l_ = lower_level_next_to_lcur(q, found); + if (! found) + std::abort(); + return l_; + } + } + else // going down + { + l_ = lower_level_next_to_lcur(q, found); + if (found) + return l_; + else + { + up = true; + l_ = upper_level_next_to_lcur(q, found); + if (! found) + std::abort(); + return l_; + } + } + +/* + bool up = int(2. * std::rand() / (RAND_MAX + 1.)); if (up) { @@ -335,6 +367,7 @@ namespace mln return l_; } } +*/ } -- 1.7.2.5
participants (1)
-
Guillaume Lazzara