lemon/unionfind.h
changeset 304 1e81878b0e54
parent 220 a5d8c039f218
child 436 561be42c4b99
equal deleted inserted replaced
2:716c8a814b79 3:f2e49e9fd102
   495       unlaceClass(cls);
   495       unlaceClass(cls);
   496       items[items[fdx].prev].next = firstFreeItem;
   496       items[items[fdx].prev].next = firstFreeItem;
   497       firstFreeItem = fdx;
   497       firstFreeItem = fdx;
   498     }
   498     }
   499 
   499 
   500     /// \brief Lemon style iterator for the representant items.
   500     /// \brief LEMON style iterator for the representant items.
   501     ///
   501     ///
   502     /// ClassIt is a lemon style iterator for the components. It iterates
   502     /// ClassIt is a lemon style iterator for the components. It iterates
   503     /// on the ids of the classes.
   503     /// on the ids of the classes.
   504     class ClassIt {
   504     class ClassIt {
   505     public:
   505     public:
   547     private:
   547     private:
   548       const UnionFindEnum* unionFind;
   548       const UnionFindEnum* unionFind;
   549       int cdx;
   549       int cdx;
   550     };
   550     };
   551 
   551 
   552     /// \brief Lemon style iterator for the items of a component.
   552     /// \brief LEMON style iterator for the items of a component.
   553     ///
   553     ///
   554     /// ClassIt is a lemon style iterator for the components. It iterates
   554     /// ClassIt is a lemon style iterator for the components. It iterates
   555     /// on the items of a class. By example if you want to iterate on
   555     /// on the items of a class. By example if you want to iterate on
   556     /// each items of each classes then you may write the next code.
   556     /// each items of each classes then you may write the next code.
   557     ///\code
   557     ///\code
   805       }
   805       }
   806       classes[cdx].next = firstFreeClass;
   806       classes[cdx].next = firstFreeClass;
   807       firstFreeClass = cdx;
   807       firstFreeClass = cdx;
   808     }
   808     }
   809 
   809 
   810     /// \brief Lemon style iterator for the classes.
   810     /// \brief LEMON style iterator for the classes.
   811     ///
   811     ///
   812     /// ClassIt is a lemon style iterator for the components. It iterates
   812     /// ClassIt is a lemon style iterator for the components. It iterates
   813     /// on the ids of classes.
   813     /// on the ids of classes.
   814     class ClassIt {
   814     class ClassIt {
   815     public:
   815     public:
   857     private:
   857     private:
   858       const ExtendFindEnum* extendFind;
   858       const ExtendFindEnum* extendFind;
   859       int cdx;
   859       int cdx;
   860     };
   860     };
   861 
   861 
   862     /// \brief Lemon style iterator for the items of a component.
   862     /// \brief LEMON style iterator for the items of a component.
   863     ///
   863     ///
   864     /// ClassIt is a lemon style iterator for the components. It iterates
   864     /// ClassIt is a lemon style iterator for the components. It iterates
   865     /// on the items of a class. By example if you want to iterate on
   865     /// on the items of a class. By example if you want to iterate on
   866     /// each items of each classes then you may write the next code.
   866     /// each items of each classes then you may write the next code.
   867     ///\code
   867     ///\code
  1653     const Item& classRep(int id) const {
  1653     const Item& classRep(int id) const {
  1654       int parent = classes[id].parent;
  1654       int parent = classes[id].parent;
  1655       return nodes[parent >= 0 ? classes[id].depth : leftNode(id)].item;
  1655       return nodes[parent >= 0 ? classes[id].depth : leftNode(id)].item;
  1656     }
  1656     }
  1657 
  1657 
  1658     /// \brief Lemon style iterator for the items of a class.
  1658     /// \brief LEMON style iterator for the items of a class.
  1659     ///
  1659     ///
  1660     /// ClassIt is a lemon style iterator for the components. It iterates
  1660     /// ClassIt is a lemon style iterator for the components. It iterates
  1661     /// on the items of a class. By example if you want to iterate on
  1661     /// on the items of a class. By example if you want to iterate on
  1662     /// each items of each classes then you may write the next code.
  1662     /// each items of each classes then you may write the next code.
  1663     ///\code
  1663     ///\code