Ignore:
Timestamp:
Nov 5, 2009 10:57:25 AM (10 years ago)
Author:
forrest
Message:

Creating new stable branch 2.4 from trunk (rev 1270)

Location:
stable/2.4
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable/2.4

    • Property svn:externals
      •  

        old new  
        77CoinUtils         https://projects.coin-or.org/svn/CoinUtils/stable/2.5/CoinUtils
        88Cgl               https://projects.coin-or.org/svn/Cgl/stable/0.54/Cgl
        9 Clp               https://projects.coin-or.org/svn/Clp/stable/1.10/Clp
         9Clp               https://projects.coin-or.org/svn/Clp/stable/1.11/Clp
        1010Osi               https://projects.coin-or.org/svn/Osi/stable/0.100/Osi
        1111Vol               https://projects.coin-or.org/svn/Vol/stable/1.1/Vol
  • stable/2.4/Cbc/src/CbcBranchDynamic.cpp

    r1132 r1271  
     1/* $Id$ */
    12// Copyright (C) 2002, International Business Machines
    23// Corporation and others.  All Rights Reserved.
     
    2021#ifdef COIN_DEVELOP
    2122typedef struct {
     23  double sumUp_;
     24  double upEst_; // or change in obj in update
     25  double sumDown_;
     26  double downEst_; // or movement in value in update
     27  int sequence_;
     28  int numberUp_;
     29  int numberUpInf_;
     30  int numberDown_;
     31  int numberDownInf_;
    2232  char where_;
    2333  char status_;
    24   unsigned short sequence_;
    25   int numberUp_;
    26   int numberUpInf_;
    27   float sumUp_;
    28   float upEst_; // or change in obj in update
    29   int numberDown_;
    30   int numberDownInf_;
    31   float sumDown_;
    32   float downEst_; // or movement in value in update
    3334} History;
    3435History * history=NULL;
     
    113114    sumDownChange_(0.0),
    114115    sumUpChange_(0.0),
    115     sumDownCostSquared_(0.0),
    116     sumUpCostSquared_(0.0),
     116    downShadowPrice_(0.0),
     117    upShadowPrice_(0.0),
    117118    sumDownDecrease_(0.0),
    118119    sumUpDecrease_(0.0),
     
    133134    method_(0)
    134135{
    135 #ifdef CBC_INSTRUMENT
    136   numberTimesInfeasible_=0;
    137 #endif
    138136}
    139137
     
    150148    sumDownChange_(0.0),
    151149    sumUpChange_(0.0),
    152     sumDownCostSquared_(0.0),
    153     sumUpCostSquared_(0.0),
     150    downShadowPrice_(0.0),
     151    upShadowPrice_(0.0),
    154152    sumDownDecrease_(0.0),
    155153    sumUpDecrease_(0.0),
     
    170168    method_(0)
    171169{
    172 #ifdef CBC_INSTRUMENT
    173   numberTimesInfeasible_=0;
    174 #endif
    175170  const double * cost = model->getObjCoefficients();
    176171  double costValue = CoinMax(1.0e-5,fabs(cost[iColumn]));
     
    218213    sumDownChange_(0.0),
    219214    sumUpChange_(0.0),
    220     sumDownCostSquared_(0.0),
    221     sumUpCostSquared_(0.0),
     215    downShadowPrice_(0.0),
     216    upShadowPrice_(0.0),
    222217    sumDownDecrease_(0.0),
    223218    sumUpDecrease_(0.0),
     
    238233    method_(0)
    239234{
    240 #ifdef CBC_INSTRUMENT
    241   numberTimesInfeasible_=0;
    242 #endif
    243235  downDynamicPseudoCost_ = downDynamicPseudoCost;
    244236  upDynamicPseudoCost_ = upDynamicPseudoCost;
     
    275267*/
    276268CbcSimpleIntegerDynamicPseudoCost::CbcSimpleIntegerDynamicPseudoCost (CbcModel * model,
    277                                     int dummy, int iColumn, double downDynamicPseudoCost,
     269                                                                      int /*dummy*/,
     270                                                                      int iColumn, double downDynamicPseudoCost,
    278271                                                        double upDynamicPseudoCost)
    279272{
     
    291284   sumDownChange_(rhs.sumDownChange_),
    292285   sumUpChange_(rhs.sumUpChange_),
    293    sumDownCostSquared_(rhs.sumDownCostSquared_),
    294    sumUpCostSquared_(rhs.sumUpCostSquared_),
     286   downShadowPrice_(rhs.downShadowPrice_),
     287   upShadowPrice_(rhs.upShadowPrice_),
    295288   sumDownDecrease_(rhs.sumDownDecrease_),
    296289   sumUpDecrease_(rhs.sumUpDecrease_),
     
    312305
    313306{
    314 #ifdef CBC_INSTRUMENT
    315   numberTimesInfeasible_=rhs.numberTimesInfeasible_;
    316 #endif
    317307}
    318308
     
    337327    sumDownChange_ = rhs.sumDownChange_;
    338328    sumUpChange_ = rhs.sumUpChange_;
    339     sumDownCostSquared_ = rhs.sumDownCostSquared_;
    340     sumUpCostSquared_ = rhs.sumUpCostSquared_;
     329    downShadowPrice_ = rhs.downShadowPrice_;
     330    upShadowPrice_ = rhs.upShadowPrice_;
    341331    sumDownDecrease_ = rhs.sumDownDecrease_;
    342332    sumUpDecrease_ = rhs.sumUpDecrease_;
     
    355345    numberTimesUpTotalFixed_ = rhs.numberTimesUpTotalFixed_;
    356346    numberTimesProbingTotal_ = rhs.numberTimesProbingTotal_;
    357 #ifdef CBC_INSTRUMENT
    358     numberTimesInfeasible_=rhs.numberTimesInfeasible_;
    359 #endif
    360347    method_=rhs.method_;
    361348  }
     
    377364  sumDownChange_ = otherObject->sumDownChange_;
    378365  sumUpChange_ = otherObject->sumUpChange_;
    379   sumDownCostSquared_ = otherObject->sumDownCostSquared_;
    380   sumUpCostSquared_ = otherObject->sumUpCostSquared_;
     366  downShadowPrice_ = otherObject->downShadowPrice_;
     367  upShadowPrice_ = otherObject->upShadowPrice_;
    381368  sumDownDecrease_ = otherObject->sumDownDecrease_;
    382369  sumUpDecrease_ = otherObject->sumUpDecrease_;
     
    447434  sumDownChange_ += rhsObject->sumDownChange_-baseObject->sumDownChange_;
    448435  sumUpChange_ += rhsObject->sumUpChange_-baseObject->sumUpChange_;
    449   sumDownCostSquared_ += rhsObject->sumDownCostSquared_-baseObject->sumDownCostSquared_;
    450   sumUpCostSquared_ += rhsObject->sumUpCostSquared_-baseObject->sumUpCostSquared_;
     436  downShadowPrice_ = 0.0;
     437  upShadowPrice_ = 0.0;
    451438  sumDownDecrease_ += rhsObject->sumDownDecrease_-baseObject->sumDownDecrease_;
    452439  sumUpDecrease_ += rhsObject->sumUpDecrease_-baseObject->sumUpDecrease_;
     
    491478  if (sumUpChange_!= otherObject->sumUpChange_)
    492479    okay=false;
    493   if (sumDownCostSquared_!= otherObject->sumDownCostSquared_)
    494     okay=false;
    495   if (sumUpCostSquared_!= otherObject->sumUpCostSquared_)
     480  if (downShadowPrice_!= otherObject->downShadowPrice_)
     481    okay=false;
     482  if (upShadowPrice_!= otherObject->upShadowPrice_)
    496483    okay=false;
    497484  if (sumDownDecrease_!= otherObject->sumDownDecrease_)
     
    526513    okay=false;
    527514  return okay;
    528 }
    529 // Creates a branching objecty
    530 CbcBranchingObject *
    531 CbcSimpleIntegerDynamicPseudoCost::createBranch(int way)
    532 {
    533   const double * solution = model_->testSolution();
    534   const double * lower = model_->getCbcColLower();
    535   const double * upper = model_->getCbcColUpper();
    536   double value = solution[columnNumber_];
    537   value = CoinMax(value, lower[columnNumber_]);
    538   value = CoinMin(value, upper[columnNumber_]);
    539 #ifndef NDEBUG
    540   double nearest = floor(value+0.5);
    541   double integerTolerance =
    542     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    543   assert (upper[columnNumber_]>lower[columnNumber_]);
    544 #endif
    545   if (!model_->hotstartSolution()) {
    546     assert (fabs(value-nearest)>integerTolerance);
    547   } else {
    548     const double * hotstartSolution = model_->hotstartSolution();
    549     double targetValue = hotstartSolution[columnNumber_];
    550     if (way>0)
    551       value = targetValue-0.1;
    552     else
    553       value = targetValue+0.1;
    554   }
    555   CbcDynamicPseudoCostBranchingObject * newObject =
    556     new CbcDynamicPseudoCostBranchingObject(model_,columnNumber_,way,
    557                                             value,this);
    558   double up =  upDynamicPseudoCost_*(ceil(value)-value);
    559   double down =  downDynamicPseudoCost_*(value-floor(value));
    560   double changeInGuessed=up-down;
    561   if (way>0)
    562     changeInGuessed = - changeInGuessed;
    563   changeInGuessed=CoinMax(0.0,changeInGuessed);
    564   //if (way>0)
    565   //changeInGuessed += 1.0e8; // bias to stay up
    566   newObject->setChangeInGuessed(changeInGuessed);
    567   newObject->setOriginalObject(this);
    568   return newObject;
    569515}
    570516/* Create an OsiSolverBranch object
     
    594540}
    595541//#define FUNNY_BRANCHING 
    596 // Infeasibility - large is 0.5
    597542double
    598 CbcSimpleIntegerDynamicPseudoCost::infeasibility(int & preferredWay) const
     543CbcSimpleIntegerDynamicPseudoCost::infeasibility(const OsiBranchingInformation * info,
     544                               int &preferredWay) const
    599545{
    600546  assert (downDynamicPseudoCost_>1.0e-40&&upDynamicPseudoCost_>1.0e-40);
     
    611557      // Lower bound active
    612558      lastUpDecrease_++;
    613       sumDownCostSquared_ += djValue;
    614559    }
    615560  } else if (djValue<-1.0e-6) {
     
    618563      // Upper bound active
    619564      lastUpDecrease_++;
    620       sumUpCostSquared_ -= djValue;
    621565    }
    622566  }
     
    673617#endif
    674618#endif
    675   if (number>0.0)
    676     downCost *= sum / number;
    677   else
    678     downCost  *=  downDynamicPseudoCost_;
     619#define MOD_SHADOW 1
     620#if MOD_SHADOW>0
     621  if (!downShadowPrice_) {
     622    if (number>0.0)
     623      downCost *= sum / number;
     624    else
     625      downCost  *=  downDynamicPseudoCost_;
     626  } else if (downShadowPrice_>0.0) {
     627    downCost *= downShadowPrice_;
     628  } else {
     629    downCost *= (downDynamicPseudoCost_-downShadowPrice_);
     630  }
     631#else
     632  if (downShadowPrice_<=0.0) {
     633    if (number>0.0)
     634      downCost *= sum / number;
     635    else
     636      downCost  *=  downDynamicPseudoCost_;
     637  } else {
     638    downCost *= downShadowPrice_;
     639  }
     640#endif
    679641  double upCost = CoinMax((above-value),0.0);
    680642#if TYPE2==0
     
    696658#endif
    697659#endif
    698   if (number>0.0)
    699     upCost *= sum / number;
    700   else
    701     upCost  *=  upDynamicPseudoCost_;
     660#if MOD_SHADOW>0
     661  if (!upShadowPrice_) {
     662    if (number>0.0)
     663      upCost *= sum / number;
     664    else
     665      upCost  *=  upDynamicPseudoCost_;
     666  } else if (upShadowPrice_>0.0) {
     667    upCost *= upShadowPrice_;
     668  } else {
     669    upCost *= (upDynamicPseudoCost_-upShadowPrice_);
     670  }
     671#else
     672  if (upShadowPrice_<=0.0) {
     673    if (number>0.0)
     674      upCost *= sum / number;
     675    else
     676      upCost  *=  upDynamicPseudoCost_;
     677  } else {
     678    upCost *= upShadowPrice_;
     679  }
     680#endif
    702681  if (downCost>=upCost)
    703682    preferredWay=1;
     
    714693    upCost *= ratio;
    715694    if ((lastUpDecrease_%100)==-1)
    716       printf("col %d total %d djtimes %d down %g up %g\n",
    717              columnNumber_,lastDownDecrease_,lastUpDecrease_,
    718              sumDownCostSquared_,sumUpCostSquared_);
     695      printf("col %d total %d djtimes %d\n",
     696             columnNumber_,lastDownDecrease_,lastUpDecrease_);
    719697  }
    720698#endif
    721699  if (preferredWay_)
    722700    preferredWay=preferredWay_;
     701  if (info->hotstartSolution_) {
     702    double targetValue = info->hotstartSolution_[columnNumber_];
     703    if (value>targetValue)
     704      preferredWay=-1;
     705    else
     706      preferredWay=1;
     707  }
    723708  // weight at 1.0 is max min
    724709#define WEIGHT_AFTER 0.8
    725710#define WEIGHT_BEFORE 0.1
     711  //Stolen from Constraint Integer Programming book (with epsilon change)
     712#define WEIGHT_PRODUCT
    726713  if (fabs(value-nearest)<=integerTolerance) {
    727714    if (priority_!=-999)
     
    730717      return 1.0e-13;
    731718  } else {
    732 #ifdef CBC_INSTRUMENT
    733     numberTimesInfeasible_++;
    734 #endif
    735719    int stateOfSearch = model_->stateOfSearch()%10;
    736720    double returnValue=0.0;
     
    770754      // some solution
    771755      where='I';
     756#ifndef WEIGHT_PRODUCT
    772757      returnValue = WEIGHT_AFTER*minValue + (1.0-WEIGHT_AFTER)*maxValue;
     758#else
     759      double minProductWeight = model_->getDblParam(CbcModel::CbcSmallChange);
     760      returnValue = CoinMax(minValue,minProductWeight)*CoinMax(maxValue,minProductWeight);
     761      //returnValue += minProductWeight*minValue;
     762#endif
    773763    }
    774764    if (numberTimesUp_<numberBeforeTrust_||
     
    799789      returnValue *= 1.0e-3;
    800790    }
    801 #if 0 //def CBC_INSTRUMENT
    802     int nn = numberTimesInfeasible_  - CoinMax(numberTimesUp_,numberTimesDown_);
    803     if (nn<0) {
    804       // Something to do with parallel synchronization
    805       numberTimesInfeasible_  = CoinMax(numberTimesUp_,numberTimesDown_);
    806     } else if (nn) {
    807       returnValue *= sqrt(static_cast<double> (nn));
    808     }
    809 #endif
    810791#ifdef COIN_DEVELOP
    811792    History hist;
     
    827808  }
    828809}
    829 
    830 double
    831 CbcSimpleIntegerDynamicPseudoCost::infeasibility(const OsiSolverInterface * solver, const OsiBranchingInformation * info,
    832                          int & preferredWay) const
    833 {
    834   double value = info->solution_[columnNumber_];
    835   value = CoinMax(value, info->lower_[columnNumber_]);
    836   value = CoinMin(value, info->upper_[columnNumber_]);
    837   if (info->upper_[columnNumber_]==info->lower_[columnNumber_]) {
    838     // fixed
    839     preferredWay=1;
    840     return 0.0;
    841   }
    842   assert (breakEven_>0.0&&breakEven_<1.0);
    843   double nearest = floor(value+0.5);
    844   double integerTolerance = info->integerTolerance_;
    845   double below = floor(value+integerTolerance);
    846   double above = below+1.0;
    847   if (above>info->upper_[columnNumber_]) {
    848     above=below;
    849     below = above -1;
    850   }
    851 #if INFEAS==1
    852   double objectiveValue = info->objectiveValue_;
    853   double distanceToCutoff =  info->cutoff_  - objectiveValue;
    854   if (distanceToCutoff<1.0e20)
    855     distanceToCutoff *= 10.0;
    856   else
    857     distanceToCutoff = 1.0e2 + fabs(objectiveValue);
    858 #endif
    859   distanceToCutoff = CoinMax(distanceToCutoff,1.0e-12*(1.0+fabs(objectiveValue)));
    860   double sum;
    861   int number;
    862   double downCost = CoinMax(value-below,0.0);
    863   sum = sumDownCost_;
    864   number = numberTimesDown_;
    865 #if INFEAS==1
    866   sum += numberTimesDownInfeasible_*(distanceToCutoff/(downCost+1.0e-12));
    867 #endif
    868   if (number>0)
    869     downCost *= sum / static_cast<double> (number);
    870   else
    871     downCost  *=  downDynamicPseudoCost_;
    872   double upCost = CoinMax((above-value),0.0);
    873   sum = sumUpCost_;
    874   number = numberTimesUp_;
    875 #if INFEAS==1
    876   sum += numberTimesUpInfeasible_*(distanceToCutoff/(upCost+1.0e-12));
    877 #endif
    878   if (number>0)
    879     upCost *= sum / static_cast<double> (number);
    880   else
    881     upCost  *=  upDynamicPseudoCost_;
    882   if (downCost>=upCost)
    883     preferredWay=1;
    884   else
    885     preferredWay=-1;
    886   // See if up down choice set
    887   if (upDownSeparator_>0.0) {
    888     preferredWay = (value-below>=upDownSeparator_) ? 1 : -1;
    889   }
    890   if (preferredWay_)
    891     preferredWay=preferredWay_;
    892   // weight at 1.0 is max min
    893   if (fabs(value-nearest)<=integerTolerance) {
    894     return 0.0;
    895   } else {
    896     double returnValue=0.0;
    897     double minValue = CoinMin(downCost,upCost);
    898     double maxValue = CoinMax(downCost,upCost);
    899     if (!info->numberBranchingSolutions_||info->depth_<=10/* was ||maxValue>0.2*distanceToCutoff*/) {
    900       // no solution
    901       returnValue = WEIGHT_BEFORE*minValue + (1.0-WEIGHT_BEFORE)*maxValue;
    902     } else {
    903       // some solution
    904       returnValue = WEIGHT_AFTER*minValue + (1.0-WEIGHT_AFTER)*maxValue;
    905     }
    906     if (numberTimesUp_<numberBeforeTrust_||
    907         numberTimesDown_<numberBeforeTrust_) {
    908       //if (returnValue<1.0e10)
    909       //returnValue += 1.0e12;
    910       //else
    911       returnValue *= 1.0e3;
    912       if (!numberTimesUp_&&!numberTimesDown_)
    913         returnValue=1.0e50;
    914     }
    915     //if (fabs(value-0.5)<1.0e-5) {
    916     //returnValue = 3.0*returnValue + 0.2;
    917     //} else if (value>0.9) {
    918     //returnValue = 2.0*returnValue + 0.1;
    919     //}
    920     if (method_==1) {
    921       // probing
    922       // average
    923       double up=1.0e-15;
    924       double down=1.0e-15;
    925       if (numberTimesProbingTotal_) {
    926         up += numberTimesUpTotalFixed_/static_cast<double> (numberTimesProbingTotal_);
    927         down += numberTimesDownTotalFixed_/static_cast<double> (numberTimesProbingTotal_);
    928       }
    929       returnValue = 1 + 10.0*CoinMin(numberTimesDownLocalFixed_,numberTimesUpLocalFixed_) +
    930         CoinMin(down,up);
    931       returnValue *= 1.0e-3;
    932     }
    933     return CoinMax(returnValue,1.0e-15);
    934   }
    935 }
    936810// Creates a branching object
    937811CbcBranchingObject *
    938 CbcSimpleIntegerDynamicPseudoCost::createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way)
     812CbcSimpleIntegerDynamicPseudoCost::createCbcBranch(OsiSolverInterface * /*solver*/,
     813                                                const OsiBranchingInformation * info, int way)
    939814{
    940815  double value = info->solution_[columnNumber_];
     
    1046921#endif
    1047922}
     923// Modify down pseudo cost in a slightly different way
     924void
     925CbcSimpleIntegerDynamicPseudoCost::updateDownDynamicPseudoCost(double value)
     926{
     927  sumDownCost_ += value;
     928  numberTimesDown_++;
     929  downDynamicPseudoCost_=sumDownCost_/static_cast<double>(numberTimesDown_);
     930}
    1048931// Set up pseudo cost
    1049932void
     
    1064947  }
    1065948#endif
     949}
     950// Modify up pseudo cost in a slightly different way
     951void
     952CbcSimpleIntegerDynamicPseudoCost::updateUpDynamicPseudoCost(double value)
     953{
     954  sumUpCost_ += value;
     955  numberTimesUp_++;
     956  upDynamicPseudoCost_=sumUpCost_/static_cast<double>(numberTimesUp_);
    1066957}
    1067958/* Pass in information on branch just done and create CbcObjectUpdateData instance.
     
    12851176  //print(1,0.5);
    12861177  assert (downDynamicPseudoCost_>1.0e-40&&upDynamicPseudoCost_>1.0e-40);
     1178#if MOD_SHADOW>1
     1179  if (upShadowPrice_>0.0&&numberTimesDown_>=numberBeforeTrust_
     1180      &&numberTimesUp_>=numberBeforeTrust_) {
     1181    // Set negative
     1182    upShadowPrice_=-upShadowPrice_;
     1183    assert (downShadowPrice_>0.0);
     1184    downShadowPrice_ = - downShadowPrice_;
     1185  }
     1186#endif
    12871187}
    12881188// Updates stuff like pseudocosts after mini branch and bound
     
    12921192                                                   int numberUpInfeasible,double sumUp)
    12931193{
    1294 #ifdef CBC_INSTRUMENT
    1295   int difference = numberDown-numberTimesDown_;
    1296   difference += numberUp-numberTimesUp_;
    1297   numberTimesInfeasible_ += 2*difference;
    1298 #endif
    12991194  numberTimesDown_ = numberDown;
    13001195  numberTimesDownInfeasible_ = numberDownInfeasible;
     
    13321227    if (numberTimesDown_) {
    13331228      meanDown = sumDownCost_/static_cast<double> (numberTimesDown_);
    1334       devDown = meanDown*meanDown + sumDownCostSquared_ -
    1335         2.0*meanDown*sumDownCost_;
     1229      devDown = meanDown*meanDown - 2.0*meanDown*sumDownCost_;
    13361230      if (devDown>=0.0)
    13371231        devDown = sqrt(devDown);
     
    13411235    if (numberTimesUp_) {
    13421236      meanUp = sumUpCost_/static_cast<double> (numberTimesUp_);
    1343       devUp = meanUp*meanUp + sumUpCostSquared_ -
    1344         2.0*meanUp*sumUpCost_;
     1237      devUp = meanUp*meanUp - 2.0*meanUp*sumUpCost_;
    13451238      if (devUp>=0.0)
    13461239        devUp = sqrt(devUp);
    13471240    }
    1348 #if 0
    13491241    printf("%d down %d times (%d inf) mean %g (dev %g) up %d times (%d inf) mean %g (dev %g)\n",
    13501242           columnNumber_,
    13511243           numberTimesDown_,numberTimesDownInfeasible_,meanDown,devDown,
    13521244           numberTimesUp_,numberTimesUpInfeasible_,meanUp,devUp);
    1353 #else
    1354     int n=0;
    1355 #ifdef CBC_INSTRUMENT
    1356     n=numberTimesInfeasible_;
    1357 #endif
    1358     printf("%d down %d times (%d inf) mean %g  up %d times (%d inf) mean %g - pseudocosts %g %g - inftimes %d\n",
    1359            columnNumber_,
    1360            numberTimesDown_,numberTimesDownInfeasible_,meanDown,
    1361            numberTimesUp_,numberTimesUpInfeasible_,meanUp,downDynamicPseudoCost_,upDynamicPseudoCost_,n);
    1362 #endif
    13631245  } else {
    13641246    const double * upper = model_->getCbcColUpper();
     
    14371319                                                      int variable, int way,
    14381320                                                      double lowerValue,
    1439                                                       double upperValue)
     1321                                                                          double /*upperValue*/)
    14401322  :CbcIntegerBranchingObject(model,variable,way,lowerValue)
    14411323{
     
    15641446// Initialize i.e. before start of choosing at a node
    15651447void
    1566 CbcBranchDynamicDecision::initialize(CbcModel * model)
     1448CbcBranchDynamicDecision::initialize(CbcModel * /*model*/)
    15671449{
    15681450  bestCriterion_ = 0.0;
     
    17741656int
    17751657CbcBranchDynamicDecision::betterBranch(CbcBranchingObject * thisOne,
    1776                             CbcBranchingObject * bestSoFar,
     1658                                       CbcBranchingObject * /*bestSoFar*/,
    17771659                            double changeUp, int numInfUp,
    17781660                            double changeDown, int numInfDown)
     
    18751757#endif
    18761758  } else {
    1877     //#define TRY_STUFF 2
     1759#define TRY_STUFF 2
    18781760#if TRY_STUFF > 1
    18791761    // Get current number of infeasibilities, cutoff and current objective
     
    18921774    //maxValue = CoinMin(maxValue,minValue*2.0);
    18931775#endif
     1776#ifndef WEIGHT_PRODUCT
    18941777    value = WEIGHT_AFTER*minValue + (1.0-WEIGHT_AFTER)*maxValue;
     1778#else
     1779    double minProductWeight = model->getDblParam(CbcModel::CbcSmallChange);
     1780    value = CoinMax(minValue,minProductWeight)*CoinMax(maxValue,minProductWeight);
     1781    //value += minProductWeight*minValue;
     1782#endif
    18951783    double useValue = value;
    18961784    double useBest = bestCriterion_;
     
    19041792      // not much in it - look at unsatisfied
    19051793      if (thisNumber<numberUnsatisfied||bestNumber<numberUnsatisfied) {
    1906         double perInteger = distance/ ((double) numberUnsatisfied);
     1794        double perInteger = distance/ (static_cast<double> (numberUnsatisfied));
    19071795        useValue += thisNumber*perInteger;
    19081796        useBest += bestNumber*perInteger;
     
    19891877  FILE * fp = fopen(file,"w");
    19901878  assert(fp);
    1991   unsigned short numberIntegers=0;
     1879  int numberIntegers=0;
    19921880  int i;
    19931881  for (i=0;i<numberHistory;i++) {
Note: See TracChangeset for help on using the changeset viewer.