test/circulation_test.cc
changeset 995 659ba4805a48
parent 736 86c49553fea5
child 1173 d216e1c8b3fa
equal deleted inserted replaced
6:72650533020b 7:e8ef63671657
     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
    79             ::SetElevator<Elev>
    79             ::SetElevator<Elev>
    80             ::SetStandardElevator<LinkedElev>
    80             ::SetStandardElevator<LinkedElev>
    81             ::Create CirculationType;
    81             ::Create CirculationType;
    82   CirculationType circ_test(g, lcap, ucap, supply);
    82   CirculationType circ_test(g, lcap, ucap, supply);
    83   const CirculationType& const_circ_test = circ_test;
    83   const CirculationType& const_circ_test = circ_test;
    84    
    84 
    85   circ_test
    85   circ_test
    86     .lowerMap(lcap)
    86     .lowerMap(lcap)
    87     .upperMap(ucap)
    87     .upperMap(ucap)
    88     .supplyMap(supply)
    88     .supplyMap(supply)
    89     .flowMap(flow);
    89     .flowMap(flow);
    90   
    90 
    91   const CirculationType::Elevator& elev = const_circ_test.elevator();
    91   const CirculationType::Elevator& elev = const_circ_test.elevator();
    92   circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
    92   circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
    93   CirculationType::Tolerance tol = const_circ_test.tolerance();
    93   CirculationType::Tolerance tol = const_circ_test.tolerance();
    94   circ_test.tolerance(tol);
    94   circ_test.tolerance(tol);
    95 
    95 
   100 
   100 
   101   v = const_circ_test.flow(a);
   101   v = const_circ_test.flow(a);
   102   const FlowMap& fm = const_circ_test.flowMap();
   102   const FlowMap& fm = const_circ_test.flowMap();
   103   b = const_circ_test.barrier(n);
   103   b = const_circ_test.barrier(n);
   104   const_circ_test.barrierMap(bar);
   104   const_circ_test.barrierMap(bar);
   105   
   105 
   106   ignore_unused_variable_warning(fm);
   106   ignore_unused_variable_warning(fm);
   107 }
   107 }
   108 
   108 
   109 template <class G, class LM, class UM, class DM>
   109 template <class G, class LM, class UM, class DM>
   110 void checkCirculation(const G& g, const LM& lm, const UM& um,
   110 void checkCirculation(const G& g, const LM& lm, const UM& um,