# HG changeset patch # User kpeter # Date 1204849463 0 # Node ID 8eed667ea23caefaf37c41cc3fe6d84923e410ec # Parent f1fb0c31f952e8d865a4c95f5fa436a135561385 Fix static member initializations (ticket #30). diff -r f1fb0c31f952 -r 8eed667ea23c lemon/cycle_canceling.h --- a/lemon/cycle_canceling.h Sun Mar 02 22:55:27 2008 +0000 +++ b/lemon/cycle_canceling.h Fri Mar 07 00:24:23 2008 +0000 @@ -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; } } } diff -r f1fb0c31f952 -r 8eed667ea23c lemon/network_simplex.h --- a/lemon/network_simplex.h Sun Mar 02 22:55:27 2008 +0000 +++ b/lemon/network_simplex.h Fri Mar 07 00:24:23 2008 +0000 @@ -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; }