Changeset 481 for branches/devel/Cbc/src


Ignore:
Timestamp:
Nov 7, 2006 2:53:01 PM (13 years ago)
Author:
forrest
Message:

for nonlinear

Location:
branches/devel/Cbc/src
Files:
2 edited

Legend:

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

    r477 r481  
    10891089#else
    10901090  OsiSolverBranch * branches = NULL;
    1091   // point to useful information
    1092   OsiBranchingInformation usefulInfo=usefulInformation();
    10931091  anyAction = chooseBranch(newNode, numberPassesLeft, NULL, cuts,resolved,
    1094                            NULL,NULL,NULL,branches,&usefulInfo);
     1092                           NULL,NULL,NULL,branches);
    10951093  if (anyAction == -2||newNode->objectiveValue() >= cutoff) {
    10961094    if (anyAction != -2) {
     
    16761674          if (newNode->objectiveValue() >= getCutoff()) {
    16771675            anyAction = -2; // say bad after all
     1676#ifdef COIN_DEVELOP
    16781677            printf("zapping2 CbcNodeInfo %x\n",newNode->nodeInfo()->parent());
     1678#endif
    16791679            // zap parent nodeInfo
    16801680            newNode->nodeInfo()->nullParent();
     
    17061706        OsiSolverBranch * branches=NULL;
    17071707        // point to useful information
    1708         OsiBranchingInformation usefulInfo=usefulInformation();
    17091708        anyAction = chooseBranch(newNode, numberPassesLeft,node, cuts,resolved,
    1710                                  lastws, lowerBefore, upperBefore, branches,&usefulInfo);
     1709                                 lastws, lowerBefore, upperBefore, branches);
    17111710/*
    17121711  If we end up infeasible, we can delete the new node immediately. Since this
     
    24282427  tree_= new CbcTree();
    24292428  branchingMethod_=NULL;
     2429  cutModifier_=NULL;
    24302430  strategy_=NULL;
    24312431  parentModel_=NULL;
     
    25582558  tree_= new CbcTree();
    25592559  branchingMethod_=NULL;
     2560  cutModifier_=NULL;
    25602561  strategy_=NULL;
    25612562  parentModel_=NULL;
     
    28302831  else
    28312832    branchingMethod_=NULL;
     2833  if (rhs.cutModifier_)
     2834    cutModifier_=rhs.cutModifier_->clone();
     2835  else
     2836    cutModifier_=NULL;
    28322837  cbcColLower_ = NULL;
    28332838  cbcColUpper_ = NULL;
     
    31113116    else
    31123117      branchingMethod_=NULL;
     3118    if (rhs.cutModifier_)
     3119      cutModifier_=rhs.cutModifier_->clone();
     3120    else
     3121      cutModifier_=NULL;
    31133122    delete strategy_;
    31143123    if (rhs.strategy_)
     
    32903299  delete branchingMethod_;
    32913300  branchingMethod_=NULL;
     3301  delete cutModifier_;
     3302  cutModifier_=NULL;
    32923303  // clear out tree
    32933304  if (tree_&&tree_->size())
     
    52705281    }
    52715282  }
    5272   if (feasible&&!solverCharacteristics_->solutionAddsCuts()) {
     5283  if (cutModifier_&&feasible&&!solverCharacteristics_->solutionAddsCuts()) {
    52735284    //double increment = getDblParam(CbcModel::CbcCutoffIncrement) ;
    52745285    double cutoff ;
     
    83808391                       bool & resolved, CoinWarmStartBasis *lastws,
    83818392                       const double * lowerBefore,const double * upperBefore,
    8382                        OsiSolverBranch * & branches,
    8383                        OsiBranchingInformation * usefulInfo)
     8393                       OsiSolverBranch * & branches)
    83848394{
    83858395  int anyAction =-1 ;
     
    84048414      }
    84058415    } else {
    8406       anyAction = newNode->chooseOsiBranch(this,oldNode,usefulInfo,branchingState) ;; // Osi method
     8416      OsiBranchingInformation usefulInfo=usefulInformation();
     8417      anyAction = newNode->chooseOsiBranch(this,oldNode,&usefulInfo,branchingState) ;; // Osi method
    84078418      //branchingState=0;
    84088419    }
     
    89208931  }
    89218932}
     8933// Set the cut modifier method
     8934void
     8935CbcModel::setCutModifier(CbcCutModifier * modifier)
     8936{
     8937  delete cutModifier_;
     8938  cutModifier_ = modifier->clone();
     8939}
     8940/* Set the cut modifier method
     8941 */
     8942void
     8943CbcModel::setCutModifier(CbcCutModifier & modifier)
     8944{
     8945  delete cutModifier_;
     8946  cutModifier_ = modifier.clone();
     8947}
  • branches/devel/Cbc/src/CbcModel.hpp

    r477 r481  
    2121class OsiRowCutDebugger;
    2222class CglCutGenerator;
     23class CbcCutModifier;
    2324class CglTreeProbingInfo;
    2425class CbcHeuristic;
     
    11571158  inline void setBranchingMethod(CbcBranchDecision & method)
    11581159  { delete branchingMethod_; branchingMethod_ = method.clone();};
     1160  /// Get the current cut modifier method
     1161  inline CbcCutModifier * cutModifier() const
     1162  { return cutModifier_;};
     1163  /// Set the cut modifier method
     1164  void setCutModifier(CbcCutModifier * modifier);
     1165  /** Set the cut modifier method
     1166 
     1167    \overload
     1168  */
     1169  void setCutModifier(CbcCutModifier & modifier);
    11591170  //@}
    11601171
     
    14441455                   bool & resolved, CoinWarmStartBasis *lastws,
    14451456                   const double * lowerBefore,const double * upperBefore,
    1446                    OsiSolverBranch * & branches,
    1447                    OsiBranchingInformation * usefulInfo);
     1457                   OsiSolverBranch * & branches);
    14481458  int chooseBranch(CbcNode * newNode, int numberPassesLeft, bool & resolved);
    14491459
     
    17411751  /// Variable selection function
    17421752  CbcBranchDecision * branchingMethod_;
     1753  /// Cut modifier function
     1754  CbcCutModifier * cutModifier_;
    17431755  /// Strategy
    17441756  CbcStrategy * strategy_;
Note: See TracChangeset for help on using the changeset viewer.