COIN-OR::LEMON - Graph Library

Changeset 116:b6bede534255 in lemon for lemon/random.h


Ignore:
Timestamp:
04/03/08 14:00:18 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
117:7b0ce9fb1169, 123:8899d1891a3c
Phase:
public
Message:

Serious buxfixes in Random::gamma() and Random::pareto()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/random.h

    r110 r116  
    796796          }
    797797      } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
    798       return theta*(xi-gamma(int(std::floor(k))));
     798      return theta*(xi+gamma(int(std::floor(k))));
    799799    }
    800800   
     
    820820    double pareto(double k,double x_min)
    821821    {
    822       return exponential(gamma(k,1.0/x_min));
     822      return exponential(gamma(k,1.0/x_min))+x_min;
    823823    } 
    824824     
Note: See TracChangeset for help on using the changeset viewer.