Ignore:
Timestamp:
Oct 1, 2008 11:45:59 AM (11 years ago)
Author:
forrest
Message:

try and make faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcBranchActual.hpp

    r1067 r1087  
    15131513  /// Creates a branching object
    15141514  virtual CbcBranchingObject * createBranch(int way) ;
     1515  /// Return maximum number of nodes
     1516  int maximumNodes() const;
    15151517  /// Get maximum depth
    15161518  inline int maximumDepth() const
     
    15561558                 const double * lowerBefore,
    15571559                 const double * upperBefore,
    1558                  const unsigned char * status);
     1560                 const unsigned char * status,
     1561                 int depth);
    15591562
    15601563  /// Copy constructor
     
    15671570  virtual ~CbcSubProblem ();
    15681571
    1569   /// Apply subproblem
    1570   void apply(OsiSolverInterface * model);
     1572  /// Apply subproblem (1=bounds, 2=basis, 3=both)
     1573  void apply(OsiSolverInterface * model, int what=3) const;
    15711574
    15721575public:
     
    15801583  /// New bound
    15811584  double * newBounds_;
    1582   /// Status as diff
    1583   CoinWarmStartDiff * statusDifference_;
     1585  /// Status
     1586  mutable CoinWarmStartBasis * status_;
     1587  /// Depth
     1588  int depth_;
    15841589  /// Number of Extra bound changes
    15851590  int numberChangedBounds_;
     
    16531658  virtual CbcRangeCompare compareBranchingObject
    16541659  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     1660  /// Number of subproblems
     1661  inline int numberSubProblems() const
     1662  { return numberSubProblems_;}
     1663  /// Decrement number left and return number
     1664  inline int decrementNumberLeft()
     1665  { numberSubLeft_--; return numberSubLeft_;}
     1666  /// Which node we want to use
     1667  inline int whichNode() const
     1668  { return whichNode_;}
     1669  /// Set which node we want to use
     1670  inline void setWhichNode(int value)
     1671  { whichNode_ = value;}
     1672  // Sub problem
     1673  const CbcSubProblem * subProblem(int which) const
     1674  { return subProblems_+which;}
    16551675
    16561676public:
     
    16621682  /// Number of subproblems
    16631683  int numberSubProblems_;
     1684  /// Number of subproblems left
     1685  int numberSubLeft_;
     1686  /// Which node we want to use (-1 for default)
     1687  int whichNode_;
    16641688  /// Number of rows
    16651689  int numberRows_;
    16661690};
     1691
     1692/** Branching object for general objects - just one
     1693
     1694 */
     1695class CbcOneGeneralBranchingObject : public CbcBranchingObject {
     1696
     1697public:
     1698
     1699  // Default Constructor
     1700  CbcOneGeneralBranchingObject ();
     1701
     1702  // Useful constructor
     1703  CbcOneGeneralBranchingObject (CbcModel * model,
     1704                                 CbcGeneralBranchingObject * object,
     1705                                 int whichOne);
     1706 
     1707  // Copy constructor
     1708  CbcOneGeneralBranchingObject ( const CbcOneGeneralBranchingObject &);
     1709   
     1710  // Assignment operator
     1711  CbcOneGeneralBranchingObject & operator=( const CbcOneGeneralBranchingObject& rhs);
     1712
     1713  /// Clone
     1714  virtual CbcBranchingObject * clone() const;
     1715
     1716  // Destructor
     1717  virtual ~CbcOneGeneralBranchingObject ();
     1718 
     1719  using CbcBranchingObject::branch ;
     1720  /// Does next branch and updates state
     1721  virtual double branch();
     1722  /** Double checks in case node can change its mind!
     1723      Can change objective etc */
     1724  virtual void checkIsCutoff(double cutoff);
     1725
     1726  using CbcBranchingObject::print ;
     1727  /** \brief Print something about branch - only if log level high
     1728  */
     1729  virtual void print();
     1730  /** Return the type (an integer identifier) of \c this */
     1731  virtual int type() const { return 110; }
     1732
     1733  /** Compare the original object of \c this with the original object of \c
     1734      brObj. Assumes that there is an ordering of the original objects.
     1735      This method should be invoked only if \c this and brObj are of the same
     1736      type.
     1737      Return negative/0/positive depending on whether \c this is
     1738      smaller/same/larger than the argument.
     1739  */
     1740  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     1741
     1742  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     1743      same type and must have the same original object, but they may have
     1744      different feasible regions.
     1745      Return the appropriate CbcRangeCompare value (first argument being the
     1746      sub/superset if that's the case). In case of overlap (and if \c
     1747      replaceIfOverlap is true) replace the current branching object with one
     1748      whose feasible region is the overlap.
     1749   */
     1750  virtual CbcRangeCompare compareBranchingObject
     1751  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     1752
     1753public:
     1754  /// data
     1755  /// Object
     1756  CbcGeneralBranchingObject * object_;
     1757  /// Which one
     1758  int whichOne_;
     1759};
    16671760#endif
    16681761#endif
Note: See TracChangeset for help on using the changeset viewer.