diff --git a/test/preflow_test.cc b/test/preflow_test.cc --- a/test/preflow_test.cc +++ b/test/preflow_test.cc @@ -84,18 +84,27 @@ CapMap cap; FlowMap flow; CutMap cut; + VType v; + bool b; - Preflow - ::SetFlowMap - ::SetElevator - ::SetStandardElevator - ::Create preflow_test(g,cap,n,n); + typedef Preflow + ::SetFlowMap + ::SetElevator + ::SetStandardElevator + ::Create PreflowType; + PreflowType preflow_test(g, cap, n, n); + const PreflowType& const_preflow_test = preflow_test; + + const PreflowType::Elevator& elev = const_preflow_test.elevator(); + preflow_test.elevator(const_cast(elev)); + PreflowType::Tolerance tol = const_preflow_test.tolerance(); + preflow_test.tolerance(tol); - preflow_test.capacityMap(cap); - flow = preflow_test.flowMap(); - preflow_test.flowMap(flow); - preflow_test.source(n); - preflow_test.target(n); + preflow_test + .capacityMap(cap) + .flowMap(flow) + .source(n) + .target(n); preflow_test.init(); preflow_test.init(cap); @@ -104,11 +113,13 @@ preflow_test.run(); preflow_test.runMinCut(); - preflow_test.flowValue(); - preflow_test.minCut(n); - preflow_test.minCutMap(cut); - preflow_test.flow(e); - + v = const_preflow_test.flowValue(); + v = const_preflow_test.flow(e); + const FlowMap& fm = const_preflow_test.flowMap(); + b = const_preflow_test.minCut(n); + const_preflow_test.minCutMap(cut); + + ignore_unused_variable_warning(fm); } int cutValue (const SmartDigraph& g,