[Lemon-commits] kpeter: r3477 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Fri Mar 7 01:24:24 CET 2008


Author: kpeter
Date: Fri Mar  7 01:24:23 2008
New Revision: 3477

Modified:
   lemon/trunk/lemon/cycle_canceling.h
   lemon/trunk/lemon/network_simplex.h

Log:
Fix static member initializations (ticket #30).


Modified: lemon/trunk/lemon/cycle_canceling.h
==============================================================================
--- lemon/trunk/lemon/cycle_canceling.h	(original)
+++ lemon/trunk/lemon/cycle_canceling.h	Fri Mar  7 01:24:23 2008
@@ -122,10 +122,10 @@
 
     // The maximum number of iterations for the first execution of the
     // Bellman-Ford algorithm. It should be at least 2.
-    static const int BF_FIRST_LIMIT = 2;
+    static const int BF_FIRST_LIMIT  = 2;
     // The iteration limit for the Bellman-Ford algorithm is multiplied
-    // by BF_ALPHA in every round.
-    static const double BF_ALPHA = 1.5;
+    // by BF_LIMIT_FACTOR/100 in every round.
+    static const int BF_LIMIT_FACTOR = 150;
 
   private:
 
@@ -501,7 +501,7 @@
           }
 
           if (!cycle_found)
-            length_bound = int(length_bound * BF_ALPHA);
+            length_bound = length_bound * BF_LIMIT_FACTOR / 100;
         }
       }
     }

Modified: lemon/trunk/lemon/network_simplex.h
==============================================================================
--- lemon/trunk/lemon/network_simplex.h	(original)
+++ lemon/trunk/lemon/network_simplex.h	Fri Mar  7 01:24:23 2008
@@ -280,8 +280,8 @@
       EdgeIt _next_edge, _min_edge;
       int _sample_size;
 
+      static const int SAMPLE_SIZE_FACTOR = 15;
       static const int MIN_SAMPLE_SIZE = 10;
-      static const double SAMPLE_SIZE_FACTOR = 0.0015;
 
     public:
 
@@ -289,7 +289,8 @@
       LimitedSearchPivotRule(NetworkSimplex &ns) :
         _ns(ns), _next_edge(ns._graph), _min_edge(ns._graph)
       {
-        _sample_size = int(SAMPLE_SIZE_FACTOR * countEdges(_ns._graph));
+        _sample_size = countEdges(_ns._graph) *
+                       SAMPLE_SIZE_FACTOR / 10000;
         if (_sample_size < MIN_SAMPLE_SIZE)
           _sample_size = MIN_SAMPLE_SIZE;
       }
@@ -342,8 +343,8 @@
       int _minor_count;
       EdgeIt _next_edge;
 
-      static const double LIST_LENGTH_FACTOR = 0.002;
-      static const double MINOR_LIMIT_FACTOR = 0.1;
+      static const int LIST_LENGTH_FACTOR = 20;
+      static const int MINOR_LIMIT_FACTOR = 10;
       static const int MIN_LIST_LENGTH = 10;
       static const int MIN_MINOR_LIMIT = 2;
 
@@ -355,10 +356,10 @@
       {
         int edge_num = countEdges(_ns._graph);
         _minor_count = 0;
-        _list_length = int(edge_num * LIST_LENGTH_FACTOR);
+        _list_length = edge_num * LIST_LENGTH_FACTOR / 10000;
         if (_list_length < MIN_LIST_LENGTH)
           _list_length = MIN_LIST_LENGTH;
-        _minor_limit = int(_list_length * MINOR_LIMIT_FACTOR);
+        _minor_limit = _list_length * MINOR_LIMIT_FACTOR / 100;
         if (_minor_limit < MIN_MINOR_LIMIT)
           _minor_limit = MIN_MINOR_LIMIT;
       }



More information about the Lemon-commits mailing list