
* mln/topo/skeleton/breadth_first_thinning.hh: Remove a comment. * mln/topo/skeleton/priority_driven_thinning.hh: Likewise. Rename p_queue to queue to avoid confusions with mln::p_queue and improve uniformity w.r.t. topo::breadth_first_thinning. --- milena/ChangeLog | 9 +++++++ milena/mln/topo/skeleton/breadth_first_thinning.hh | 9 ------- .../mln/topo/skeleton/priority_driven_thinning.hh | 23 ++++++------------- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 7554064..11924f1 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,14 @@ 2010-09-17 Roland Levillain <roland@lrde.epita.fr> + Aesthetic changes in thinning algorithms. + + * mln/topo/skeleton/breadth_first_thinning.hh: Remove a comment. + * mln/topo/skeleton/priority_driven_thinning.hh: Likewise. + Rename p_queue to queue to avoid confusions with mln::p_queue and + improve uniformity w.r.t. topo::breadth_first_thinning. + +2010-09-17 Roland Levillain <roland@lrde.epita.fr> + Fix the processing order in topo::breadth_first_thinning. * mln/topo/skeleton/breadth_first_thinning.hh: Use a p_queue_fast diff --git a/milena/mln/topo/skeleton/breadth_first_thinning.hh b/milena/mln/topo/skeleton/breadth_first_thinning.hh index 348b271..d2f33b5 100644 --- a/milena/mln/topo/skeleton/breadth_first_thinning.hh +++ b/milena/mln/topo/skeleton/breadth_first_thinning.hh @@ -135,15 +135,6 @@ namespace mln while (!queue.is_empty()) { psite p = queue.pop_front(); - - /* FIXME: We compute the cell and attachment of P twice: - during the call to is_simple() and within detach(). - How could we reuse this elegantly, without breaking - the genericity of the skeleton algorithm? - Also, keep in mind that functors can maintain an - internal state and make side effects, meaning that - e.g. constraint(p) might not be constant for a - given p during the thinning. */ if (output(p) && constraint(p) && is_simple(p)) { detach(p, output); diff --git a/milena/mln/topo/skeleton/priority_driven_thinning.hh b/milena/mln/topo/skeleton/priority_driven_thinning.hh index f074b6a..42e1b13 100644 --- a/milena/mln/topo/skeleton/priority_driven_thinning.hh +++ b/milena/mln/topo/skeleton/priority_driven_thinning.hh @@ -126,9 +126,9 @@ namespace mln typedef mln_psite(I) psite; typedef p_queue_fast<psite> queue_t; - typedef p_priority<mln_value(J), queue_t> p_queue_t; - p_queue_t p_queue; - // Populate P_QUEUE with candidate simple points. + typedef p_priority<mln_value(J), queue_t> priority_queue_t; + priority_queue_t queue; + // Populate QUEUE with candidate simple points. mln_piter(I) p_(output.domain()); for_all(p_) { @@ -139,21 +139,12 @@ namespace mln the compiler and pass an actual, explicit psite. */ psite p = p_; if (output(p) && constraint(p) && is_simple(p)) - p_queue.push(priority(p), p); + queue.push(priority(p), p); } - while (!p_queue.is_empty()) + while (!queue.is_empty()) { - psite p = p_queue.pop_front(); - - /* FIXME: We compute the cell and attachment of P twice: - during the call to is_simple() and within detach(). - How could we reuse this elegantly, without breaking - the genericity of the skeleton algorithm? - Also, keep in mind that functors can maintain an - internal state and make side effects, meaning that - e.g. constraint(p) might not be constant for a - given p during the thinning. */ + psite p = queue.pop_front(); if (output(p) && constraint(p) && is_simple(p)) { detach(p, output); @@ -164,7 +155,7 @@ namespace mln psite n = n_; if (output.domain().has(n) && output(n) && constraint(n) && is_simple(n)) - p_queue.push(priority(n), n); + queue.push(priority(n), n); } } } -- 1.5.6.5