COIN-OR::LEMON - Graph Library

Changeset 468:3a2cb784750a in lemon-0.x for src/work


Ignore:
Timestamp:
04/29/04 12:41:56 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@619
Message:

nem irunk olyat hogy "void resetTarget(const Node _t) {t=_t;}" mert az a const az ott jobbara hulyeseg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/jacint/preflow.h

    r466 r468  
    2121void run()
    2222
    23 T flowValue() : returns the value of a maximum flow
     23Num flowValue() : returns the value of a maximum flow
    2424
    2525void minMinCut(CutMap& M) : sets M to the characteristic vector of the
     
    4646namespace hugo {
    4747
    48   template <typename Graph, typename T,
    49             typename CapMap=typename Graph::template EdgeMap<T>,
    50             typename FlowMap=typename Graph::template EdgeMap<T> >
     48  template <typename Graph, typename Num,
     49            typename CapMap=typename Graph::template EdgeMap<Num>,
     50            typename FlowMap=typename Graph::template EdgeMap<Num> >
    5151  class Preflow {
    5252   
     
    6767    int n;      //the number of nodes of G
    6868    typename Graph::template NodeMap<int> level;     
    69     typename Graph::template NodeMap<T> excess;
     69    typename Graph::template NodeMap<Num> excess;
    7070
    7171
     
    125125          NodeIt v;
    126126          for(g->first(v); g->valid(v); g->next(v)) {
    127             T exc=0;
     127            Num exc=0;
    128128         
    129129            InEdgeIt e;
     
    143143        {
    144144          //Counting the excess of t
    145           T exc=0;
     145          Num exc=0;
    146146         
    147147          InEdgeIt e;
     
    262262
    263263    //Returns the maximum value of a flow.
    264     T flowValue() {
     264    Num flowValue() {
    265265      return excess[t];
    266266    }
     
    366366    }
    367367
     368    void resetTarget(Node _t) {t=_t;}
     369    void resetSource(Node _s) {s=_s;}
     370   
     371    void resetCap(const CapMap& _cap) {
     372      capacity=&_cap;
     373    }
    368374   
    369     void resetTarget (const Node _t) {t=_t;}
    370 
    371     void resetSource (const Node _s) {s=_s;}
    372    
    373     void resetCap (const CapMap& _cap) {
    374       capacity=&_cap;
    375     }
    376    
    377     void resetFlow (FlowMap& _flow) {
     375    void resetFlow(FlowMap& _flow) {
    378376      flow=&_flow;
    379377    }
     
    385383     
    386384      int lev=level[w];
    387       T exc=excess[w];
     385      Num exc=excess[w];
    388386      int newlevel=n;       //bound on the next level of w
    389387         
     
    401399          }
    402400         
    403           T cap=(*capacity)[e];
    404           T flo=(*flow)[e];
    405           T remcap=cap-flo;
     401          Num cap=(*capacity)[e];
     402          Num flo=(*flow)[e];
     403          Num remcap=cap-flo;
    406404         
    407405          if ( remcap >= exc ) { //A nonsaturating push.
     
    434432            }
    435433           
    436             T flo=(*flow)[e];
     434            Num flo=(*flow)[e];
    437435           
    438436            if ( flo >= exc ) { //A nonsaturating push.
     
    495493          for(g->first(e,s); g->valid(e); g->next(e))
    496494            {
    497               T c=(*capacity)[e];
     495              Num c=(*capacity)[e];
    498496              if ( c == 0 ) continue;
    499497              Node w=g->head(e);
     
    555553          for(g->first(e,s); g->valid(e); g->next(e))
    556554            {
    557               T rem=(*capacity)[e]-(*flow)[e];
     555              Num rem=(*capacity)[e]-(*flow)[e];
    558556              if ( rem == 0 ) continue;
    559557              Node w=g->head(e);
     
    587585                  NNMap& right, int& b, int& k, const bool what_heur ) {
    588586
    589       T lev=level[w];   
     587      Num lev=level[w];
    590588     
    591589      Node right_n=right[w];
Note: See TracChangeset for help on using the changeset viewer.