Changeset 819 for trunk


Ignore:
Timestamp:
Oct 8, 2007 8:19:01 AM (12 years ago)
Author:
forrest
Message:

fixes for bonmin and other stuff

Location:
trunk/Cbc/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r814 r819  
    11001100        }
    11011101      }
    1102       // and add to solver if none
    1103       if (!solver_->numberObjects()) {
     1102      // and add to solver
     1103      //if (!solver_->numberObjects()) {
    11041104        solver_->addObjects(numberObjects_,object_);
    1105       } else {
    1106         if (solver_->numberObjects()!=numberOriginalObjects) {
    1107           printf("should have trapped that solver has objects before\n");
    1108           abort();
    1109         }
    1110       }
     1105        //} else {
     1106        //if (solver_->numberObjects()!=numberOriginalObjects) {
     1107        //printf("should have trapped that solver has objects before\n");
     1108        //abort();
     1109        //}
     1110        //}
    11111111    } else {
    11121112      // do from solver
     
    47814781        int iStatus = (feasible) ? 0 : 0;
    47824782        double value = obj->value();
     4783        double movement;
    47834784        if (branch)
    4784           value = ceil(value)-value;
     4785          movement = ceil(value)-value;
    47854786        else
    4786           value = value -floor(value);
    4787 #if 1
     4787          movement = value -floor(value);
     4788#if 0
     4789        // OUT as much too complicated - we are not at a natural hotstart place
    47884790        OsiBranchingInformation usefulInfo=usefulInformation();
     4791        // hotInfo is meant for BEFORE a branch so we need to fool
     4792        // was much simpler with alternate method
     4793        double save[3];
     4794        save[0]=usefulInfo.lower_[iColumn];
     4795        save[1]=usefulInfo.solution_[iColumn];
     4796        save[2]=usefulInfo.upper_[iColumn];
     4797        usefulInfo.lower_[iColumn]=floor(value);
     4798        usefulInfo.solution_[iColumn]=value;
     4799        usefulInfo.upper_[iColumn]=ceil(value);
    47894800        OsiHotInfo hotInfo(solver_,&usefulInfo,&object,0);
     4801        usefulInfo.lower_[iColumn]=save[0];
     4802        usefulInfo.solution_[iColumn]=save[1];
     4803        usefulInfo.upper_[iColumn]=save[2];
    47904804        if (branch) {
    47914805          hotInfo.setUpStatus(iStatus);
    47924806          hotInfo.setUpChange(changeInObjective);
    4793           //object->setUpEstimate(value);
     4807          //object->setUpEstimate(movement);
    47944808        } else {
    47954809          hotInfo.setDownStatus(iStatus);
    47964810          hotInfo.setDownChange(changeInObjective);
    4797           //object->setDownEstimate(value);
     4811          //object->setDownEstimate(movement);
    47984812        }
    47994813        branchingMethod_->chooseMethod()->updateInformation(&usefulInfo,branch,&hotInfo);
    48004814#else
    48014815        branchingMethod_->chooseMethod()->updateInformation(iObject,branch,changeInObjective,
    4802                                                             value,iStatus);
     4816                                                            movement,iStatus);
    48034817#endif
    48044818      }
     
    72677281        mark[iColumn]=i;
    72687282      }
     7283    } else {
     7284      // some other object - keep
     7285      newNumberObjects++;
    72697286    }
    72707287  }
  • trunk/Cbc/src/CbcNode.cpp

    r789 r819  
    569569}
    570570
     571
    571572// Default constructor
    572573CbcPartialNodeInfo::CbcPartialNodeInfo()
     
    591592
    592593  numberChangedBounds_ = numberChangedBounds;
    593   variables_ = new int [numberChangedBounds_];
    594   newBounds_ = new double [numberChangedBounds_];
     594  int size = numberChangedBounds_*(sizeof(double)+sizeof(int));
     595  char * temp = new char [size];
     596  newBounds_ = (double *) temp;
     597  variables_ = (int *) (newBounds_+numberChangedBounds_);
    595598
    596599  int i ;
     
    608611
    609612  numberChangedBounds_ = rhs.numberChangedBounds_;
    610   variables_ = new int [numberChangedBounds_];
    611   newBounds_ = new double [numberChangedBounds_];
     613  int size = numberChangedBounds_*(sizeof(double)+sizeof(int));
     614  char * temp = new char [size];
     615  newBounds_ = (double *) temp;
     616  variables_ = (int *) (newBounds_+numberChangedBounds_);
    612617
    613618  int i ;
     
    628633{
    629634  delete basisDiff_ ;
    630   delete [] variables_;
    631635  delete [] newBounds_;
    632636}
     
    694698
    695699  return parent_ ; }
    696 
    697700
    698701CbcNode::CbcNode() :
     
    24412444      iBestGot=-1;
    24422445      best=0.0;
     2446      /* Problem type as set by user or found by analysis.  This will be extended
     2447         0 - not known
     2448         1 - Set partitioning <=
     2449         2 - Set partitioning ==
     2450         3 - Set covering
     2451         4 - all +- 1 or all +1 and odd
     2452      */
     2453      int problemType = model->problemType();
    24432454#define PRINT_STUFF -1
    24442455      for (i=0;i<numberObjects;i++) {
     
    24882499            double part =saveSolution[iColumn]-floor(saveSolution[iColumn]);
    24892500            infeasibility = fabs(0.5-part);
     2501          }
     2502          if (problemType>0&&problemType<4) {
     2503            // try closest to 0.5
     2504            double part =saveSolution[iColumn]-floor(saveSolution[iColumn]);
     2505            infeasibility = 0.5-fabs(0.5-part);
    24902506          }
    24912507          bool gotDown=false;
  • trunk/Cbc/src/CbcNode.hpp

    r706 r819  
    351351  /// Clone
    352352  virtual CbcNodeInfo * clone() const;
     353  /// Basis diff information
     354  inline const CoinWarmStartDiff *basisDiff() const
     355  { return basisDiff_ ;}
     356  /// Which variable (top bit if upper bound changing)
     357  inline const int * variables() const
     358  { return variables_;}
     359  // New bound
     360  inline const double * newBounds() const
     361  { return newBounds_;}
     362  /// Number of bound changes
     363  inline int numberChangedBounds() const
     364  { return numberChangedBounds_;}
    353365protected:
    354366  /* Data values */
  • trunk/Cbc/src/CbcSolver.cpp

    r809 r819  
    1111#include <cstring>
    1212#include <iostream>
    13 
    1413
    1514#include "CoinPragma.hpp"
     
    449448#endif
    450449  // Set up likely cut generators and defaults
    451   parameters_[whichParam(PREPROCESS,numberParameters_,parameters_)].setCurrentOption("on");
     450  parameters_[whichParam(PREPROCESS,numberParameters_,parameters_)].setCurrentOption("sos");
    452451  parameters_[whichParam(MIPOPTIONS,numberParameters_,parameters_)].setIntValue(128|64|1);
    453452  parameters_[whichParam(MIPOPTIONS,numberParameters_,parameters_)].setIntValue(1);
     
    731730  return new CbcStopNow(*this);
    732731}
    733 //#define NEW_STYLE_SOLVER
     732#define NEW_STYLE_SOLVER
    734733//#undef COIN_HAS_ASL
    735734#ifdef COIN_HAS_ASL
     
    11471146  doAction - 0 just fix in original and return NULL
    11481147             1 return fixed non-presolved solver
    1149              2 return fixed presolved solver
     1148             2 as one but use presolve Inside this
    11501149             3 do heuristics and set best solution
    11511150             4 do BAB and just set best solution
     
    11601159  if (doAction==11&&!lastSolution)
    11611160    lastSolution = model.bestSolution();
    1162   assert ((doAction==1&&!lastSolution)||(doAction==11&&lastSolution));
     1161  assert (((doAction==1||doAction==2)&&!lastSolution)||(doAction==11&&lastSolution));
    11631162  double fractionIntFixed = dextra[3];
    11641163  double fractionFixed = dextra[4];
    11651164  double time1 = CoinCpuTime();
    1166   OsiClpSolverInterface * originalClpSolver = dynamic_cast< OsiClpSolverInterface*> (model.solver());
     1165  OsiSolverInterface * originalSolver = model.solver();
     1166  OsiClpSolverInterface * originalClpSolver = dynamic_cast< OsiClpSolverInterface*> (originalSolver);
    11671167  ClpSimplex * originalLpSolver = originalClpSolver->getModelPtr();
    1168   OsiSolverInterface * solver = model.solver()->clone();
    1169   OsiClpSolverInterface * clpSolver = dynamic_cast< OsiClpSolverInterface*> (solver);
    1170   ClpSimplex * lpSolver = clpSolver->getModelPtr();
     1168  int * originalColumns=NULL;
     1169  OsiClpSolverInterface * clpSolver;
     1170  ClpSimplex * lpSolver;
     1171  ClpPresolve pinfo;
     1172  if (doAction==2) {
     1173    doAction=1;
     1174    lpSolver = pinfo.presolvedModel(*originalLpSolver,1.0e-8,false,10);
     1175    assert (lpSolver);
     1176    clpSolver = new OsiClpSolverInterface(lpSolver,true);
     1177    assert(lpSolver == clpSolver->getModelPtr());
     1178    //int numberColumns = lpSolver->numberColumns();
     1179    int numberColumns = lpSolver->numberColumns();
     1180    originalColumns = CoinCopyOfArray(pinfo.originalColumns(),numberColumns);
     1181  } else {
     1182    OsiSolverInterface * solver = originalSolver->clone();
     1183    clpSolver = dynamic_cast< OsiClpSolverInterface*> (solver);
     1184    lpSolver = clpSolver->getModelPtr();
     1185  }
    11711186  // Tighten bounds
    11721187  lpSolver->tightenPrimalBounds(0.0,11,true);
     1188  int numberColumns = clpSolver->getNumCols() ;
     1189  double * saveColumnLower = CoinCopyOfArray(lpSolver->columnLower(),numberColumns);
     1190  double * saveColumnUpper = CoinCopyOfArray(lpSolver->columnUpper(),numberColumns);
    11731191  //char generalPrint[200];
    11741192  const double *objective = lpSolver->getObjCoefficients() ;
    11751193  double *columnLower = lpSolver->columnLower() ;
    11761194  double *columnUpper = lpSolver->columnUpper() ;
    1177   int numberColumns = solver->getNumCols() ;
    1178   int numberRows = solver->getNumRows();
     1195  int numberRows = clpSolver->getNumRows();
    11791196  int iRow,iColumn;
    11801197
    11811198  // Row copy
    1182   CoinPackedMatrix matrixByRow(*solver->getMatrixByRow());
     1199  CoinPackedMatrix matrixByRow(*clpSolver->getMatrixByRow());
    11831200  const double * elementByRow = matrixByRow.getElements();
    11841201  const int * column = matrixByRow.getIndices();
     
    11871204
    11881205  // Column copy
    1189   CoinPackedMatrix  matrixByCol(*solver->getMatrixByCol());
     1206  CoinPackedMatrix  matrixByCol(*clpSolver->getMatrixByCol());
    11901207  //const double * element = matrixByCol.getElements();
    11911208  const int * row = matrixByCol.getIndices();
     
    11931210  const int * columnLength = matrixByCol.getVectorLengths();
    11941211
    1195   const double * rowLower = solver->getRowLower();
    1196   const double * rowUpper = solver->getRowUpper();
     1212  const double * rowLower = clpSolver->getRowLower();
     1213  const double * rowUpper = clpSolver->getRowUpper();
    11971214
    11981215  // Get maximum size of VUB tree
     
    12491266    fix[iColumn]=-1;
    12501267    if (columnUpper[iColumn] > columnLower[iColumn]+1.0e-8) {
    1251       if (solver->isInteger(iColumn))
     1268      if (clpSolver->isInteger(iColumn))
    12521269        numberInteger++;
    12531270      if (columnLower[iColumn]==0.0) {
     
    13791396                      }
    13801397                    }
    1381                     if (!newBound||(solver->isInteger(kColumn)&&newBound<0.999)) {
     1398                    if (!newBound||(clpSolver->isInteger(kColumn)&&newBound<0.999)) {
    13821399                      // fix to zero
    13831400                      if (!mark[kColumn]) {
     
    14221439                      }
    14231440                    }
    1424                     if (!newBound||(solver->isInteger(kColumn)&&newBound<0.999)) {
     1441                    if (!newBound||(clpSolver->isInteger(kColumn)&&newBound<0.999)) {
    14251442                      // fix to zero
    14261443                      if (!mark[kColumn]) {
     
    14701487          mark[otherColumn[i]]=0;
    14711488        // reset bound unless infeasible
    1472         if (!infeasible||!solver->isInteger(iColumn))
     1489        if (!infeasible||!clpSolver->isInteger(iColumn))
    14731490          columnUpper[iColumn]=saveUpper;
    1474         else if (solver->isInteger(iColumn))
     1491        else if (clpSolver->isInteger(iColumn))
    14751492          columnLower[iColumn]=1.0;
    14761493      }
     
    15491566            for (int i=fixColumn[iColumn];i<fixColumn[iColumn+1];i++) {
    15501567              int jColumn=otherColumn[i];
    1551               if (solver->isInteger(jColumn))
     1568              if (clpSolver->isInteger(jColumn))
    15521569                nFix++;
    15531570            }
     
    15591576          }
    15601577          assert (iFix<nCheck);
    1561           if (solver->isInteger(iColumn)) {
     1578          if (clpSolver->isInteger(iColumn)) {
    15621579            numberInteger++;
    15631580            countsI[iFix]++;
     
    16481665          double * columnUpper = lpSolver->columnUpper();
    16491666          //      lpSolver->dual();
    1650           memcpy(columnLower,originalLpSolver->columnLower(),numberColumns*sizeof(double));
    1651           memcpy(columnUpper,originalLpSolver->columnUpper(),numberColumns*sizeof(double));
     1667          memcpy(columnLower,saveColumnLower,numberColumns*sizeof(double));
     1668          memcpy(columnUpper,saveColumnUpper,numberColumns*sizeof(double));
    16521669          //      lpSolver->dual();
    16531670          int iColumn;
    16541671          for (iColumn=0;iColumn<numberColumns;iColumn++) {
    16551672            if (columnUpper[iColumn] > columnLower[iColumn]+1.0e-8) {
    1656               if (solver->isInteger(iColumn)) {
     1673              if (clpSolver->isInteger(iColumn)) {
    16571674                double value = lastSolution[iColumn];
    16581675                int iValue = (int) (value+0.5);
     
    16661683          }
    16671684          lpSolver->initialSolve(solveOptions);
    1668           memcpy(columnLower,originalLpSolver->columnLower(),numberColumns*sizeof(double));
    1669           memcpy(columnUpper,originalLpSolver->columnUpper(),numberColumns*sizeof(double));
     1685          memcpy(columnLower,saveColumnLower,numberColumns*sizeof(double));
     1686          memcpy(columnUpper,saveColumnUpper,numberColumns*sizeof(double));
    16701687        }
    16711688        for (iColumn=0;iColumn<numberColumns;iColumn++) {
    16721689          if (columnUpper[iColumn] > columnLower[iColumn]+1.0e-8) {
    1673             if (solver->isInteger(iColumn)) {
     1690            if (clpSolver->isInteger(iColumn)) {
    16741691              double value = lastSolution[iColumn];
    16751692              int iValue = (int) (value+0.5);
     
    17341751      }
    17351752      for ( iColumn=0;iColumn<numberColumns;iColumn++) {
    1736         if (!solver->isInteger(iColumn)||fix[iColumn]>kLayer)
     1753        if (!clpSolver->isInteger(iColumn)||fix[iColumn]>kLayer)
    17371754          continue;
    17381755        // skip if fixes nothing
     
    18581875        columnUpper = models[kPass].columnUpper();
    18591876        columnLower[iSmallest]=1.0;
    1860         columnUpper[iSmallest]=originalLpSolver->columnUpper()[iSmallest];
     1877        columnUpper[iSmallest]=saveColumnUpper[iSmallest];
    18611878        *lpSolver=models[kPass];
    18621879        columnLower = lpSolver->columnLower();
     
    18651882        dj = lpSolver->dualColumnSolution();
    18661883        columnLower[iSmallest]=1.0;
    1867         columnUpper[iSmallest]=originalLpSolver->columnUpper()[iSmallest];
     1884        columnUpper[iSmallest]=saveColumnUpper[iSmallest];
    18681885        state[iSmallest]=1;
    18691886        // unfix others
     
    18711888          int jColumn=otherColumn[i];
    18721889          if (state[jColumn]==3) {
    1873             columnUpper[jColumn]=originalLpSolver->columnUpper()[jColumn];
     1890            columnUpper[jColumn]=saveColumnUpper[jColumn];
    18741891            state[jColumn]=-1;
    18751892          }
     
    19001917      double sum1=0.0;
    19011918      for ( iColumn=0;iColumn<numberColumns;iColumn++) {
    1902         if (!solver->isInteger(iColumn)||fix[iColumn]>kLayer)
     1919        if (!clpSolver->isInteger(iColumn)||fix[iColumn]>kLayer)
    19031920          continue;
    19041921        // skip if fixes nothing
    19051922        if (fixColumn[iColumn+1]-fixColumn[iColumn]==0&&doAction<10)
    19061923          continue;
    1907         double value = fullSolution[iColumn];
    19081924        double djValue = dj[iColumn];
    19091925        if (state[iColumn]==1) {
    19101926          assert (columnLower[iColumn]);
    1911           assert (value>0.1);
     1927          assert (fullSolution[iColumn]>0.1);
    19121928          if (djValue>0.0) {
    19131929            //printf("YY dj of %d at %g is %g\n",iColumn,value,djValue);
     
    19191935          }
    19201936        } else if (state[iColumn]==0||state[iColumn]==10) {
    1921           assert (value<0.1);
     1937          assert (fullSolution[iColumn]<0.1);
    19221938          assert (!columnUpper[iColumn]);
    19231939          double otherValue=0.0;
     
    19511967      }
    19521968      CoinSort_2(dsort,dsort+n,sort);
    1953       double * originalColumnLower = originalLpSolver->columnLower();
    1954       double * originalColumnUpper = originalLpSolver->columnUpper();
     1969      double * originalColumnLower = saveColumnLower;
     1970      double * originalColumnUpper = saveColumnUpper;
    19551971      double * lo = CoinCopyOfArray(columnLower,numberColumns);
    19561972      double * up = CoinCopyOfArray(columnUpper,numberColumns);
     
    20282044      for ( iColumn=0;iColumn<numberColumns;iColumn++) {
    20292045        if (columnLower[iColumn]==columnUpper[iColumn]) {
    2030           if (solver->isInteger(iColumn))
     2046          if (clpSolver->isInteger(iColumn))
    20312047            nFixedI++;
    20322048          nFixed++;
     
    20702086  delete [] otherColumn2;
    20712087  delete [] fixColumn2;
    2072   // Basis
    2073   memcpy(originalLpSolver->statusArray(),lpSolver->statusArray(),numberRows+numberColumns);
    2074   memcpy(originalLpSolver->primalColumnSolution(),lpSolver->primalColumnSolution(),numberColumns*sizeof(double));
    2075   memcpy(originalLpSolver->primalRowSolution(),lpSolver->primalRowSolution(),numberRows*sizeof(double));
    2076   // Fix in solver
    2077   columnLower = lpSolver->columnLower();
    2078   columnUpper = lpSolver->columnUpper();
     2088  // See if was presolved
     2089  if (originalColumns) {
     2090    for ( iColumn=0;iColumn<numberColumns;iColumn++) {
     2091      saveColumnLower[iColumn] = columnLower[iColumn];
     2092      saveColumnUpper[iColumn] = columnUpper[iColumn];
     2093    }
     2094    pinfo.postsolve(true);
     2095    columnLower = originalLpSolver->columnLower();
     2096    columnUpper = originalLpSolver->columnUpper();
     2097    double * newColumnLower = lpSolver->columnLower();
     2098    double * newColumnUpper = lpSolver->columnUpper();
     2099    for (iColumn=0;iColumn<numberColumns;iColumn++) {
     2100      int jColumn = originalColumns[iColumn];
     2101      columnLower[jColumn] = CoinMax(columnLower[jColumn],newColumnLower[iColumn]);
     2102      columnUpper[jColumn] = CoinMin(columnUpper[jColumn],newColumnUpper[iColumn]);
     2103    }
     2104    numberColumns = originalLpSolver->numberColumns();
     2105    delete [] originalColumns;
     2106  }
     2107  delete [] saveColumnLower;
     2108  delete [] saveColumnUpper;
     2109  if (!originalColumns) {
     2110    // Basis
     2111    memcpy(originalLpSolver->statusArray(),lpSolver->statusArray(),numberRows+numberColumns);
     2112    memcpy(originalLpSolver->primalColumnSolution(),lpSolver->primalColumnSolution(),numberColumns*sizeof(double));
     2113    memcpy(originalLpSolver->primalRowSolution(),lpSolver->primalRowSolution(),numberRows*sizeof(double));
     2114    // Fix in solver
     2115    columnLower = lpSolver->columnLower();
     2116    columnUpper = lpSolver->columnUpper();
     2117  }
    20792118  double * originalColumnLower = originalLpSolver->columnLower();
    20802119  double * originalColumnUpper = originalLpSolver->columnUpper();
     
    20882127  }
    20892128  printf("%d fixed by vub preprocessing\n",doAction);
    2090   delete solver;
     2129  if (originalColumns) {
     2130    originalLpSolver->initialSolve();
     2131  }
     2132  delete clpSolver;
    20912133  return NULL;
    20922134}
     
    30313073#endif
    30323074  // Set up likely cut generators and defaults
    3033   parameters[whichParam(PREPROCESS,numberParameters,parameters)].setCurrentOption("on");
     3075  parameters[whichParam(PREPROCESS,numberParameters,parameters)].setCurrentOption("sos");
    30343076  parameters[whichParam(MIPOPTIONS,numberParameters,parameters)].setIntValue(128|64|1);
    30353077  parameters[whichParam(MIPOPTIONS,numberParameters,parameters)].setIntValue(1);
     
    34953537        }
    34963538      }
    3497       int returnCode = readAmpl(&info,argc,const_cast<char **>(argv),(void **) (& coinModel));
     3539
     3540      union { void * voidModel; CoinModel * model; } coinModelStart;
     3541      coinModelStart.model=NULL;
     3542      int returnCode = readAmpl(&info,argc, const_cast<char **>(argv),& coinModelStart.voidModel);
     3543      coinModel=coinModelStart.model;
    34983544      if (returnCode)
    34993545        return returnCode;
     
    36673713    int doVector=0;
    36683714    int doSprint=-1;
    3669     int doScaling=1;
     3715    int doScaling=4;
    36703716    // set reasonable defaults
    36713717    int preSolve=5;
    3672     int preProcess=1;
     3718    int preProcess=4;
    36733719    bool useStrategy=false;
    36743720    bool preSolveFile=false;
     
    37293775    CglProbing probingGen;
    37303776    probingGen.setUsingObjective(1);
    3731     probingGen.setMaxPass(3);
    3732     probingGen.setMaxPassRoot(3);
     3777    probingGen.setMaxPass(1);
     3778    probingGen.setMaxPassRoot(1);
    37333779    // Number of unsatisfied variables to look at
    37343780    probingGen.setMaxProbe(10);
     
    42094255              lpSolver->scaling(action);
    42104256              solver->setHintParam(OsiDoScale,action!=0,OsiHintTry);
    4211               doScaling = 1-action;
     4257              doScaling = action;
    42124258              break;
    42134259            case AUTOSCALE:
     
    49134959                if (!dextra[3])
    49144960                  dextra[3] = 0.97;
    4915                 OsiClpSolverInterface * newSolver = fixVubs(model_,extra3,vubAction,generalMessageHandler,
    4916                                                             debugValues,dextra);
    4917                 assert (!newSolver);
     4961                //OsiClpSolverInterface * newSolver =
     4962                fixVubs(model_,extra3,vubAction,generalMessageHandler,
     4963                        debugValues,dextra);
     4964                //assert (!newSolver);
    49184965              }
    49194966              // Actually do heuristics
     
    50005047                  dynamic_cast<OsiClpSolverInterface *>(solver) ;
    50015048                assert (si != NULL);
     5049                si->getModelPtr()->scaling(doScaling);
    50025050                // See if quadratic
    50035051#ifdef COIN_HAS_LINK
     
    54565504                  CglProbing generator1;
    54575505                  generator1.setUsingObjective(1);
    5458                   generator1.setMaxPass(3);
     5506                  generator1.setMaxPass(1);
     5507                  generator1.setMaxPassRoot(1);
    54595508                  generator1.setMaxProbeRoot(saveSolver->getNumCols());
    54605509                  generator1.setMaxElements(100);
     
    60756124                    int numberColumns = babModel_->getNumCols();
    60766125                    // backward pointer to new variables
    6077                     int * newColumn = new int[numberOriginalColumns];
     6126                    // extend arrays in case SOS
     6127                    assert (originalColumns);
     6128                    int n = originalColumns[numberColumns-1]+1;
     6129                    int * newColumn = new int[CoinMax(n,numberColumns)];
    60786130                    int i;
    60796131                    for (i=0;i<numberOriginalColumns;i++)
    60806132                      newColumn[i]=-1;
    6081                     assert (originalColumns);
    60826133                    for (i=0;i<numberColumns;i++)
    60836134                      newColumn[originalColumns[i]]=i;
     
    69336984                CbcStrategyDefault strategy(true,babModel_->numberStrong(),babModel_->numberBeforeTrust());
    69346985                // Set up pre-processing
    6935                 int translate2[]={9999,1,1,3,2,4,5};
     6986                int translate2[]={9999,1,1,3,2,4,5,6,6};
    69366987                if (preProcess)
    6937                   strategy.setupPreProcessing(translate2[preProcess]);
     6988                  strategy.setupPreProcessing(translate2[ preProcess ]);
    69386989                babModel_->setStrategy(strategy);
    69396990#ifdef CBC_THREAD
  • trunk/Cbc/src/CbcStrategy.cpp

    r724 r819  
    139139  generator1.setUsingObjective(true);
    140140  generator1.setMaxPass(1);
     141  generator1.setMaxPassRoot(1);
    141142  // Number of unsatisfied variables to look at
    142143  generator1.setMaxProbe(10);
     
    370371    CglProbing generator1;
    371372    generator1.setUsingObjective(true);
    372     generator1.setMaxPass(3);
     373    generator1.setMaxPass(1);
     374    generator1.setMaxPassRoot(1);
    373375    generator1.setMaxProbeRoot(solver->getNumCols());
    374376    generator1.setMaxElements(100);
     
    379381    // Add in generators
    380382    process->addCutGenerator(&generator1);
    381     int translate[]={9999,0,3,2,-1,-2};
     383    int translate[]={9999,0,2,-2,3,4,4};
    382384    OsiSolverInterface * solver2 =
    383385      process->preProcessNonDefault(*solver,
  • trunk/Cbc/src/CoinSolve.cpp

    r789 r819  
    1414#include <cstring>
    1515#include <iostream>
    16 //#define NEW_STYLE_SOLVER
     16#define NEW_STYLE_SOLVER
    1717#ifndef NEW_STYLE_SOLVER
    1818  // define TEST_MESSAGE_HANDLER to check works on all messages
  • trunk/Cbc/src/unitTestClp.cpp

    r768 r819  
    129129#endif
    130130    PUSH_MPS("air03",124,10757,340160,338864.25,7);
    131 #if HOWMANY==3
     131#if HOWMANY>2
    132132    PUSH_MPS("air04",823,8904,56137,55535.436,8);
    133133    PUSH_MPS("air05",426,7195,26374,25877.609,8);
     
    148148    PUSH_MPS("egout",98,141,568.101,149.589,7);
    149149    PUSH_MPS("enigma",21,100,0.0,0.0,7);
    150 #if HOWMANY==3
     150#if HOWMANY>3
    151151    PUSH_MPS("fast0507",507,63009,174,172.14556668,7);
    152152#endif
     
    164164    PUSH_MPS("gesa3_o",1224,1152,27991042.648,27833632.451,7);
    165165    PUSH_MPS("gt2",29,188,21166.000,13460.233074,7);
    166 #if HOWMANY==3
     166#if HOWMANY>2
    167167    PUSH_MPS("harp2",112,2993,-73899798.00,-74353341.502,7);
    168168#endif
     
    180180    PUSH_MPS("mod008",6,319,307,290.9,7);
    181181    PUSH_MPS("mod010",146,2655,6548,6532.08,7);
    182 #if HOWMANY==3
     182#if HOWMANY>2
    183183    PUSH_MPS("mod011",4480,10958,-54558535,-62121982.55,7);
    184184    PUSH_MPS("modglob",291,422,20740508,20430947.,7);
     185#endif
     186#if HOWMANY>3
    185187    PUSH_MPS("noswot",182,128,-43,-43.0,7);
    186188#endif
     
    193195    PUSH_MPS("p0548",176,548,8691,315.29,7);
    194196    PUSH_MPS("p2756",755,2756,3124,2688.75,7);
    195 #if HOWMANY==3
     197#if HOWMANY>2
    196198    PUSH_MPS("pk1",45,86,11.0,0.0,7);
    197199#endif
     
    200202    PUSH_MPS("pp08aCUTS",246,240,7350.0,5480.6061563,7);
    201203#endif
    202 #if HOWMANY==3
     204#if HOWMANY>2
    203205    PUSH_MPS("qiu",1192,840,-132.873137,-931.638857,7);
    204206#endif
     
    207209    PUSH_MPS("rentacar",6803,9557,30356761,28806137.644,7);
    208210    PUSH_MPS("rgn",24,180,82.1999,48.7999,7);
    209 #if HOWMANY==3
     211#if HOWMANY>3
    210212    PUSH_MPS("rout",291,556,1077.56,981.86428571,7);
    211213    PUSH_MPS("set1ch",492,712,54537.75,32007.73,7);
Note: See TracChangeset for help on using the changeset viewer.