[Insight-users] stl::priority_queue

salah salah@gris.uni-tuebingen.de
Wed, 16 Apr 2003 19:12:01 +0200


Hi all,

I am new to the use of stl containers. I want to define and use a =
priority
queue whose element are of type QueuePixelNode,=20
where QueuePixelNode is defined as

 typedef struct {
     IndexType  v_Index;  //    usual itk-image index type=20
     float  v_Weight;
  } QueuePixelNode;    =20

I want the elements to be sorted according to their v_Weight value.
can anybody provide me with the minimal feasible code to define such=20
a priority queue.

I have written something like=20

  std::priority_queue<QueuePixelNode,=20
	                  std::vector<QueuePixelNode>,=20
                              ????????                       >       =
my_Queue;

I could really not know how to deal with the comparison function ?! ?! =
?!

Can anybody please help ??

Thanks,
Zein


->8<------------->8<------------->8<------------->8<------------->8<-----=
-------->8<-
Zein I. Salah=20
University of T=FCbingen, WSI-GRIS, Sand 14, 72076 T=FCbingen=20
Email: salah@gris.uni-tuebingen.de
Tel.: (07071) 29 75465 (GRIS),           Fax: (07071) 29 54 66