lemon/network_simplex.h
changeset 659 0c8e5c688440
parent 656 e6927fe719e6
child 665 b95898314e09
     1.1 --- a/lemon/network_simplex.h	Tue Apr 21 15:18:54 2009 +0100
     1.2 +++ b/lemon/network_simplex.h	Thu Apr 23 10:44:35 2009 +0100
     1.3 @@ -381,7 +381,8 @@
     1.4          const double BLOCK_SIZE_FACTOR = 2.0;
     1.5          const int MIN_BLOCK_SIZE = 10;
     1.6  
     1.7 -        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
     1.8 +        _block_size = std::max( int(BLOCK_SIZE_FACTOR *
     1.9 +                                    std::sqrt(double(_arc_num))),
    1.10                                  MIN_BLOCK_SIZE );
    1.11        }
    1.12  
    1.13 @@ -457,7 +458,8 @@
    1.14          const double MINOR_LIMIT_FACTOR = 0.1;
    1.15          const int MIN_MINOR_LIMIT = 3;
    1.16  
    1.17 -        _list_length = std::max( int(LIST_LENGTH_FACTOR * sqrt(_arc_num)),
    1.18 +        _list_length = std::max( int(LIST_LENGTH_FACTOR *
    1.19 +                                     std::sqrt(double(_arc_num))),
    1.20                                   MIN_LIST_LENGTH );
    1.21          _minor_limit = std::max( int(MINOR_LIMIT_FACTOR * _list_length),
    1.22                                   MIN_MINOR_LIMIT );
    1.23 @@ -577,7 +579,8 @@
    1.24          const double HEAD_LENGTH_FACTOR = 0.1;
    1.25          const int MIN_HEAD_LENGTH = 3;
    1.26  
    1.27 -        _block_size = std::max( int(BLOCK_SIZE_FACTOR * sqrt(_arc_num)),
    1.28 +        _block_size = std::max( int(BLOCK_SIZE_FACTOR *
    1.29 +                                    std::sqrt(double(_arc_num))),
    1.30                                  MIN_BLOCK_SIZE );
    1.31          _head_length = std::max( int(HEAD_LENGTH_FACTOR * _block_size),
    1.32                                   MIN_HEAD_LENGTH );
    1.33 @@ -1225,7 +1228,7 @@
    1.34        }
    1.35  
    1.36        // Store the arcs in a mixed order
    1.37 -      int k = std::max(int(sqrt(_arc_num)), 10);
    1.38 +      int k = std::max(int(std::sqrt(double(_arc_num))), 10);
    1.39        int i = 0;
    1.40        for (ArcIt e(_graph); e != INVALID; ++e) {
    1.41          _arc_ref[i] = e;