test/preflow_test.cc
branch1.1
changeset 1081 f1398882a928
parent 1027 30d5f950aa5f
child 1172 c18ed26f016c
equal deleted inserted replaced
9:550748c3ccb1 11:636b20f3a2e3
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2011
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   111   v = const_preflow_test.flowValue();
   111   v = const_preflow_test.flowValue();
   112   v = const_preflow_test.flow(e);
   112   v = const_preflow_test.flow(e);
   113   const FlowMap& fm = const_preflow_test.flowMap();
   113   const FlowMap& fm = const_preflow_test.flowMap();
   114   b = const_preflow_test.minCut(n);
   114   b = const_preflow_test.minCut(n);
   115   const_preflow_test.minCutMap(cut);
   115   const_preflow_test.minCutMap(cut);
   116   
   116 
   117   ignore_unused_variable_warning(fm);
   117   ignore_unused_variable_warning(fm);
   118 }
   118 }
   119 
   119 
   120 int cutValue (const SmartDigraph& g,
   120 int cutValue (const SmartDigraph& g,
   121               const SmartDigraph::NodeMap<bool>& cut,
   121               const SmartDigraph::NodeMap<bool>& cut,
   152 }
   152 }
   153 
   153 
   154 void initFlowTest()
   154 void initFlowTest()
   155 {
   155 {
   156   DIGRAPH_TYPEDEFS(SmartDigraph);
   156   DIGRAPH_TYPEDEFS(SmartDigraph);
   157   
   157 
   158   SmartDigraph g;
   158   SmartDigraph g;
   159   SmartDigraph::ArcMap<int> cap(g),iflow(g);
   159   SmartDigraph::ArcMap<int> cap(g),iflow(g);
   160   Node s=g.addNode(); Node t=g.addNode();
   160   Node s=g.addNode(); Node t=g.addNode();
   161   Node n1=g.addNode(); Node n2=g.addNode();
   161   Node n1=g.addNode(); Node n2=g.addNode();
   162   Arc a;
   162   Arc a;
   264 
   264 
   265   check(preflow_test.flowValue() == min_cut_value,
   265   check(preflow_test.flowValue() == min_cut_value,
   266         "The max flow value or the three min cut values are incorrect.");
   266         "The max flow value or the three min cut values are incorrect.");
   267 
   267 
   268   initFlowTest();
   268   initFlowTest();
   269   
   269 
   270   return 0;
   270   return 0;
   271 }
   271 }