[Lemon-commits] [lemon_svn] marci: r619 - hugo/trunk/src/work/jacint

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:40:36 CET 2006


Author: marci
Date: Thu Apr 29 12:41:56 2004
New Revision: 619

Modified:
   hugo/trunk/src/work/jacint/preflow.h

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


Modified: hugo/trunk/src/work/jacint/preflow.h
==============================================================================
--- hugo/trunk/src/work/jacint/preflow.h	(original)
+++ hugo/trunk/src/work/jacint/preflow.h	Thu Apr 29 12:41:56 2004
@@ -20,7 +20,7 @@
 
 void run()
 
-T flowValue() : returns the value of a maximum flow
+Num flowValue() : returns the value of a maximum flow
 
 void minMinCut(CutMap& M) : sets M to the characteristic vector of the 
      minimum min cut. M should be a map of bools initialized to false. ??Is it OK?
@@ -45,9 +45,9 @@
 
 namespace hugo {
 
-  template <typename Graph, typename T, 
-	    typename CapMap=typename Graph::template EdgeMap<T>, 
-            typename FlowMap=typename Graph::template EdgeMap<T> >
+  template <typename Graph, typename Num, 
+	    typename CapMap=typename Graph::template EdgeMap<Num>, 
+            typename FlowMap=typename Graph::template EdgeMap<Num> >
   class Preflow {
     
     typedef typename Graph::Node Node;
@@ -66,7 +66,7 @@
     FlowMap* flow;
     int n;      //the number of nodes of G
     typename Graph::template NodeMap<int> level;      
-    typename Graph::template NodeMap<T> excess; 
+    typename Graph::template NodeMap<Num> excess; 
 
 
   public:
@@ -124,7 +124,7 @@
 	  //counting the excess
 	  NodeIt v;
 	  for(g->first(v); g->valid(v); g->next(v)) {
-	    T exc=0;
+	    Num exc=0;
 	  
 	    InEdgeIt e;
 	    for(g->first(e,v); g->valid(e); g->next(e)) exc+=(*flow)[e];
@@ -142,7 +142,7 @@
       case GEN_FLOW:
 	{
 	  //Counting the excess of t
-	  T exc=0;
+	  Num exc=0;
 	  
 	  InEdgeIt e;
 	  for(g->first(e,t); g->valid(e); g->next(e)) exc+=(*flow)[e];
@@ -261,7 +261,7 @@
 
 
     //Returns the maximum value of a flow.
-    T flowValue() {
+    Num flowValue() {
       return excess[t];
     }
 
@@ -365,16 +365,14 @@
       minMinCut(M);
     }
 
-    
-    void resetTarget (const Node _t) {t=_t;}
-
-    void resetSource (const Node _s) {s=_s;}
+    void resetTarget(Node _t) {t=_t;}
+    void resetSource(Node _s) {s=_s;}
    
-    void resetCap (const CapMap& _cap) {
+    void resetCap(const CapMap& _cap) {
       capacity=&_cap;
     }
     
-    void resetFlow (FlowMap& _flow) {
+    void resetFlow(FlowMap& _flow) {
       flow=&_flow;
     }
 
@@ -384,7 +382,7 @@
     int push(const Node w, VecStack& active) {
       
       int lev=level[w];
-      T exc=excess[w];
+      Num exc=excess[w];
       int newlevel=n;       //bound on the next level of w
 	  
       OutEdgeIt e;
@@ -400,9 +398,9 @@
 	    active[lev_v].push(v);
 	  }
 	  
-	  T cap=(*capacity)[e];
-	  T flo=(*flow)[e];
-	  T remcap=cap-flo;
+	  Num cap=(*capacity)[e];
+	  Num flo=(*flow)[e];
+	  Num remcap=cap-flo;
 	  
 	  if ( remcap >= exc ) { //A nonsaturating push.
 	    
@@ -433,7 +431,7 @@
 	      active[lev_v].push(v);
 	    }
 	    
-	    T flo=(*flow)[e];
+	    Num flo=(*flow)[e];
 	    
 	    if ( flo >= exc ) { //A nonsaturating push.
 	      
@@ -494,7 +492,7 @@
 	  OutEdgeIt e;
 	  for(g->first(e,s); g->valid(e); g->next(e)) 
 	    {
-	      T c=(*capacity)[e];
+	      Num c=(*capacity)[e];
 	      if ( c == 0 ) continue;
 	      Node w=g->head(e);
 	      if ( level[w] < n ) {	  
@@ -554,7 +552,7 @@
 	  OutEdgeIt e;
 	  for(g->first(e,s); g->valid(e); g->next(e)) 
 	    {
-	      T rem=(*capacity)[e]-(*flow)[e];
+	      Num rem=(*capacity)[e]-(*flow)[e];
 	      if ( rem == 0 ) continue;
 	      Node w=g->head(e);
 	      if ( level[w] < n ) {	  
@@ -586,7 +584,7 @@
 		  VecNode& level_list, NNMap& left, 
 		  NNMap& right, int& b, int& k, const bool what_heur ) {
 
-      T lev=level[w];	
+      Num lev=level[w];	
       
       Node right_n=right[w];
       Node left_n=left[w];



More information about the Lemon-commits mailing list