COIN-OR::LEMON - Graph Library

Changeset 2593:8eed667ea23c in lemon-0.x


Ignore:
Timestamp:
03/07/08 01:24:23 (16 years ago)
Author:
Peter Kovacs
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3476
Message:

Fix static member initializations (ticket #30).

Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/cycle_canceling.h

    r2588 r2593  
    123123    // The maximum number of iterations for the first execution of the
    124124    // Bellman-Ford algorithm. It should be at least 2.
    125     static const int BF_FIRST_LIMIT = 2;
     125    static const int BF_FIRST_LIMIT  = 2;
    126126    // The iteration limit for the Bellman-Ford algorithm is multiplied
    127     // by BF_ALPHA in every round.
    128     static const double BF_ALPHA = 1.5;
     127    // by BF_LIMIT_FACTOR/100 in every round.
     128    static const int BF_LIMIT_FACTOR = 150;
    129129
    130130  private:
     
    502502
    503503          if (!cycle_found)
    504             length_bound = int(length_bound * BF_ALPHA);
     504            length_bound = length_bound * BF_LIMIT_FACTOR / 100;
    505505        }
    506506      }
  • lemon/network_simplex.h

    r2588 r2593  
    281281      int _sample_size;
    282282
     283      static const int SAMPLE_SIZE_FACTOR = 15;
    283284      static const int MIN_SAMPLE_SIZE = 10;
    284       static const double SAMPLE_SIZE_FACTOR = 0.0015;
    285285
    286286    public:
     
    290290        _ns(ns), _next_edge(ns._graph), _min_edge(ns._graph)
    291291      {
    292         _sample_size = int(SAMPLE_SIZE_FACTOR * countEdges(_ns._graph));
     292        _sample_size = countEdges(_ns._graph) *
     293                       SAMPLE_SIZE_FACTOR / 10000;
    293294        if (_sample_size < MIN_SAMPLE_SIZE)
    294295          _sample_size = MIN_SAMPLE_SIZE;
     
    343344      EdgeIt _next_edge;
    344345
    345       static const double LIST_LENGTH_FACTOR = 0.002;
    346       static const double MINOR_LIMIT_FACTOR = 0.1;
     346      static const int LIST_LENGTH_FACTOR = 20;
     347      static const int MINOR_LIMIT_FACTOR = 10;
    347348      static const int MIN_LIST_LENGTH = 10;
    348349      static const int MIN_MINOR_LIMIT = 2;
     
    356357        int edge_num = countEdges(_ns._graph);
    357358        _minor_count = 0;
    358         _list_length = int(edge_num * LIST_LENGTH_FACTOR);
     359        _list_length = edge_num * LIST_LENGTH_FACTOR / 10000;
    359360        if (_list_length < MIN_LIST_LENGTH)
    360361          _list_length = MIN_LIST_LENGTH;
    361         _minor_limit = int(_list_length * MINOR_LIMIT_FACTOR);
     362        _minor_limit = _list_length * MINOR_LIMIT_FACTOR / 100;
    362363        if (_minor_limit < MIN_MINOR_LIMIT)
    363364          _minor_limit = MIN_MINOR_LIMIT;
Note: See TracChangeset for help on using the changeset viewer.