lemon/list_graph.h
changeset 1985 8782ff6fd98a
parent 1982 f0eb6b79dcdf
child 1991 d7442141d9ef
equal deleted inserted replaced
18:9775711410e3 19:860281504022
   714 
   714 
   715     void firstBNode(Node& node) const {
   715     void firstBNode(Node& node) const {
   716       node.id =  first_bnode != -1 ? (first_bnode << 1) + 1 : -1;
   716       node.id =  first_bnode != -1 ? (first_bnode << 1) + 1 : -1;
   717     }
   717     }
   718     void nextBNode(Node& node) const {
   718     void nextBNode(Node& node) const {
   719       node.id = aNodes[node.id >> 1].next_node;
   719       node.id = bNodes[node.id >> 1].next_node;
   720     }
   720     }
   721 
   721 
   722     void first(Node& node) const {
   722     void first(Node& node) const {
   723       if (first_anode != -1) {
   723       if (first_anode != -1) {
   724         node.id = (first_anode << 1);
   724         node.id = (first_anode << 1);
   859       return Node(aNodeId << 1);
   859       return Node(aNodeId << 1);
   860     }
   860     }
   861 
   861 
   862     Node addBNode() {
   862     Node addBNode() {
   863       int bNodeId;
   863       int bNodeId;
   864       if (first_free_anode == -1) {
   864       if (first_free_bnode == -1) {
   865         bNodeId = bNodes.size();
   865         bNodeId = bNodes.size();
   866         bNodes.push_back(NodeT());
   866         bNodes.push_back(NodeT());
   867       } else {
   867       } else {
   868         bNodeId = first_free_bnode;
   868         bNodeId = first_free_bnode;
   869         first_free_bnode = bNodes[first_free_bnode].next_node;
   869         first_free_bnode = bNodes[first_free_bnode].next_node;