lemon/graph_adaptor.h
changeset 2346 c06a956a92fa
parent 2277 a7896017fc7d
child 2384 805c5a2a36dd
equal deleted inserted replaced
41:3a14efa455e9 42:685f1667d96e
  1448 
  1448 
  1449     void setCapacity(const CapacityMap& _capacity) { capacity = &_capacity; }
  1449     void setCapacity(const CapacityMap& _capacity) { capacity = &_capacity; }
  1450     void setFlow(const FlowMap& _flow) { flow = &_flow; }
  1450     void setFlow(const FlowMap& _flow) { flow = &_flow; }
  1451 
  1451 
  1452     bool operator[](const typename Graph::Edge& e) const {
  1452     bool operator[](const typename Graph::Edge& e) const {
  1453       return tolerance.less((*flow)[e], (*capacity)[e]);
  1453       return tolerance.positive((*capacity)[e] - (*flow)[e]);
  1454     }
  1454     }
  1455   };
  1455   };
  1456 
  1456 
  1457   template<typename Graph, typename Number,
  1457   template<typename Graph, typename Number,
  1458 	   typename CapacityMap, typename FlowMap,
  1458 	   typename CapacityMap, typename FlowMap,
  1471     ResBackwardFilter(const Tol& _tolerance = Tol())
  1471     ResBackwardFilter(const Tol& _tolerance = Tol())
  1472       : capacity(0), flow(0), tolerance(_tolerance) { }
  1472       : capacity(0), flow(0), tolerance(_tolerance) { }
  1473     void setCapacity(const CapacityMap& _capacity) { capacity = &_capacity; }
  1473     void setCapacity(const CapacityMap& _capacity) { capacity = &_capacity; }
  1474     void setFlow(const FlowMap& _flow) { flow = &_flow; }
  1474     void setFlow(const FlowMap& _flow) { flow = &_flow; }
  1475     bool operator[](const typename Graph::Edge& e) const {
  1475     bool operator[](const typename Graph::Edge& e) const {
  1476       return tolerance.less(0, Number((*flow)[e]));
  1476       return tolerance.positive((*flow)[e]);
  1477     }
  1477     }
  1478   };
  1478   };
  1479 
  1479 
  1480   
  1480   
  1481   ///\ingroup graph_adaptors
  1481   ///\ingroup graph_adaptors