COIN-OR::LEMON - Graph Library

Changeset 776:f2994a2b10b2 in lemon-0.x for src


Ignore:
Timestamp:
08/31/04 15:40:07 (16 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1069
Message:

minlengthpaths_test.cc is already hugo++ comform and is compilable

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/bin_heap.h

    r542 r776  
    3434 * Ehhez nagyon fontos, hogy az atadott property map inicializalva legyen
    3535 * minden szobajovo kulcs ertekre, -1 -es ertekkel!
    36  * Es ilyen esetben a kulcsokrol lekerdezheto az allapotuk a state metodussal:
     36 * Es ilyen esetben a kulcsokrol lekerdezheto az allapotuk a state
     37 metodussal:
    3738 * (nem jart meg a kupacban PRE_HEAP=-1, epp a kupacban van IN_HEAP=0,
    3839 *  mar kikerult a kupacbol POST_HEAP=-2).
  • src/hugo/dijkstra.h

    r774 r776  
    243243        for(OutEdgeIt e(*G,v); e!=INVALID; ++e) {
    244244          Node w=G->head(e);
    245          
    246245          switch(heap.state(w)) {
    247246          case HeapType::PRE_HEAP:
  • src/hugo/mincostflows.h

    r758 r776  
    117117      total_length = 0;
    118118     
    119       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
     119      for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
    120120        flow.set(e,0);
    121121      }
    122122
    123123      //Initialize the potential to zero
    124       FOR_EACH_LOC(typename Graph::NodeIt, n, G){
     124      for(typename Graph::NodeIt n=loopFirst(typename Graph::NodeIt(), (G)); n!=INVALID; ++n){
    125125        potential.set(n,0);
    126126      }
     
    145145       
    146146        //We have to change the potential
    147         FOR_EACH_LOC(typename ResGraphType::NodeIt, n, res_graph){
     147        //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
     148        //FOR_EACH_LOC(typename ResGraphType::NodeIt, n, res_graph){
     149        for(typename ResGraphType::NodeIt n=loopFirst(typename ResGraphType::NodeIt(), (res_graph)); n!=INVALID; ++n){
    148150          potential[n] += dijkstra.distMap()[n];
    149151        }
     
    196198      Length mod_pot;
    197199      Length fl_e;
    198       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
     200        //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
     201        //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
     202        for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
    199203        //C^{\Pi}_{i,j}
    200204        mod_pot = length[e]-potential[G.head(e)]+potential[G.tail(e)];
  • src/hugo/minlengthpaths.h

    r759 r776  
    8484      EdgeIntMap reversed(G);
    8585
    86       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
     86      //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
     87      for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
    8788        reversed[e] = mincost_flow.getFlow()[e];
    8889      }
     
    101102         
    102103          while (!reversed[e]){
    103             G.next(e);
     104            ++e;
    104105          }
    105106          n = G.head(e);
  • src/test/dijkstra_heap_test.cc

    r542 r776  
    5757
    5858  EdgeIt e;
    59   for(G.first(e); G.valid(e); G.next(e)) {
     59  for(G.first(e); e!=INVALID; ++e) {
    6060    Node u=G.tail(e);
    6161    Node v=G.head(e);
     
    7070
    7171  NodeIt v;
    72   for(G.first(v); G.valid(v); G.next(v)) {
     72  for(G.first(v); v!=INVALID; ++v) {
    7373    if ( dijkstra_test.reached(v) ) {
    7474      Edge e=dijkstra_test.pred(v);
     
    106106  error2=0;
    107107
    108   for(G.first(e); G.valid(e); G.next(e)) {
     108  for(G.first(e); e!=INVALID; ++e) {
    109109    Node u=G.tail(e);
    110110    Node v=G.head(e);
     
    118118  }
    119119
    120   for(G.first(v); G.valid(v); G.next(v)) {
     120  for(G.first(v); v!=INVALID; ++v) {
    121121    if ( dijkstra_test2.reached(v) ) {
    122122      Edge e=dijkstra_test2.pred(v);
  • src/test/dijkstra_test.cc

    r774 r776  
    7676
    7777
    78   for(EdgeIt e(G); e==INVALID; ++e) {
     78  for(EdgeIt e(G); e!=INVALID; ++e) {
    7979    Node u=G.tail(e);
    8080    Node v=G.head(e);
     
    8787
    8888  ///\bug This works only for integer lengths
    89   for(NodeIt v(G); v==INVALID; ++v)
     89  for(NodeIt v(G); v!=INVALID; ++v)
    9090    if ( dijkstra_test.reached(v) ) {
    9191      Edge e=dijkstra_test.pred(v);
Note: See TracChangeset for help on using the changeset viewer.