Changeset 910


Ignore:
Timestamp:
Apr 10, 2008 11:55:40 AM (11 years ago)
Author:
ladanyi
Message:

change usage of pow() and log() to appease MSVC++

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/heur/Cbc/src/CbcHeuristic.cpp

    r906 r910  
    105105  lastRunDeep_(0),
    106106  numRuns_(0),
    107   numCouldRun_(0),
    108107  minDistanceToRun_(1),
    109   runNodes_()
     108  runNodes_(),
     109  numCouldRun_(0)
    110110{
    111111  // As CbcHeuristic virtual need to modify .cpp if above change
     
    128128  lastRunDeep_(0),
    129129  numRuns_(0),
    130   numCouldRun_(0),
    131130  minDistanceToRun_(1),
    132   runNodes_()
     131  runNodes_(),
     132  numCouldRun_(0)
    133133{}
    134134
     
    311311#if 1
    312312    double minDistance = nodeDesc->minDistance(runNodes_);
    313     double minDistanceToRun = 1.5 * log(depth) / log(2);
     313    double minDistanceToRun = 1.5 * log((double)depth) / log((double)2);
    314314    std::cout<<"minDistance = "<<minDistance
    315315             <<", minDistanceToRun = "<<minDistanceToRun<<std::endl;
     
    339339
    340340  if(depth != 0) {
    341 
    342     double probability = pow(depth,2) / pow(2,depth);
     341    const double numerator = depth * depth;
     342    const double denominator = exp(depth * log((double)2));
     343    double probability = numerator / denominator;
    343344    double randomNumber = randomNumberGenerator_.randomDouble();
    344345    if (randomNumber>probability)
Note: See TracChangeset for help on using the changeset viewer.