COIN-OR::LEMON - Graph Library

Changeset 877:141f9c0db4a3 in lemon-1.2 for test/bellman_ford_test.cc


Ignore:
Timestamp:
03/06/10 15:35:12 (9 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
878:f802439d2b58, 880:38213abd2911, 909:f112c18bc304
Phase:
public
Message:

Unify the sources (#339)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/bellman_ford_test.cc

    r844 r877  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    9898    pp = const_bf_test.path(t);
    9999    pp = const_bf_test.negativeCycle();
    100    
     100
    101101    for (BF::ActiveIt it(const_bf_test); it != INVALID; ++it) {}
    102102  }
     
    111111    concepts::ReadWriteMap<Node,Arc> pred_map;
    112112    concepts::ReadWriteMap<Node,Value> dist_map;
    113    
     113
    114114    bf_test
    115115      .lengthMap(length_map)
     
    190190  check(pathSource(gr, p) == s, "path() found a wrong path.");
    191191  check(pathTarget(gr, p) == t, "path() found a wrong path.");
    192  
     192
    193193  ListPath<Digraph> path;
    194194  Value dist;
     
    229229  SmartDigraph gr;
    230230  IntArcMap length(gr);
    231  
     231
    232232  Node n1 = gr.addNode();
    233233  Node n2 = gr.addNode();
    234234  Node n3 = gr.addNode();
    235235  Node n4 = gr.addNode();
    236  
     236
    237237  Arc a1 = gr.addArc(n1, n2);
    238238  Arc a2 = gr.addArc(n2, n2);
    239  
     239
    240240  length[a1] = 2;
    241241  length[a2] = -1;
    242  
     242
    243243  {
    244244    BellmanFord<SmartDigraph, IntArcMap> bf(gr, length);
     
    248248          "Wrong negative cycle.");
    249249  }
    250  
     250
    251251  length[a2] = 0;
    252  
     252
    253253  {
    254254    BellmanFord<SmartDigraph, IntArcMap> bf(gr, length);
     
    257257          "Negative cycle should not be found.");
    258258  }
    259  
     259
    260260  length[gr.addArc(n1, n3)] = 5;
    261261  length[gr.addArc(n4, n3)] = 1;
    262262  length[gr.addArc(n2, n4)] = 2;
    263263  length[gr.addArc(n3, n2)] = -4;
    264  
     264
    265265  {
    266266    BellmanFord<SmartDigraph, IntArcMap> bf(gr, length);
Note: See TracChangeset for help on using the changeset viewer.