COIN-OR::LEMON - Graph Library

Changeset 1060:7a24bb2e7480 in lemon-0.x for src/work/jacint


Ignore:
Timestamp:
01/07/05 19:53:02 (17 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1456
Message:

Nasty bug in undir_graph_extender.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/jacint/bug.cc

    r1059 r1060  
    1 //lasd megjegyzes a 49-es sorban
    21#include <iostream>
    32#include <queue>
     
    76#include <lemon/invalid.h>
    87#include <lemon/list_graph.h>
     8#include <lemon/smart_graph.h>
    99#include <matching.h>
    1010
    1111using namespace lemon;
     12using namespace std;
    1213
    13 int main(int, char **) {
    1414
    15   typedef UndirListGraph Graph;
     15int main() {
     16
     17  typedef UndirSmartGraph Graph;
    1618
    1719  typedef Graph::Edge Edge;
     
    2022  typedef Graph::NodeIt NodeIt;
    2123  typedef Graph::Node Node;
     24
     25  typedef Graph::OutEdgeIt OutEdgeIt;
    2226   
    2327  Graph G;
    2428
    25   G.clear();
     29  // G.clear();
    2630  std::vector<Graph::Node> nodes;
    2731  for (int i=0; i<5; ++i)
     
    3640
    3741  for(UndirEdgeIt e(G); e!=INVALID; ++e) {
    38     std::cout<<G.id(e)<<" : "<<G.id(G.source(e))<<" " <<G.id(G.target(e))<<std::endl;
     42    std::cout<<G.id(e)<<" : "<<G.id(G.source(e))
     43             <<" " <<G.id(G.target(e))<<std::endl;
    3944  }
    4045
     
    4550  }
    4651
     52  cout << "Dev Out edges from node " << G.id(nodes[1])<<std::endl;
     53  Edge f;
     54  for(G.firstOut(f, nodes[1]); f!=INVALID; G.nextOut(f)) {
     55    cout<<"edge " << G.id(f) << " goes"
     56             <<" from "<< G.id(G.source(f))
     57             << " to " << G.id(G.target(f))<<std::endl;
     58  }
     59
     60  cout << "Out edges from node " << G.id(nodes[1])<<std::endl;
     61  for( OutEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
     62    cout<<"edge " << G.id(f) << " goes"
     63             <<" from "<< G.id(G.source(f))
     64             << " to " << G.id(G.target(f))<<std::endl;
     65  }
     66
    4767  std::cout<<"Edges of node " << G.id(nodes[1])<<std::endl;
     68  for( IncEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
     69    cout<<"edge " << G.id(f) << " goes"
     70             <<" from "<< G.id(G.source(f))
     71             << " to " << G.id(G.target(f))<<std::endl;
     72  }
    4873
    49   for( IncEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
    50     std::cout<<"edge " << G.id(f)<< " goes to " << G.id(G.target(f))<<std::endl;
    51   }//ez a ket for ciklus meg lefut - bar hibas eleken iteral -, de a matching.h-s mar segfaultol
     74  //return 0;
     75
     76  //ez a ket for ciklus meg lefut - bar hibas eleken iteral -, de a
     77  //matching.h-s mar segfaultol
    5278
    5379  for( IncEdgeIt f(G,nodes[1]); f!=INVALID; ++f ) {
Note: See TracChangeset for help on using the changeset viewer.