Fix static member initializations (ticket #30).
authorkpeter
Fri, 07 Mar 2008 00:24:23 +0000
changeset 25938eed667ea23c
parent 2592 f1fb0c31f952
child 2594 97dcc3c5ea31
Fix static member initializations (ticket #30).
lemon/cycle_canceling.h
lemon/network_simplex.h
     1.1 --- a/lemon/cycle_canceling.h	Sun Mar 02 22:55:27 2008 +0000
     1.2 +++ b/lemon/cycle_canceling.h	Fri Mar 07 00:24:23 2008 +0000
     1.3 @@ -122,10 +122,10 @@
     1.4  
     1.5      // The maximum number of iterations for the first execution of the
     1.6      // Bellman-Ford algorithm. It should be at least 2.
     1.7 -    static const int BF_FIRST_LIMIT = 2;
     1.8 +    static const int BF_FIRST_LIMIT  = 2;
     1.9      // The iteration limit for the Bellman-Ford algorithm is multiplied
    1.10 -    // by BF_ALPHA in every round.
    1.11 -    static const double BF_ALPHA = 1.5;
    1.12 +    // by BF_LIMIT_FACTOR/100 in every round.
    1.13 +    static const int BF_LIMIT_FACTOR = 150;
    1.14  
    1.15    private:
    1.16  
    1.17 @@ -501,7 +501,7 @@
    1.18            }
    1.19  
    1.20            if (!cycle_found)
    1.21 -            length_bound = int(length_bound * BF_ALPHA);
    1.22 +            length_bound = length_bound * BF_LIMIT_FACTOR / 100;
    1.23          }
    1.24        }
    1.25      }
     2.1 --- a/lemon/network_simplex.h	Sun Mar 02 22:55:27 2008 +0000
     2.2 +++ b/lemon/network_simplex.h	Fri Mar 07 00:24:23 2008 +0000
     2.3 @@ -280,8 +280,8 @@
     2.4        EdgeIt _next_edge, _min_edge;
     2.5        int _sample_size;
     2.6  
     2.7 +      static const int SAMPLE_SIZE_FACTOR = 15;
     2.8        static const int MIN_SAMPLE_SIZE = 10;
     2.9 -      static const double SAMPLE_SIZE_FACTOR = 0.0015;
    2.10  
    2.11      public:
    2.12  
    2.13 @@ -289,7 +289,8 @@
    2.14        LimitedSearchPivotRule(NetworkSimplex &ns) :
    2.15          _ns(ns), _next_edge(ns._graph), _min_edge(ns._graph)
    2.16        {
    2.17 -        _sample_size = int(SAMPLE_SIZE_FACTOR * countEdges(_ns._graph));
    2.18 +        _sample_size = countEdges(_ns._graph) *
    2.19 +                       SAMPLE_SIZE_FACTOR / 10000;
    2.20          if (_sample_size < MIN_SAMPLE_SIZE)
    2.21            _sample_size = MIN_SAMPLE_SIZE;
    2.22        }
    2.23 @@ -342,8 +343,8 @@
    2.24        int _minor_count;
    2.25        EdgeIt _next_edge;
    2.26  
    2.27 -      static const double LIST_LENGTH_FACTOR = 0.002;
    2.28 -      static const double MINOR_LIMIT_FACTOR = 0.1;
    2.29 +      static const int LIST_LENGTH_FACTOR = 20;
    2.30 +      static const int MINOR_LIMIT_FACTOR = 10;
    2.31        static const int MIN_LIST_LENGTH = 10;
    2.32        static const int MIN_MINOR_LIMIT = 2;
    2.33  
    2.34 @@ -355,10 +356,10 @@
    2.35        {
    2.36          int edge_num = countEdges(_ns._graph);
    2.37          _minor_count = 0;
    2.38 -        _list_length = int(edge_num * LIST_LENGTH_FACTOR);
    2.39 +        _list_length = edge_num * LIST_LENGTH_FACTOR / 10000;
    2.40          if (_list_length < MIN_LIST_LENGTH)
    2.41            _list_length = MIN_LIST_LENGTH;
    2.42 -        _minor_limit = int(_list_length * MINOR_LIMIT_FACTOR);
    2.43 +        _minor_limit = _list_length * MINOR_LIMIT_FACTOR / 100;
    2.44          if (_minor_limit < MIN_MINOR_LIMIT)
    2.45            _minor_limit = MIN_MINOR_LIMIT;
    2.46        }