test/preflow_test.cc
branch1.2
changeset 1142 4764031c082c
parent 1029 79fab87ee483
child 1175 1fe3b4ad8caa
equal deleted inserted replaced
10:b5ed68b02d39 12:02bc078cf612
     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-2010
     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
   157 }
   157 }
   158 
   158 
   159 void initFlowTest()
   159 void initFlowTest()
   160 {
   160 {
   161   DIGRAPH_TYPEDEFS(SmartDigraph);
   161   DIGRAPH_TYPEDEFS(SmartDigraph);
   162   
   162 
   163   SmartDigraph g;
   163   SmartDigraph g;
   164   SmartDigraph::ArcMap<int> cap(g),iflow(g);
   164   SmartDigraph::ArcMap<int> cap(g),iflow(g);
   165   Node s=g.addNode(); Node t=g.addNode();
   165   Node s=g.addNode(); Node t=g.addNode();
   166   Node n1=g.addNode(); Node n2=g.addNode();
   166   Node n1=g.addNode(); Node n2=g.addNode();
   167   Arc a;
   167   Arc a;
   269 
   269 
   270   check(preflow_test.flowValue() == min_cut_value,
   270   check(preflow_test.flowValue() == min_cut_value,
   271         "The max flow value or the three min cut values are incorrect.");
   271         "The max flow value or the three min cut values are incorrect.");
   272 
   272 
   273   initFlowTest();
   273   initFlowTest();
   274   
   274 
   275   return 0;
   275   return 0;
   276 }
   276 }