Coding style.
authormarci
Thu, 07 Oct 2004 17:21:27 +0000
changeset 94050a153b08f07
parent 939 1559584ca634
child 941 186aa53d2802
Coding style.
src/test/preflow_test.cc
     1.1 --- a/src/test/preflow_test.cc	Thu Oct 07 07:39:42 2004 +0000
     1.2 +++ b/src/test/preflow_test.cc	Thu Oct 07 17:21:27 2004 +0000
     1.3 @@ -39,13 +39,13 @@
     1.4   
     1.5    typedef Preflow<Graph, int, CapMap, FlowMap> PType;
     1.6  
     1.7 -  Graph G;
     1.8 +  Graph g;
     1.9    Node n;
    1.10    CapMap cap;
    1.11    FlowMap flow;
    1.12    CutMap cut;
    1.13  
    1.14 -  PType preflow_test(G,n,n,cap,flow);
    1.15 +  PType preflow_test(g,n,n,cap,flow);
    1.16  
    1.17    preflow_test.run();
    1.18    preflow_test.flowValue();
    1.19 @@ -62,12 +62,12 @@
    1.20    preflow_test.maxMinCut(cut);
    1.21  }
    1.22  
    1.23 -int cut_value ( SmartGraph& G, SmartGraph::NodeMap<bool>& cut, 
    1.24 +int cut_value ( SmartGraph& g, SmartGraph::NodeMap<bool>& cut, 
    1.25  		SmartGraph::EdgeMap<int>& cap) {
    1.26    
    1.27    int c=0;
    1.28 -  for(SmartGraph::EdgeIt e(G); e!=INVALID; ++e) {
    1.29 -    if (cut[G.tail(e)] && !cut[G.head(e)]) c+=cap[e];
    1.30 +  for(SmartGraph::EdgeIt e(g); e!=INVALID; ++e) {
    1.31 +    if (cut[g.tail(e)] && !cut[g.head(e)]) c+=cap[e];
    1.32    }
    1.33    return c;
    1.34  }
    1.35 @@ -97,29 +97,29 @@
    1.36    
    1.37    check(file, "Input file '" << f_name << "' not found.");
    1.38    
    1.39 -  Graph G;
    1.40 +  Graph g;
    1.41    Node s, t;
    1.42 -  CapMap cap(G);
    1.43 -  readDimacs(file, G, cap, s, t);
    1.44 +  CapMap cap(g);
    1.45 +  readDimacs(file, g, cap, s, t);
    1.46  
    1.47 -  FlowMap flow(G,0);
    1.48 +  FlowMap flow(g,0);
    1.49  
    1.50   
    1.51  
    1.52 -  PType preflow_test(G, s, t, cap, flow);
    1.53 +  PType preflow_test(g, s, t, cap, flow);
    1.54    preflow_test.run(PType::ZERO_FLOW);
    1.55      
    1.56 -  CutMap mincut(G,false);
    1.57 -  preflow_test.minCut(mincut); 
    1.58 -  int min_cut_value=cut_value(G,mincut,cap);
    1.59 +  CutMap min_cut(g,false);
    1.60 +  preflow_test.minCut(min_cut); 
    1.61 +  int min_cut_value=cut_value(g,min_cut,cap);
    1.62     
    1.63 -  CutMap minmincut(G,false);
    1.64 -  preflow_test.minMinCut(minmincut); 
    1.65 -  int min_min_cut_value=cut_value(G,minmincut,cap);
    1.66 +  CutMap min_min_cut(g,false);
    1.67 +  preflow_test.minMinCut(min_min_cut); 
    1.68 +  int min_min_cut_value=cut_value(g,min_min_cut,cap);
    1.69     
    1.70 -  CutMap maxmincut(G,false);
    1.71 -  preflow_test.maxMinCut(maxmincut); 
    1.72 -  int max_min_cut_value=cut_value(G,maxmincut,cap);
    1.73 +  CutMap max_min_cut(g,false);
    1.74 +  preflow_test.maxMinCut(max_min_cut); 
    1.75 +  int max_min_cut_value=cut_value(g,max_min_cut,cap);
    1.76  
    1.77    check(preflow_test.flowValue() == min_cut_value &&
    1.78  	min_cut_value == min_min_cut_value &&
    1.79 @@ -130,14 +130,14 @@
    1.80  
    1.81  
    1.82  
    1.83 -  for(EdgeIt e(G); e!=INVALID; ++e) cap[e]=2*cap[e]; 
    1.84 +  for(EdgeIt e(g); e!=INVALID; ++e) cap[e]=2*cap[e]; 
    1.85    preflow_test.setCap(cap);  
    1.86  
    1.87    preflow_test.phase1(PType::PRE_FLOW);
    1.88  
    1.89 -  CutMap mincut1(G,false);
    1.90 -  preflow_test.minCut(mincut1); 
    1.91 -  min_cut_value=cut_value(G,mincut1,cap);
    1.92 +  CutMap min_cut1(g,false);
    1.93 +  preflow_test.minCut(min_cut1); 
    1.94 +  min_cut_value=cut_value(g,min_cut1,cap);
    1.95     
    1.96    check(preflow_test.flowValue() == min_cut_value &&
    1.97  	min_cut_value == 2*flow_value,
    1.98 @@ -145,16 +145,16 @@
    1.99  
   1.100    preflow_test.phase2();
   1.101  
   1.102 -  CutMap mincut2(G,false);
   1.103 -  preflow_test.minCut(mincut2); 
   1.104 -  min_cut_value=cut_value(G,mincut2,cap);
   1.105 +  CutMap min_cut2(g,false);
   1.106 +  preflow_test.minCut(min_cut2); 
   1.107 +  min_cut_value=cut_value(g,min_cut2,cap);
   1.108     
   1.109 -  CutMap minmincut2(G,false);
   1.110 -  preflow_test.minMinCut(minmincut2); 
   1.111 -  min_min_cut_value=cut_value(G,minmincut2,cap);
   1.112 +  CutMap min_min_cut2(g,false);
   1.113 +  preflow_test.minMinCut(min_min_cut2); 
   1.114 +  min_min_cut_value=cut_value(g,min_min_cut2,cap);
   1.115   
   1.116 -  preflow_test.maxMinCut(maxmincut); 
   1.117 -  max_min_cut_value=cut_value(G,maxmincut,cap);
   1.118 +  preflow_test.maxMinCut(max_min_cut); 
   1.119 +  max_min_cut_value=cut_value(g,max_min_cut,cap);
   1.120  
   1.121    check(preflow_test.flowValue() == min_cut_value &&
   1.122  	min_cut_value == min_min_cut_value &&
   1.123 @@ -164,7 +164,7 @@
   1.124  
   1.125  
   1.126  
   1.127 -  EdgeIt e(G);
   1.128 +  EdgeIt e(g);
   1.129    for( int i=1; i==10; ++i ) {
   1.130      flow.set(e,0);
   1.131      ++e;
   1.132 @@ -172,11 +172,11 @@
   1.133  
   1.134    preflow_test.setFlow(flow); 
   1.135  
   1.136 -  NodeIt tmp1(G,s);
   1.137 +  NodeIt tmp1(g,s);
   1.138    ++tmp1;
   1.139    if ( tmp1 != INVALID ) s=tmp1;
   1.140  
   1.141 -  NodeIt tmp2(G,t);
   1.142 +  NodeIt tmp2(g,t);
   1.143    ++tmp2;
   1.144    if ( tmp2 != INVALID ) t=tmp2;
   1.145  
   1.146 @@ -185,16 +185,16 @@
   1.147    
   1.148    preflow_test.run();
   1.149  
   1.150 -  CutMap mincut3(G,false);
   1.151 -  preflow_test.minCut(mincut3); 
   1.152 -  min_cut_value=cut_value(G,mincut3,cap);
   1.153 +  CutMap min_cut3(g,false);
   1.154 +  preflow_test.minCut(min_cut3); 
   1.155 +  min_cut_value=cut_value(g,min_cut3,cap);
   1.156     
   1.157 -  CutMap minmincut3(G,false);
   1.158 -  preflow_test.minMinCut(minmincut3); 
   1.159 -  min_min_cut_value=cut_value(G,minmincut3,cap);
   1.160 +  CutMap min_min_cut3(g,false);
   1.161 +  preflow_test.minMinCut(min_min_cut3); 
   1.162 +  min_min_cut_value=cut_value(g,min_min_cut3,cap);
   1.163     
   1.164 -  preflow_test.maxMinCut(maxmincut); 
   1.165 -  max_min_cut_value=cut_value(G,maxmincut,cap);
   1.166 +  preflow_test.maxMinCut(max_min_cut); 
   1.167 +  max_min_cut_value=cut_value(g,max_min_cut,cap);
   1.168  
   1.169    check(preflow_test.flowValue() == min_cut_value &&
   1.170  	min_cut_value == min_min_cut_value &&