COIN-OR::LEMON - Graph Library

Changeset 610:dacc2cee2b4c in lemon-main for lemon/preflow.h


Ignore:
Timestamp:
04/17/09 18:14:35 (15 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Slightly modify the interface of Circulation and Preflow (#266)
in order to synchronize them to the interface of NetworkSimplex?.

Circulation:

  • The "delta" notation is replaced by "supply".
  • lowerCapMap(), upperCapMap() are renamed to lowerMap() and upperMap().
  • Value is renamed to Flow.

Preflow:

  • Value is renamed to Flow.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/preflow.h

    r503 r610  
    4747
    4848    /// \brief The type of the flow values.
    49     typedef typename CapacityMap::Value Value;
     49    typedef typename CapacityMap::Value Flow;
    5050
    5151    /// \brief The type of the map that stores the flow values.
     
    5353    /// The type of the map that stores the flow values.
    5454    /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    55     typedef typename Digraph::template ArcMap<Value> FlowMap;
     55    typedef typename Digraph::template ArcMap<Flow> FlowMap;
    5656
    5757    /// \brief Instantiates a FlowMap.
    5858    ///
    5959    /// This function instantiates a \ref FlowMap.
    60     /// \param digraph The digraph, to which we would like to define
     60    /// \param digraph The digraph for which we would like to define
    6161    /// the flow map.
    6262    static FlowMap* createFlowMap(const Digraph& digraph) {
     
    7575    ///
    7676    /// This function instantiates an \ref Elevator.
    77     /// \param digraph The digraph, to which we would like to define
     77    /// \param digraph The digraph for which we would like to define
    7878    /// the elevator.
    7979    /// \param max_level The maximum level of the elevator.
     
    8585    ///
    8686    /// The tolerance used by the algorithm to handle inexact computation.
    87     typedef lemon::Tolerance<Value> Tolerance;
     87    typedef lemon::Tolerance<Flow> Tolerance;
    8888
    8989  };
     
    125125    typedef typename Traits::CapacityMap CapacityMap;
    126126    ///The type of the flow values.
    127     typedef typename Traits::Value Value;
     127    typedef typename Traits::Flow Flow;
    128128
    129129    ///The type of the flow map.
     
    151151    bool _local_level;
    152152
    153     typedef typename Digraph::template NodeMap<Value> ExcessMap;
     153    typedef typename Digraph::template NodeMap<Flow> ExcessMap;
    154154    ExcessMap* _excess;
    155155
     
    470470
    471471      for (NodeIt n(_graph); n != INVALID; ++n) {
    472         Value excess = 0;
     472        Flow excess = 0;
    473473        for (InArcIt e(_graph, n); e != INVALID; ++e) {
    474474          excess += (*_flow)[e];
     
    519519
    520520      for (OutArcIt e(_graph, _source); e != INVALID; ++e) {
    521         Value rem = (*_capacity)[e] - (*_flow)[e];
     521        Flow rem = (*_capacity)[e] - (*_flow)[e];
    522522        if (_tolerance.positive(rem)) {
    523523          Node u = _graph.target(e);
     
    531531      }
    532532      for (InArcIt e(_graph, _source); e != INVALID; ++e) {
    533         Value rem = (*_flow)[e];
     533        Flow rem = (*_flow)[e];
    534534        if (_tolerance.positive(rem)) {
    535535          Node v = _graph.source(e);
     
    564564
    565565        while (num > 0 && n != INVALID) {
    566           Value excess = (*_excess)[n];
     566          Flow excess = (*_excess)[n];
    567567          int new_level = _level->maxLevel();
    568568
    569569          for (OutArcIt e(_graph, n); e != INVALID; ++e) {
    570             Value rem = (*_capacity)[e] - (*_flow)[e];
     570            Flow rem = (*_capacity)[e] - (*_flow)[e];
    571571            if (!_tolerance.positive(rem)) continue;
    572572            Node v = _graph.target(e);
     
    591591
    592592          for (InArcIt e(_graph, n); e != INVALID; ++e) {
    593             Value rem = (*_flow)[e];
     593            Flow rem = (*_flow)[e];
    594594            if (!_tolerance.positive(rem)) continue;
    595595            Node v = _graph.source(e);
     
    637637        num = _node_num * 20;
    638638        while (num > 0 && n != INVALID) {
    639           Value excess = (*_excess)[n];
     639          Flow excess = (*_excess)[n];
    640640          int new_level = _level->maxLevel();
    641641
    642642          for (OutArcIt e(_graph, n); e != INVALID; ++e) {
    643             Value rem = (*_capacity)[e] - (*_flow)[e];
     643            Flow rem = (*_capacity)[e] - (*_flow)[e];
    644644            if (!_tolerance.positive(rem)) continue;
    645645            Node v = _graph.target(e);
     
    664664
    665665          for (InArcIt e(_graph, n); e != INVALID; ++e) {
    666             Value rem = (*_flow)[e];
     666            Flow rem = (*_flow)[e];
    667667            if (!_tolerance.positive(rem)) continue;
    668668            Node v = _graph.source(e);
     
    778778      Node n;
    779779      while ((n = _level->highestActive()) != INVALID) {
    780         Value excess = (*_excess)[n];
     780        Flow excess = (*_excess)[n];
    781781        int level = _level->highestActiveLevel();
    782782        int new_level = _level->maxLevel();
    783783
    784784        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
    785           Value rem = (*_capacity)[e] - (*_flow)[e];
     785          Flow rem = (*_capacity)[e] - (*_flow)[e];
    786786          if (!_tolerance.positive(rem)) continue;
    787787          Node v = _graph.target(e);
     
    806806
    807807        for (InArcIt e(_graph, n); e != INVALID; ++e) {
    808           Value rem = (*_flow)[e];
     808          Flow rem = (*_flow)[e];
    809809          if (!_tolerance.positive(rem)) continue;
    810810          Node v = _graph.source(e);
     
    897897    /// \pre Either \ref run() or \ref init() must be called before
    898898    /// using this function.
    899     Value flowValue() const {
     899    Flow flowValue() const {
    900900      return (*_excess)[_target];
    901901    }
     
    908908    /// \pre Either \ref run() or \ref init() must be called before
    909909    /// using this function.
    910     Value flow(const Arc& arc) const {
     910    Flow flow(const Arc& arc) const {
    911911      return (*_flow)[arc];
    912912    }
Note: See TracChangeset for help on using the changeset viewer.