lemon/fib_heap.h
changeset 1784 d9eb186547d7
parent 1717 75fe24093ded
child 1834 0a14e1ae45a1
equal deleted inserted replaced
1:784758e951c0 2:b427fcf34c64
   114     bool empty() const { return num_items==0; }
   114     bool empty() const { return num_items==0; }
   115 
   115 
   116     /// \brief Make empty this heap.
   116     /// \brief Make empty this heap.
   117     /// 
   117     /// 
   118     /// Make empty this heap.
   118     /// Make empty this heap.
   119     void clear() { 
   119     void clear() {
   120       for (int i = 0; i < (int)container.size(); ++i) {
   120       if (num_items != 0) {
   121 	iimap[container[i].name] = -2;
   121 	for (int i = 0; i < (int)container.size(); ++i) {
       
   122 	  iimap[container[i].name] = -2;
       
   123 	}
   122       }
   124       }
   123       container.clear(); minimum = 0; num_items = 0;
   125       container.clear(); minimum = 0; num_items = 0;
   124     }
   126     }
   125 
   127 
   126     /// \brief \c item gets to the heap with priority \c value independently 
   128     /// \brief \c item gets to the heap with priority \c value independently