lemon/unionfind.h
changeset 2508 c86db0f7f917
parent 2505 1bb471764ab8
child 2542 faaa54ec4520
equal deleted inserted replaced
14:99776a617e72 15:7b5d50eb6de3
   472 	  idx = items[idx].next;
   472 	  idx = items[idx].next;
   473 	}
   473 	}
   474           
   474           
   475       }
   475       }
   476 
   476 
   477     }    
   477     }
       
   478 
       
   479     /// \brief Gives back a representant item of the component.
       
   480     ///
       
   481     /// Gives back a representant item of the component.
       
   482     Item item(int cls) const {
       
   483       return items[classes[cls].firstItem].item;
       
   484     }
   478 
   485 
   479     /// \brief Removes the component of the given element from the structure.
   486     /// \brief Removes the component of the given element from the structure.
   480     ///
   487     ///
   481     /// Removes the component of the given element from the structure.
   488     /// Removes the component of the given element from the structure.
   482     ///
   489     ///
   730     ///
   737     ///
   731     /// Gives back the class of the \e item.
   738     /// Gives back the class of the \e item.
   732     int find(const Item &item) const {
   739     int find(const Item &item) const {
   733       return items[index[item]].cls;
   740       return items[index[item]].cls;
   734     }
   741     }
       
   742 
       
   743     /// \brief Gives back a representant item of the component.
       
   744     ///
       
   745     /// Gives back a representant item of the component.
       
   746     Item item(int cls) const {
       
   747       return items[classes[cls].firstItem].item;
       
   748     }
   735     
   749     
   736     /// \brief Removes the given element from the structure.
   750     /// \brief Removes the given element from the structure.
   737     ///
   751     ///
   738     /// Removes the element from its component and if the component becomes
   752     /// Removes the element from its component and if the component becomes
   739     /// empty then removes that component from the component list.
   753     /// empty then removes that component from the component list.