test/preflow_test.cc
changeset 877 141f9c0db4a3
parent 689 86c49553fea5
child 902 79fab87ee483
equal deleted inserted replaced
7:9fb91d5a8a92 8:cda9f62537a7
     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-2010
     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
    92             ::SetElevator<Elev>
    92             ::SetElevator<Elev>
    93             ::SetStandardElevator<LinkedElev>
    93             ::SetStandardElevator<LinkedElev>
    94             ::Create PreflowType;
    94             ::Create PreflowType;
    95   PreflowType preflow_test(g, cap, n, n);
    95   PreflowType preflow_test(g, cap, n, n);
    96   const PreflowType& const_preflow_test = preflow_test;
    96   const PreflowType& const_preflow_test = preflow_test;
    97   
    97 
    98   const PreflowType::Elevator& elev = const_preflow_test.elevator();
    98   const PreflowType::Elevator& elev = const_preflow_test.elevator();
    99   preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
    99   preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
   100   PreflowType::Tolerance tol = const_preflow_test.tolerance();
   100   PreflowType::Tolerance tol = const_preflow_test.tolerance();
   101   preflow_test.tolerance(tol);
   101   preflow_test.tolerance(tol);
   102 
   102 
   116   v = const_preflow_test.flowValue();
   116   v = const_preflow_test.flowValue();
   117   v = const_preflow_test.flow(e);
   117   v = const_preflow_test.flow(e);
   118   const FlowMap& fm = const_preflow_test.flowMap();
   118   const FlowMap& fm = const_preflow_test.flowMap();
   119   b = const_preflow_test.minCut(n);
   119   b = const_preflow_test.minCut(n);
   120   const_preflow_test.minCutMap(cut);
   120   const_preflow_test.minCutMap(cut);
   121   
   121 
   122   ignore_unused_variable_warning(fm);
   122   ignore_unused_variable_warning(fm);
   123 }
   123 }
   124 
   124 
   125 int cutValue (const SmartDigraph& g,
   125 int cutValue (const SmartDigraph& g,
   126               const SmartDigraph::NodeMap<bool>& cut,
   126               const SmartDigraph::NodeMap<bool>& cut,