[Insight-developers] Priority queue

Alexandre GOUAILLARD hanfei at caltech.edu
Sun Oct 7 22:41:26 EDT 2007


Hi guys,

We are cleaning our decimation codes for itkQE, and we are wondering what
would be the best choice for the priority queue.

For those not familiar with the problem, here is a sketch of the algorithms:
1. you compute a metric over the point set, which represents the geometrical
alteration that would results from simplifying the mesh by removing a given
point with a given method,
2. you sort the points depending on that metric,
3. you pick up the best point (according to the metric and the alteration
method)
4. you simplify the mesh
5. you recompute the metric
6. go back to 2

The problem with the STL priority queue is that you cannot update and
re-order the list as the list is sorted only during a push(), not during a
pop() or an update of an already inserted element.

Boost defined a mutable_queue that does exactly what we want but we don;t
really want to rely on boost, do we?

Is the only solution left is to recode or own flavor of a mutable queue, or
is there something better available in ITK?

Alex




More information about the Insight-developers mailing list