COIN-OR::LEMON - Graph Library

Changeset 854:baf0b6e40211 in lemon-0.x for src/hugo/graph_wrapper.h


Ignore:
Timestamp:
09/15/04 12:34:12 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1153
Message:

correction of SubGraphWrapper? bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r849 r854  
    379379      NodeIt(Invalid i) : Node(i) { }
    380380      NodeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw) :
    381         Node(typename Graph::NodeIt(*(_gw.graph))), gw(&_gw) { }
     381        Node(typename Graph::NodeIt(*(_gw.graph))), gw(&_gw) {
     382        while (*static_cast<Node*>(this)!=INVALID &&
     383               !(*(gw->edge_filter_map))[*this])
     384          *(static_cast<Node*>(this))=
     385            ++(typename Graph::NodeIt(*(gw->graph), *this));
     386      }
    382387      NodeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw,
    383388             const Node& n) :
     
    402407      OutEdgeIt(Invalid i) : Edge(i) { }
    403408      OutEdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw, const Node& n) :
    404         Edge(typename Graph::OutEdgeIt(*(_gw.graph), n)), gw(&_gw) { }
     409        Edge(typename Graph::OutEdgeIt(*(_gw.graph), n)), gw(&_gw) {
     410        while (*static_cast<Edge*>(this)!=INVALID &&
     411               !(*(gw->edge_filter_map))[*this])
     412          *(static_cast<Edge*>(this))=
     413            ++(typename Graph::OutEdgeIt(*(gw->graph), *this));
     414      }
    405415      OutEdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw,
    406416             const Edge& e) :
     
    424434      InEdgeIt(Invalid i) : Edge(i) { }
    425435      InEdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw, const Node& n) :
    426         Edge(typename Graph::InEdgeIt(*(_gw.graph), n)), gw(&_gw) { }
     436        Edge(typename Graph::InEdgeIt(*(_gw.graph), n)), gw(&_gw) {
     437        while (*static_cast<Edge*>(this)!=INVALID &&
     438               !(*(gw->edge_filter_map))[*this])
     439          *(static_cast<Edge*>(this))=
     440            ++(typename Graph::InEdgeIt(*(gw->graph), *this));
     441      }
    427442      InEdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw,
    428443             const Edge& e) :
     
    446461      EdgeIt(Invalid i) : Edge(i) { }
    447462      EdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw) :
    448         Edge(typename Graph::EdgeIt(*(_gw.graph))), gw(&_gw) { }
     463        Edge(typename Graph::EdgeIt(*(_gw.graph))), gw(&_gw) {
     464        while (*static_cast<Edge*>(this)!=INVALID &&
     465               !(*(gw->edge_filter_map))[*this])
     466          *(static_cast<Edge*>(this))=
     467            ++(typename Graph::EdgeIt(*(gw->graph), *this));
     468      }
    449469      EdgeIt(const SubGraphWrapper<Graph, NodeFilterMap, EdgeFilterMap>& _gw,
    450470             const Edge& e) :
Note: See TracChangeset for help on using the changeset viewer.