Changeset 201


Ignore:
Timestamp:
Oct 24, 2005 9:24:03 AM (15 years ago)
Author:
forrest
Message:

mostly NDEBUG

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcBranchActual.cpp

    r149 r201  
    194194  const double * lower = solver->getColLower();
    195195  const double * upper = solver->getColUpper();
     196#ifndef NDEBUG
    196197  double integerTolerance =
    197198    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    198  
     199#endif 
    199200  for (j=0;j<numberMembers_;j++) {
    200201    int sequence = members_[j];
     
    204205    value = CoinMin(value, upper[iColumn]);
    205206    double nearest = floor(value+0.5);
     207#ifndef NDEBUG
    206208    double distance = fabs(value-nearest);
    207209    assert(distance<=integerTolerance);
     210#endif
    208211    solver->setColLower(iColumn,nearest);
    209212    solver->setColUpper(iColumn,nearest);
     
    695698  value = CoinMax(value, lower[columnNumber_]);
    696699  value = CoinMin(value, upper[columnNumber_]);
    697   double nearest = floor(value+0.5);
    698   double integerTolerance =
    699     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    700700  assert (upper[columnNumber_]>lower[columnNumber_]);
    701701  int hotstartStrategy=model_->getHotstartStrategy();
    702702  if (hotstartStrategy<=0) {
     703#ifndef NDEBUG
     704    double nearest = floor(value+0.5);
     705    double integerTolerance =
     706    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    703707    assert (fabs(value-nearest)>integerTolerance);
     708#endif
    704709  } else {
    705710    const double * bestSolution = model_->bestSolution();
     
    727732
    728733  double nearest = floor(value+0.5);
     734#ifndef NDEBUG
    729735  double integerTolerance =
    730736    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    731737  assert (fabs(value-nearest)<=integerTolerance);
     738#endif
    732739  double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    733740  CbcIntegerBranchingObject * object = NULL;
     
    762769
    763770  double nearest = floor(value+0.5);
     771#ifndef NDEBUG
    764772  double integerTolerance =
    765773    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    766774  assert (fabs(value-nearest)<=integerTolerance);
     775#endif
    767776  double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    768777  CbcIntegerBranchingObject * object = NULL;
     
    10191028  value = CoinMax(value, lower[columnNumber_]);
    10201029  value = CoinMin(value, upper[columnNumber_]);
     1030#ifndef NDEBUG
    10211031  double nearest = floor(value+0.5);
    10221032  double integerTolerance =
    10231033    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    10241034  assert (upper[columnNumber_]>lower[columnNumber_]);
     1035#endif
    10251036  int hotstartStrategy=model_->getHotstartStrategy();
    10261037  if (hotstartStrategy<=0) {
  • trunk/CbcBranchDynamic.cpp

    r197 r201  
    180180  value = CoinMax(value, lower[columnNumber_]);
    181181  value = CoinMin(value, upper[columnNumber_]);
     182#ifndef NDEBUG
    182183  double nearest = floor(value+0.5);
    183184  double integerTolerance =
    184185    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    185186  assert (upper[columnNumber_]>lower[columnNumber_]);
     187#endif
    186188  int hotstartStrategy=model_->getHotstartStrategy();
    187189  if (hotstartStrategy<=0) {
     
    746748    double minValue = CoinMin(changeDown,changeUp);
    747749    double maxValue = CoinMax(changeDown,changeUp);
     750    // Reduce
     751    maxValue = CoinMin(maxValue,minValue*2.0);
    748752    value = WEIGHT_AFTER*minValue + (1.0-WEIGHT_AFTER)*maxValue;
    749753    if (value>bestCriterion_+1.0e-8) {
  • trunk/CbcBranchLotsize.cpp

    r135 r201  
    507507      nearest = value;
    508508  }
    509   double integerTolerance =
    510     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    511509#ifdef CBC_PRINT
    512510  // print details
     
    515513  // Scaling may have moved it a bit
    516514  // Lotsizing variables could be a lot larger
     515#ifndef NDEBUG
     516  double integerTolerance =
     517    model_->getDblParam(CbcModel::CbcIntegerTolerance);
    517518  assert (fabs(value-nearest)<=(100.0+10.0*fabs(nearest))*integerTolerance);
     519#endif
    518520}
    519521
     
    529531  value = CoinMax(value, lower[columnNumber_]);
    530532  value = CoinMin(value, upper[columnNumber_]);
    531   bool feasible = findRange(value);
    532   assert (!feasible);
     533  assert (!findRange(value));
    533534  return new CbcLotsizeBranchingObject(model_,columnNumber_,way,
    534535                                             value,this);
     
    547548  double value = model_->testSolution()[columnNumber_];
    548549
    549   bool feasible = findRange(value);
    550   assert (feasible);
     550  assert (findRange(value));
    551551  double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    552552  CbcLotsizeBranchingObject * object = NULL;
     
    595595  double value = model_->testSolution()[columnNumber_];
    596596
     597#ifndef NDEBUG
    597598  double nearest = floor(value+0.5);
    598599  double integerTolerance =
     
    601602  // Lotsizing variables could be a lot larger
    602603  assert (fabs(value-nearest)<=(10.0+10.0*fabs(nearest))*integerTolerance);
     604#endif
    603605  double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    604606  CbcLotsizeBranchingObject * object = NULL;
  • trunk/CbcHeuristic.cpp

    r197 r201  
    748748      for (i=start[iPass];i<end[iPass];i++) {
    749749        int iColumn = integerVariable[i];
     750#ifndef NDEBUG
    750751        double value=newSolution[iColumn];
    751752        assert (fabs(floor(value+0.5)-value)<integerTolerance);
     753#endif
    752754        double cost = direction * objective[iColumn];
    753755        double move=0.0;
  • trunk/CbcHeuristicFPump.cpp

    r197 r201  
    112112    int iColumn = integerVariable[i];
    113113    const CbcObject * object = model_->object(i);
     114#ifndef NDEBUG
    114115    const CbcSimpleInteger * integerObject =
    115116      dynamic_cast<const  CbcSimpleInteger *> (object);
    116117    assert(integerObject);
     118#endif
    117119    if (upper[iColumn]-lower[iColumn]>1.000001) {
    118120      general++;
     
    333335      continue;
    334336    const CbcObject * object = model_->object(i);
     337#ifndef NDEBUG
    335338    const CbcSimpleInteger * integerObject =
    336339      dynamic_cast<const  CbcSimpleInteger *> (object);
    337340    assert(integerObject);
     341#endif
    338342    double value=solution[iColumn];
    339343    double round = floor(value+primalTolerance);
  • trunk/CbcModel.cpp

    r197 r201  
    45964596    memset(rowActivity,0,numberRows*sizeof(double)) ;
    45974597
     4598#ifndef NDEBUG
    45984599    double integerTolerance = getIntegerTolerance() ;
    4599 
     4600#endif
    46004601    int iColumn;
    46014602    for (iColumn = 0 ; iColumn < numberColumns ; iColumn++)
     
    55755576      resolve();
    55765577      // should be feasible
    5577       int numberIntegerInfeasibilities;
    5578       int numberObjectInfeasibilities;
    55795578      if (!currentSolution_)
    55805579        currentSolution_ = new double[numberColumns] ;
    55815580      testSolution_ = currentSolution_;
     5581#ifndef NDEBUG
     5582      int numberIntegerInfeasibilities;
     5583      int numberObjectInfeasibilities;
    55825584      assert(feasibleSolution(numberIntegerInfeasibilities,
    55835585                              numberObjectInfeasibilities));
     5586#endif
    55845587    }
    55855588  } else {
  • trunk/CbcNode.cpp

    r200 r201  
    20302030                        model->getDblParam(CbcModel::CbcMaximumSeconds));
    20312031    // also give up if we are looping round too much
    2032     if (hitMaxTime||numberPassesLeft<=0||!numberNotTrusted) {
     2032    if (hitMaxTime||numberPassesLeft<=0||(!numberNotTrusted&&false)) {
    20332033      int iObject = whichObject[bestChoice];
    20342034      CbcObject * object = model->modifiableObject(iObject);
     
    22062206      solver->getIntParam(OsiMaxNumIterationHotStart,saveLimit2);
    22072207      bool doQuickly = numberToDo>2*numberStrong;
     2208      //printf("todo %d, strong %d\n",numberToDo,numberStrong);
     2209      int numberTest=numberNotTrusted>0 ? numberStrong : (numberStrong+1)/2;
    22082210      for ( iDo=0;iDo<numberToDo;iDo++) {
    22092211        CbcStrongInfo choice;
     
    22222224        // see if can skip strong branching
    22232225        int canSkip = choice.possibleBranch->fillStrongInfo(choice);
    2224         if (!doQuickly)
     2226        if (!doQuickly||numberTest)
    22252227          canSkip=0;
    22262228        if (model->messageHandler()->logLevel()>3)
     
    22282230        // was if (!canSkip)
    22292231        if (!canSkip) {
     2232          numberTest--;
    22302233          // just do a few
    22312234          if (canSkip)
     
    24932496            dynamicObject->setNumberBeforeTrust(0);
    24942497          }
     2498          numberTest=0;
    24952499        }
    24962500      }
Note: See TracChangeset for help on using the changeset viewer.