lemon/sub_graph.h
changeset 1977 8ef02f0c4245
parent 1956 a055123339d5
child 1979 c2992fd74dad
equal deleted inserted replaced
3:8b191a2b47df 4:5f01bd442164
   273 	Parent::add(node);
   273 	Parent::add(node);
   274 	Parent::operator[](node).prev = node;
   274 	Parent::operator[](node).prev = node;
   275 	Parent::operator[](node).firstIn = INVALID;
   275 	Parent::operator[](node).firstIn = INVALID;
   276 	Parent::operator[](node).firstOut = INVALID;
   276 	Parent::operator[](node).firstOut = INVALID;
   277       }
   277       }
       
   278 
   278       virtual void add(const std::vector<Node>& nodes) {
   279       virtual void add(const std::vector<Node>& nodes) {
   279 	Parent::add(nodes);
   280 	Parent::add(nodes);
   280 	for (int i = 0; i < (int)nodes.size(); ++i) {
   281 	for (int i = 0; i < (int)nodes.size(); ++i) {
   281 	  Parent::operator[](nodes[i]).prev = nodes[i];
   282 	  Parent::operator[](nodes[i]).prev = nodes[i];
   282 	  Parent::operator[](nodes[i]).firstIn = INVALID;
   283 	  Parent::operator[](nodes[i]).firstIn = INVALID;
   354 
   355 
   355       virtual void erase(const std::vector<Edge>& edges) {
   356       virtual void erase(const std::vector<Edge>& edges) {
   356 	for (int i = 0; i < (int)edges.size(); ++i) {
   357 	for (int i = 0; i < (int)edges.size(); ++i) {
   357 	  adaptor.hide(edges[i]);
   358 	  adaptor.hide(edges[i]);
   358 	}
   359 	}
   359 	Parent::erase(edge);
   360 	Parent::erase(edges);
   360       }
   361       }
   361 
   362 
   362     private:
   363     private:
   363       SubGraph& adaptor;
   364       SubGraph& adaptor;
   364     };
   365     };
   584 	Parent::add(node);
   585 	Parent::add(node);
   585 	Parent::operator[](node).firstIn = INVALID;
   586 	Parent::operator[](node).firstIn = INVALID;
   586 	Parent::operator[](node).firstOut = INVALID;
   587 	Parent::operator[](node).firstOut = INVALID;
   587       }
   588       }
   588 
   589 
       
   590       virtual void add(const std::vector<Node>& nodes) {
       
   591         Parent::add(nodes);
       
   592         for (int i = 0; i < (int)nodes.size(); ++i) {
       
   593           Parent::operator[](nodes[i]).firstIn = INVALID;
       
   594           Parent::operator[](nodes[i]).firstOut = INVALID;
       
   595         }
       
   596       }
       
   597 
   589     private:
   598     private:
   590       SubGraph& adaptor;
   599       SubGraph& adaptor;
   591     };
   600     };
   592 
   601 
   593     struct EdgeT {
   602     struct EdgeT {
   644 
   653 
   645       virtual void erase(const std::vector<Edge>& edges) {
   654       virtual void erase(const std::vector<Edge>& edges) {
   646 	for (int i = 0; i < (int)edges.size(); ++i) {
   655 	for (int i = 0; i < (int)edges.size(); ++i) {
   647 	  adaptor.hide(edges[i]);
   656 	  adaptor.hide(edges[i]);
   648 	}
   657 	}
   649 	Parent::erase(edge);
   658 	Parent::erase(edges);
   650       }
   659       }
   651 
   660 
   652     private:
   661     private:
   653       SubGraph& adaptor;
   662       SubGraph& adaptor;
   654     };
   663     };