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/CbcModel.hpp

    r426 r439  
    88#include "CoinMessageHandler.hpp"
    99#include "OsiSolverInterface.hpp"
     10#include "OsiBranchingObject.hpp"
    1011#include "OsiCuts.hpp"
    1112#include "CoinWarmStartBasis.hpp"
     
    2223class CglTreeProbingInfo;
    2324class CbcHeuristic;
    24 class CbcObject;
     25class OsiObject;
    2526class CbcTree;
    2627class CbcStrategy;
     
    103104  */
    104105  CbcFathomDiscipline,
     106  /** Adjusts printout
     107      1 does different node message with number unsatisfied on last branch
     108  */
     109  CbcPrinting,
    105110  /** Just a marker, so that a static sized array can store parameters. */
    106111  CbcLastIntParam
     
    350355  /** \name Object manipulation routines
    351356 
    352     See CbcObject for an explanation of `object' in the context of CbcModel.
     357    See OsiObject for an explanation of `object' in the context of CbcModel.
    353358  */
    354359  //@{
     
    361366
    362367  /// Get the array of objects
    363   inline CbcObject ** objects() const { return object_;};
     368  inline OsiObject ** objects() const { return object_;};
    364369
    365370  /// Get the specified object
    366   const inline CbcObject * object(int which) const { return object_[which];};
     371  const inline OsiObject * object(int which) const { return object_[which];};
    367372  /// Get the specified object
    368   inline CbcObject * modifiableObject(int which) const { return object_[which];};
     373  inline OsiObject * modifiableObject(int which) const { return object_[which];};
    369374
    370375  /// Delete all object information
    371376  void deleteObjects();
     377
     378  /** Add in object information.
     379 
     380    Objects are cloned; the owner can delete the originals.
     381  */
     382  void addObjects(int numberObjects, OsiObject ** objects);
    372383
    373384  /** Add in object information.
     
    459470    return getIntParam(CbcMaxNumSol);
    460471  }
     472  /// Set the printing mode
     473  inline bool setPrintingMode( int value)
     474  { return setIntParam(CbcPrinting,value); }
     475
     476  /// Get the printing mode
     477  inline int getPrintingMode() const
     478  { return getIntParam(CbcPrinting); }
    461479
    462480  /** Set the
     
    601619  inline int numberStrong() const
    602620  { return numberStrong_;};
     621  /** Set global preferred way to branch
     622      -1 down, +1 up, 0 no preference */
     623  inline void setPreferredWay(int value)
     624  {preferredWay_=value;};
     625  /** Get the preferred way to branch (default 0) */
     626  inline int getPreferredWay() const
     627  { return preferredWay_;};
    603628  /** Set size of mini - tree.  If > 1 then does total enumeration of
    604629      tree given by this best variables to branch on
     
    712737    inline int status() const
    713738    { return status_;};
     739    inline void setProblemStatus(int value)
     740    { status_=value;};
    714741    /** Secondary status of problem
    715742        -1 unset (status_ will also be -1)
     
    725752    inline int secondaryStatus() const
    726753    { return secondaryStatus_;};
     754    inline void setSecondaryStatus(int value)
     755    { secondaryStatus_=value;};
    727756    /// Are there numerical difficulties (for initialSolve) ?
    728757    bool isInitialSolveAbandoned() const ;
     
    11211150  /// Set the branching decision method.
    11221151  inline void setBranchingMethod(CbcBranchDecision * method)
    1123   { branchingMethod_ = method->clone();};
     1152  { delete branchingMethod_; branchingMethod_ = method->clone();};
    11241153  /** Set the branching method
    11251154 
     
    11271156  */
    11281157  inline void setBranchingMethod(CbcBranchDecision & method)
    1129   { branchingMethod_ = method.clone();};
     1158  { delete branchingMethod_; branchingMethod_ = method.clone();};
    11301159  //@}
    11311160
     
    14011430  /// Encapsulates solver resolve
    14021431  int resolve(OsiSolverInterface * solver);
     1432
     1433  /** Encapsulates choosing a variable -
     1434      anyAction -2, infeasible (-1 round again), 0 done
     1435  */
     1436  int chooseBranch(CbcNode * newNode, int numberPassesLeft,
     1437                   CbcNode * oldNode, OsiCuts & cuts,
     1438                   bool & resolved, CoinWarmStartBasis *lastws,
     1439                   const double * lowerBefore,const double * upperBefore,
     1440                   OsiSolverBranch * & branches,
     1441                   OsiBranchingInformation * usefulInfo);
     1442  int chooseBranch(CbcNode * newNode, int numberPassesLeft, bool & resolved);
    14031443
    14041444  /** Return an empty basis object of the specified size
     
    15021542  /// Create C++ lines to get to current state
    15031543  void generateCpp( FILE * fp,int options);
     1544  /// Generate an OsiBranchingInformation object
     1545  OsiBranchingInformation usefulInformation() const;
    15041546  //@}
    15051547
     
    17821824          objects.
    17831825  */
    1784   CbcObject ** object_;
     1826  OsiObject ** object_;
    17851827
    17861828 
     
    18051847  /// Maximum number of cut passes
    18061848  int maximumCutPasses_;
     1849  /// Preferred way of branching
     1850  int preferredWay_;
    18071851  /// Current cut pass number
    18081852  int currentPassNumber_;
     
    18541898 //@}
    18551899};
    1856 
     1900/// So we can use osiObject or CbcObject during transition
     1901void getIntegerInformation(const OsiObject * object, double & originalLower,
     1902                           double & originalUpper) ;
    18571903#endif
Note: See TracChangeset for help on using the changeset viewer.