Ignore:
Timestamp:
Oct 8, 2006 7:33:47 PM (13 years ago)
Author:
forrest
Message:

towards common use with other solvers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcBranchActual.cpp

    r436 r439  
    694694CbcSimpleInteger::CbcSimpleInteger ()
    695695  : CbcObject(),
    696     sequence_(-1),
    697     columnNumber_(-1),
    698696    originalLower_(0.0),
    699697    originalUpper_(1.0),
    700     breakEven_(0.5)
     698    breakEven_(0.5),
     699    columnNumber_(-1),
     700    preferredWay_(0)
    701701{
    702702}
     
    706706  Loads actual upper & lower bounds for the specified variable.
    707707*/
    708 CbcSimpleInteger::CbcSimpleInteger (CbcModel * model, int sequence,
    709                                     int iColumn, double breakEven)
     708CbcSimpleInteger::CbcSimpleInteger ( CbcModel * model, int iColumn, double breakEven)
    710709  : CbcObject(model)
    711710{
    712   sequence_ = sequence ;
    713   id_ = iColumn; // set as well
    714711  columnNumber_ = iColumn ;
    715   originalLower_ = model_->solver()->getColLower()[columnNumber_] ;
    716   originalUpper_ = model_->solver()->getColUpper()[columnNumber_] ;
     712  originalLower_ = model->solver()->getColLower()[columnNumber_] ;
     713  originalUpper_ = model->solver()->getColUpper()[columnNumber_] ;
    717714  breakEven_ = breakEven;
    718715  assert (breakEven_>0.0&&breakEven_<1.0);
    719 }
     716  preferredWay_ = 0;
     717}
     718
    720719
    721720// Copy constructor
     
    724723
    725724{
    726   sequence_ = rhs.sequence_;
    727725  columnNumber_ = rhs.columnNumber_;
    728726  originalLower_ = rhs.originalLower_;
    729727  originalUpper_ = rhs.originalUpper_;
    730728  breakEven_ = rhs.breakEven_;
     729  preferredWay_ = rhs.preferredWay_;
    731730}
    732731
     
    748747    originalUpper_ = rhs.originalUpper_;
    749748    breakEven_ = rhs.breakEven_;
     749    preferredWay_ = rhs.preferredWay_;
    750750  }
    751751  return *this;
     
    756756{
    757757}
    758 
    759 // Infeasibility - large is 0.5
    760 double
    761 CbcSimpleInteger::infeasibility(int & preferredWay) const
    762 {
    763   OsiSolverInterface * solver = model_->solver();
    764   const double * solution = model_->testSolution();
    765   const double * lower = solver->getColLower();
    766   const double * upper = solver->getColUpper();
    767   double value = solution[columnNumber_];
    768   value = CoinMax(value, lower[columnNumber_]);
    769   value = CoinMin(value, upper[columnNumber_]);
    770   /*printf("%d %g %g %g %g\n",columnNumber_,value,lower[columnNumber_],
    771     solution[columnNumber_],upper[columnNumber_]);*/
     758// Construct an OsiSimpleInteger object
     759OsiSimpleInteger *
     760CbcSimpleInteger::osiObject() const
     761{
     762  OsiSimpleInteger * obj = new OsiSimpleInteger(columnNumber_,
     763                                                originalLower_,originalUpper_);
     764  obj->setPriority(priority());
     765  return obj;
     766}
     767
     768double
     769CbcSimpleInteger::infeasibility(const OsiSolverInterface * solver, const OsiBranchingInformation * info,
     770                         int & preferredWay) const
     771{
     772  double value = info->solution_[columnNumber_];
     773  value = CoinMax(value, info->lower_[columnNumber_]);
     774  value = CoinMin(value, info->upper_[columnNumber_]);
    772775  double nearest = floor(value+(1.0-breakEven_));
    773776  assert (breakEven_>0.0&&breakEven_<1.0);
    774   double integerTolerance =
    775     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    776777  if (nearest>value)
    777778    preferredWay=1;
     
    786787  else
    787788    weight = (0.5/(1.0-breakEven_))*weight;
    788   if (fabs(value-nearest)<=integerTolerance)
     789  if (fabs(value-nearest)<=info->integerTolerance_)
    789790    return 0.0;
    790791  else
    791792    return weight;
     793}
     794double
     795CbcSimpleInteger::feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const
     796{
     797  double value = info->solution_[columnNumber_];
     798  double newValue = CoinMax(value, info->lower_[columnNumber_]);
     799  newValue = CoinMin(newValue, info->upper_[columnNumber_]);
     800  newValue = floor(newValue+0.5);
     801  solver->setColLower(columnNumber_,newValue);
     802  solver->setColUpper(columnNumber_,newValue);
     803  return fabs(value-newValue);
     804}
     805
     806/* Create an OsiSolverBranch object
     807   
     808This returns NULL if branch not represented by bound changes
     809*/
     810OsiSolverBranch *
     811CbcSimpleInteger::solverBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info) const
     812{
     813  double value = info->solution_[columnNumber_];
     814  value = CoinMax(value, info->lower_[columnNumber_]);
     815  value = CoinMin(value, info->upper_[columnNumber_]);
     816  assert (info->upper_[columnNumber_]>info->lower_[columnNumber_]);
     817#ifndef NDEBUG
     818  double nearest = floor(value+0.5);
     819  assert (fabs(value-nearest)>info->integerTolerance_);
     820#endif
     821  OsiSolverBranch * branch = new OsiSolverBranch();
     822  branch->addBranch(columnNumber_,value);
     823  return branch;
     824}
     825// Creates a branching object
     826CbcBranchingObject *
     827CbcSimpleInteger::createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way)
     828{
     829  double value = info->solution_[columnNumber_];
     830  value = CoinMax(value, info->lower_[columnNumber_]);
     831  value = CoinMin(value, info->upper_[columnNumber_]);
     832  assert (info->upper_[columnNumber_]>info->lower_[columnNumber_]);
     833  if (!info->hotstartSolution_) {
     834#ifndef NDEBUG
     835    double nearest = floor(value+0.5);
     836    assert (fabs(value-nearest)>info->integerTolerance_);
     837#endif
     838  } else {
     839    double targetValue = info->hotstartSolution_[columnNumber_];
     840    if (way>0)
     841      value = targetValue-0.1;
     842    else
     843      value = targetValue+0.1;
     844  }
     845  CbcBranchingObject * branch = new CbcIntegerBranchingObject(model_,columnNumber_,way,
     846                                             value);
     847  branch->setOriginalObject(this);
     848  return branch;
     849}
     850/* Column number if single column object -1 otherwise,
     851   so returns >= 0
     852   Used by heuristics
     853*/
     854int
     855CbcSimpleInteger::columnNumber() const
     856{
     857  return columnNumber_;
     858}
     859
     860// Infeasibility - large is 0.5
     861double
     862CbcSimpleInteger::infeasibility(int & preferredWay) const
     863{
     864  abort();
     865  return 0.0;
    792866}
    793867
     
    800874CbcSimpleInteger::feasibleRegion()
    801875{
    802   OsiSolverInterface * solver = model_->solver();
    803   const double * lower = solver->getColLower();
    804   const double * upper = solver->getColUpper();
    805   const double * solution = model_->testSolution();
    806   double value = solution[columnNumber_];
    807   value = CoinMax(value, lower[columnNumber_]);
    808   value = CoinMin(value, upper[columnNumber_]);
    809 
    810   double nearest = floor(value+0.5);
    811   //double integerTolerance =
    812   //model_->getDblParam(CbcModel::CbcIntegerTolerance);
    813   // Scaling may have moved it a bit
    814   //assert (fabs(value-nearest)<=100.0*integerTolerance);
    815   assert (fabs(value-nearest)<=0.01);
    816   solver->setColLower(columnNumber_,nearest);
    817   solver->setColUpper(columnNumber_,nearest);
    818 }
    819 // Redoes data when sequence numbers change
    820 void
    821 CbcSimpleInteger::redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns)
    822 {
    823   model_=model;
    824   int i;
    825   for (i=0;i<numberColumns;i++) {
    826     if (originalColumns[i]==columnNumber_)
    827       break;
    828   }
    829   if (i<numberColumns)
    830     columnNumber_=i;
    831   else
    832     abort(); // should never happen
    833 }
    834 /* Column number if single column object -1 otherwise,
    835    so returns >= 0
    836    Used by heuristics
    837 */
    838 int
    839 CbcSimpleInteger::columnNumber() const
    840 {
    841   return columnNumber_;
    842 }
    843 
    844 // Creates a branching object
     876  abort();
     877}
    845878CbcBranchingObject *
    846 CbcSimpleInteger::createBranch(int way)
    847 {
    848   OsiSolverInterface * solver = model_->solver();
    849   const double * solution = model_->testSolution();
    850   const double * lower = solver->getColLower();
    851   const double * upper = solver->getColUpper();
    852   double value = solution[columnNumber_];
    853   value = CoinMax(value, lower[columnNumber_]);
    854   value = CoinMin(value, upper[columnNumber_]);
    855   assert (upper[columnNumber_]>lower[columnNumber_]);
    856   if (!model_->hotstartSolution()) {
    857 #ifndef NDEBUG
    858     double nearest = floor(value+0.5);
    859     double integerTolerance =
    860     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    861     assert (fabs(value-nearest)>integerTolerance);
    862 #endif
    863   } else {
    864     const double * hotstartSolution = model_->hotstartSolution();
    865     double targetValue = hotstartSolution[columnNumber_];
    866     if (way>0)
    867       value = targetValue-0.1;
    868     else
    869       value = targetValue+0.1;
    870   }
    871   CbcBranchingObject * branch = new CbcIntegerBranchingObject(model_,sequence_,way,
    872                                              value);
    873   branch->setOriginalObject(this);
    874   return branch;
    875 }
    876 
    877 /* Create an OsiSolverBranch object
    878    
    879 This returns NULL if branch not represented by bound changes
    880 */
    881 OsiSolverBranch *
    882 CbcSimpleInteger::solverBranch() const
    883 {
    884   OsiSolverInterface * solver = model_->solver();
    885   const double * solution = model_->testSolution();
    886   const double * lower = solver->getColLower();
    887   const double * upper = solver->getColUpper();
    888   double value = solution[columnNumber_];
    889   value = CoinMax(value, lower[columnNumber_]);
    890   value = CoinMin(value, upper[columnNumber_]);
    891   assert (upper[columnNumber_]>lower[columnNumber_]);
    892 #ifndef NDEBUG
    893   double nearest = floor(value+0.5);
    894   double integerTolerance =
    895     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    896   assert (fabs(value-nearest)>integerTolerance);
    897 #endif
    898   OsiSolverBranch * branch = new OsiSolverBranch();
    899   branch->addBranch(columnNumber_,value);
    900   return branch;
    901 }
    902  
    903 
    904 /* Given valid solution (i.e. satisfied) and reduced costs etc
    905    returns a branching object which would give a new feasible
    906    point in direction reduced cost says would be cheaper.
    907    If no feasible point returns null
    908 */
    909 CbcBranchingObject *
    910 CbcSimpleInteger::preferredNewFeasible() const
    911 {
    912   OsiSolverInterface * solver = model_->solver();
    913   double value = model_->testSolution()[columnNumber_];
    914 
    915   double nearest = floor(value+0.5);
    916 #ifndef NDEBUG
    917   double integerTolerance =
    918     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    919   assert (fabs(value-nearest)<=integerTolerance);
    920 #endif
    921   double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    922   CbcIntegerBranchingObject * object = NULL;
    923   if (dj>=0.0) {
    924     // can we go down
    925     if (nearest>originalLower_+0.5) {
    926       // yes
    927       object = new CbcIntegerBranchingObject(model_,sequence_,-1,
    928                                              nearest-1.0,nearest-1.0);
    929     }
    930   } else {
    931     // can we go up
    932     if (nearest<originalUpper_-0.5) {
    933       // yes
    934       object = new CbcIntegerBranchingObject(model_,sequence_,-1,
    935                                              nearest+1.0,nearest+1.0);
    936     }
    937   }
    938   return object;
    939 }
    940  
    941 /* Given valid solution (i.e. satisfied) and reduced costs etc
    942    returns a branching object which would give a new feasible
    943    point in direction opposite to one reduced cost says would be cheaper.
    944    If no feasible point returns null
    945 */
    946 CbcBranchingObject *
    947 CbcSimpleInteger::notPreferredNewFeasible() const
    948 {
    949   OsiSolverInterface * solver = model_->solver();
    950   double value = model_->testSolution()[columnNumber_];
    951 
    952   double nearest = floor(value+0.5);
    953 #ifndef NDEBUG
    954   double integerTolerance =
    955     model_->getDblParam(CbcModel::CbcIntegerTolerance);
    956   assert (fabs(value-nearest)<=integerTolerance);
    957 #endif
    958   double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    959   CbcIntegerBranchingObject * object = NULL;
    960   if (dj<=0.0) {
    961     // can we go down
    962     if (nearest>originalLower_+0.5) {
    963       // yes
    964       object = new CbcIntegerBranchingObject(model_,sequence_,-1,
    965                                              nearest-1.0,nearest-1.0);
    966     }
    967   } else {
    968     // can we go up
    969     if (nearest<originalUpper_-0.5) {
    970       // yes
    971       object = new CbcIntegerBranchingObject(model_,sequence_,-1,
    972                                              nearest+1.0,nearest+1.0);
    973     }
    974   }
    975   return object;
    976 }
    977  
    978 /*
    979   Bounds may be tightened, so it may be good to be able to refresh the local
    980   copy of the original bounds.
    981  */
    982 void
    983 CbcSimpleInteger::resetBounds()
    984 {
    985   originalLower_ = model_->solver()->getColLower()[columnNumber_];
    986   originalUpper_ = model_->solver()->getColUpper()[columnNumber_];
    987 }
    988 
    989 
     879CbcSimpleInteger::createBranch( int way)
     880{
     881  abort();
     882  return NULL;
     883}
    990884// Default Constructor
    991885CbcIntegerBranchingObject::CbcIntegerBranchingObject()
     
    1003897  :CbcBranchingObject(model,variable,way,value)
    1004898{
    1005   int iColumn = model_->integerVariable()[variable_];
     899  int iColumn = variable;
    1006900  down_[0] = model_->solver()->getColLower()[iColumn];
    1007901  down_[1] = floor(value_);
     
    1016910  :CbcBranchingObject(model,variable,way,lowerValue)
    1017911{
    1018   numberBranchesLeft_=1;
     912  setNumberBranchesLeft(1);
    1019913  down_[0] = lowerValue;
    1020914  down_[1] = upperValue;
     
    1069963*/
    1070964double
    1071 CbcIntegerBranchingObject::branch(bool normalBranch)
    1072 {
    1073   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    1074     print(normalBranch);
    1075   numberBranchesLeft_--;
    1076   int iColumn = model_->integerVariable()[variable_];
     965CbcIntegerBranchingObject::branch()
     966{
     967  decrementNumberBranchesLeft();
     968  int iColumn = originalCbcObject_->columnNumber();
     969  assert (variable_==iColumn);
    1077970  if (way_<0) {
    1078971#ifdef CBC_DEBUG
     
    1102995// Print what would happen 
    1103996void
    1104 CbcIntegerBranchingObject::print(bool normalBranch)
    1105 {
    1106   int iColumn = model_->integerVariable()[variable_];
     997CbcIntegerBranchingObject::print()
     998{
     999  int iColumn = originalCbcObject_->columnNumber();
     1000  assert (variable_==iColumn);
    11071001  if (way_<0) {
    11081002  { double olb,oub ;
     
    11381032  Loads actual upper & lower bounds for the specified variable.
    11391033*/
    1140 CbcSimpleIntegerPseudoCost::CbcSimpleIntegerPseudoCost (CbcModel * model, int sequence,
     1034CbcSimpleIntegerPseudoCost::CbcSimpleIntegerPseudoCost (CbcModel * model,
    11411035                                    int iColumn, double breakEven)
    1142   : CbcSimpleInteger(model,sequence,iColumn,breakEven)
     1036  : CbcSimpleInteger(model,iColumn,breakEven)
    11431037{
    11441038  const double * cost = model->getObjCoefficients();
     
    11561050  Loads actual upper & lower bounds for the specified variable.
    11571051*/
    1158 CbcSimpleIntegerPseudoCost::CbcSimpleIntegerPseudoCost (CbcModel * model, int sequence,
     1052CbcSimpleIntegerPseudoCost::CbcSimpleIntegerPseudoCost (CbcModel * model,
    11591053                                    int iColumn, double downPseudoCost,
    11601054                                                        double upPseudoCost)
    1161   : CbcSimpleInteger(model,sequence,iColumn)
     1055  : CbcSimpleInteger(model,iColumn)
    11621056{
    11631057  downPseudoCost_ = CoinMax(1.0e-10,downPseudoCost);
     
    11661060  upDownSeparator_ = -1.0;
    11671061  method_=0;
     1062}
     1063// Useful constructor - passed and model index and pseudo costs
     1064CbcSimpleIntegerPseudoCost::CbcSimpleIntegerPseudoCost (CbcModel * model, int dummy,int iColumn,
     1065                                                        double downPseudoCost, double upPseudoCost)
     1066{
     1067  CbcSimpleIntegerPseudoCost(model,iColumn,downPseudoCost,upPseudoCost);
    11681068}
    11691069
     
    12321132  }
    12331133  CbcIntegerPseudoCostBranchingObject * newObject =
    1234     new CbcIntegerPseudoCostBranchingObject(model_,sequence_,way,
     1134    new CbcIntegerPseudoCostBranchingObject(model_,columnNumber_,way,
    12351135                                            value);
    12361136  double up =  upPseudoCost_*(ceil(value)-value);
     
    14151315*/
    14161316double
    1417 CbcIntegerPseudoCostBranchingObject::branch(bool normalBranch)
    1418 {
    1419   CbcIntegerBranchingObject::branch(normalBranch);
     1317CbcIntegerPseudoCostBranchingObject::branch()
     1318{
     1319  CbcIntegerBranchingObject::branch();
    14201320  return changeInGuessed_;
    14211321}
     
    14991399}
    15001400double
    1501 CbcCliqueBranchingObject::branch(bool normalBranch)
    1502 {
    1503   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    1504     print(normalBranch);
    1505   numberBranchesLeft_--;
     1401CbcCliqueBranchingObject::branch()
     1402{
     1403  decrementNumberBranchesLeft();
    15061404  int iWord;
    15071405  int numberMembers = clique_->numberMembers();
     
    15621460// Print what would happen 
    15631461void
    1564 CbcCliqueBranchingObject::print(bool normalBranch)
     1462CbcCliqueBranchingObject::print()
    15651463{
    15661464  int iWord;
     
    16931591}
    16941592double
    1695 CbcLongCliqueBranchingObject::branch(bool normalBranch)
    1696 {
    1697   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    1698     print(normalBranch);
    1699   numberBranchesLeft_--;
     1593CbcLongCliqueBranchingObject::branch()
     1594{
     1595  decrementNumberBranchesLeft();
    17001596  int iWord;
    17011597  int numberMembers = clique_->numberMembers();
     
    17551651}
    17561652void
    1757 CbcLongCliqueBranchingObject::print(bool normalBranch)
     1653CbcLongCliqueBranchingObject::print()
    17581654{
    17591655  int iWord;
     
    18391735}
    18401736double
    1841 CbcSOSBranchingObject::branch(bool normalBranch)
    1842 {
    1843   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    1844     print(normalBranch);
    1845   numberBranchesLeft_--;
     1737CbcSOSBranchingObject::branch()
     1738{
     1739  decrementNumberBranchesLeft();
    18461740  int numberMembers = set_->numberMembers();
    18471741  const int * which = set_->members();
     
    18761770// Print what would happen 
    18771771void
    1878 CbcSOSBranchingObject::print(bool normalBranch)
     1772CbcSOSBranchingObject::print()
    18791773{
    18801774  int numberMembers = set_->numberMembers();
     
    19401834  bestNumberUp_ = 0;
    19411835  bestChangeDown_ = 0.0;
     1836  bestObject_ = NULL;
    19421837  bestNumberDown_ = 0;
    1943   bestObject_ = NULL;
    19441838}
    19451839
     
    19471841CbcBranchDefaultDecision::CbcBranchDefaultDecision (
    19481842                                    const CbcBranchDefaultDecision & rhs)
    1949   :CbcBranchDecision()
     1843  :CbcBranchDecision(rhs)
    19501844{
    19511845  bestCriterion_ = rhs.bestCriterion_;
     
    19551849  bestNumberDown_ = rhs.bestNumberDown_;
    19561850  bestObject_ = rhs.bestObject_;
     1851  model_ = rhs.model_;
    19571852}
    19581853
     
    19781873  bestNumberDown_ = 0;
    19791874  bestObject_ = NULL;
     1875  model_ = model;
    19801876}
    19811877
     
    19941890                            double changeDn, int numInfDn)
    19951891{
    1996   bool beforeSolution = thisOne->model()->getSolutionCount()==
    1997     thisOne->model()->getNumberHeuristicSolutions();;
     1892  bool beforeSolution = cbcModel()->getSolutionCount()==
     1893    cbcModel()->getNumberHeuristicSolutions();;
    19981894  int betterWay=0;
    19991895  if (beforeSolution) {
     
    20911987  int whichObject = -1;
    20921988  if (numberObjects) {
    2093     CbcModel * model = objects[0]->model();
     1989    CbcModel * model = cbcModel();
    20941990    // at continuous
    20951991    //double continuousObjective = model->getContinuousObjective();
     
    27392635}
    27402636double
    2741 CbcFixingBranchingObject::branch(bool normalBranch)
    2742 {
    2743   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    2744     print(normalBranch);
    2745   numberBranchesLeft_--;
     2637CbcFixingBranchingObject::branch()
     2638{
     2639  decrementNumberBranchesLeft();
    27462640  OsiSolverInterface * solver = model_->solver();
    27472641  const double * columnLower = solver->getColLower();
     
    27812675}
    27822676void
    2783 CbcFixingBranchingObject::print(bool normalBranch)
     2677CbcFixingBranchingObject::print()
    27842678{
    27852679  int i;
     
    30322926    value = CoinMin(value, upper[iColumn]);
    30332927    if (upper[iColumn]>lower[iColumn]) {
    3034       double distance = CoinMin(value-lower[iColumn],upper[iColumn]-value);
     2928      double distance = upper[iColumn]-value;
    30352929      list[numberFree]=j;
    30362930      sort[numberFree++]=distance;
     
    30652959  :CbcBranchingObject(model,nway->id(),-1,0.5)
    30662960{
     2961  numberBranches_ = number;
    30672962  order_ = new int [number];
    30682963  object_=nway;
    30692964  numberInSet_=number;
    30702965  memcpy(order_,order,number*sizeof(int));
    3071   numberBranchesLeft_=number;
    30722966}
    30732967
     
    31163010}
    31173011double
    3118 CbcNWayBranchingObject::branch(bool normalBranch)
    3119 {
    3120   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    3121     print(normalBranch);
    3122   numberBranchesLeft_--;
    3123   assert (numberBranchesLeft_>=0);
    3124   int which = numberBranchesLeft_;
    3125   if (numberBranchesLeft_==numberInSet_) {
     3012CbcNWayBranchingObject::branch()
     3013{
     3014  int which = branchIndex_;
     3015  branchIndex_++;
     3016  assert (numberBranchesLeft()>=0);
     3017  if (which==0) {
    31263018    // first branch so way_ may mean something
    31273019    assert (way_==-1||way_==1);
    3128     if (way_==1)
    3129       which--;
    3130   } else if (numberBranchesLeft_+1==numberInSet_) {
     3020    if (way_==-1)
     3021      which++;
     3022  } else if (which==1) {
    31313023    // second branch so way_ may mean something
    31323024    assert (way_==-1||way_==1);
    31333025    if (way_==-1)
    3134       which++;
     3026      which--;
    31353027    // switch way off
    31363028    way_=0;
     
    31423034    int iSequence = order_[j];
    31433035    int iColumn = members[iSequence];
    3144     if (j!=numberBranchesLeft_) {
     3036    if (j!=which) {
    31453037      model_->solver()->setColUpper(iColumn,lower[iColumn]);
    31463038      //model_->solver()->setColLower(iColumn,lower[iColumn]);
     
    31623054}
    31633055void
    3164 CbcNWayBranchingObject::print(bool normalBranch)
     3056CbcNWayBranchingObject::print()
    31653057{
    31663058  printf("NWay - Up Fix ");
     
    33433235  :CbcBranchingObject(model,0,0,0.5)
    33443236{
    3345   numberBranchesLeft_=1;
     3237  setNumberBranchesLeft(1);
    33463238}
    33473239
     
    33773269*/
    33783270double
    3379 CbcDummyBranchingObject::branch(bool normalBranch)
    3380 {
    3381   if (model_->messageHandler()->logLevel()>2&&normalBranch)
    3382     print(normalBranch);
    3383   numberBranchesLeft_=0;
     3271CbcDummyBranchingObject::branch()
     3272{
     3273  decrementNumberBranchesLeft();
    33843274  return 0.0;
    33853275}
    33863276// Print what would happen 
    33873277void
    3388 CbcDummyBranchingObject::print(bool normalBranch)
     3278CbcDummyBranchingObject::print()
    33893279{
    33903280  printf("Dummy branch\n");
Note: See TracChangeset for help on using the changeset viewer.