Ignore:
Timestamp:
May 12, 2005 9:33:59 AM (16 years ago)
Author:
forrest
Message:

make createBranch non const

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/CbcBranchBase.hpp

    r122 r129  
    4040        recoding.
    4141 */
     42// This can be used if object wants to skip strong branching
     43  typedef struct {
     44    CbcBranchingObject * possibleBranch; // what a branch would do
     45    double upMovement; // cost going up (and initial away from feasible)
     46    double downMovement; // cost going down
     47    int numIntInfeasUp ; // without odd ones
     48    int numObjInfeasUp ; // just odd ones
     49    bool finishedUp; // true if solver finished
     50    int numItersUp ; // number of iterations in solver
     51    int numIntInfeasDown ; // without odd ones
     52    int numObjInfeasDown ; // just odd ones
     53    bool finishedDown; // true if solver finished
     54    int numItersDown; // number of iterations in solver
     55    int objectNumber; // Which object it is
     56    int fix; // 0 if no fix, 1 if we can fix up, -1 if we can fix down
     57  } CbcStrongInfo;
    4258
    4359class CbcObject {
     
    89105      variables, etc.)
    90106  */
    91   virtual CbcBranchingObject * createBranch(int way) const = 0;
     107  virtual CbcBranchingObject * createBranch(int way) = 0;
    92108 
    93109  /** \brief Given a valid solution (with reduced costs, etc.),
     
    205221  /// Destructor
    206222  virtual ~CbcBranchingObject ();
    207  
     223
     224  /** Some branchingObjects may claim to be able to skip
     225      strong branching.  If so they ahve to fill in CbcStrongInfo.
     226      The object mention in incoming CbcStrongInfo must match.
     227      Returns nonzero if skip is wanted */
     228  virtual int fillStrongInfo( CbcStrongInfo & info) {return 0;};
    208229  /** The number of branch arms created for this branching object
    209230
     
    336357    If \p bestSoFar is NULL, the routine should return a nonzero value.
    337358    This routine is used only after strong branching.
    338 
    339     It is now reccommended that bestBranch is used - see below.
    340     This has been left for compatibility.
     359    Either this or bestBranch is used depending which user wants.
    341360 */
    342361
     
    350369      and sets way of branching in chosen object.
    351370   
    352     This routine is used only after strong branching.
    353     This is reccommended version as it can be more sophisticated
     371    Either this or betterBranch is used depending which user wants.
    354372  */
    355373
     
    360378              double objectiveValue) ;
    361379
    362 
    363 
     380  /** Says whether this method can handle both methods -
     381      1 better, 2 best, 3 both */
     382  virtual int whichMethod() {return 2;};
     383
     384  /** Saves a clone of current branching object.  Can be used to update
     385      information on object causing branch - after branch */
     386  virtual void saveBranchingObject(CbcBranchingObject * object) {};
     387  /** Pass in information on branch just done.
     388      assumes object can get information from solver */
     389  virtual void updateInformation(OsiSolverInterface * solver) {};
     390
     391protected:
     392 
     393  // Clone of branching object
     394  CbcBranchingObject * object_;
    364395private:
    365  
    366396  /// Assignment is illegal
    367397  CbcBranchDecision & operator=(const CbcBranchDecision& rhs);
Note: See TracChangeset for help on using the changeset viewer.