source: branches/sandbox/Cbc/src/CbcGeneralDepth.hpp @ 1293

Last change on this file since 1293 was 1293, checked in by EdwinStraver, 10 years ago
File size: 2.5 KB
RevLine 
[1293]1// Edwin 11/10/2009-- carved out of CbcBranchActual
2#ifndef CbcGeneralDepth_H
3#define CbcGeneralDepth_H
4
5#include "CbcGeneral.hpp"
6
7#ifdef COIN_HAS_CLP
8
9/** Define a catch all class.
10    This will create a list of subproblems using partial evaluation
11*/
12#include "ClpSimplex.hpp"
13#include "ClpNode.hpp"
14
15
16class CbcGeneralDepth : public CbcGeneral {
17
18public:
19
20    // Default Constructor
21    CbcGeneralDepth ();
22
23    /** Useful constructor
24        Just needs to point to model.
25        Initial version does evaluation to depth N
26        This is stored in CbcModel but may be
27        better here
28    */
29    CbcGeneralDepth (CbcModel * model, int maximumDepth);
30
31    // Copy constructor
32    CbcGeneralDepth ( const CbcGeneralDepth &);
33
34    /// Clone
35    virtual CbcObject * clone() const;
36
37    // Assignment operator
38    CbcGeneralDepth & operator=( const CbcGeneralDepth& rhs);
39
40    // Destructor
41    ~CbcGeneralDepth ();
42
43    /// Infeasibility - large is 0.5
44    virtual double infeasibility(const OsiBranchingInformation * info,
45                                 int &preferredWay) const;
46
47    using CbcObject::feasibleRegion ;
48    /// This looks at solution and sets bounds to contain solution
49    virtual void feasibleRegion();
50
51    /// Creates a branching object
52    virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
53    /// Return maximum number of nodes
54    inline int maximumNodes() const {
55        return maximumNodes_;
56    }
57    /// Get maximum depth
58    inline int maximumDepth() const {
59        return maximumDepth_;
60    }
61    /// Set maximum depth
62    inline void setMaximumDepth(int value) {
63        maximumDepth_ = value;
64    }
65    /// Get which solution
66    inline int whichSolution() const {
67        return whichSolution_;
68    }
69    /// Get ClpNode info
70    inline ClpNode * nodeInfo(int which) {
71        return nodeInfo_->nodeInfo_[which];
72    }
73
74    /// Redoes data when sequence numbers change
75    virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
76
77protected:
78    /// data
79    /// Maximum depth
80    int maximumDepth_;
81    /// Maximum nodes
82    int maximumNodes_;
83    /// Which node has solution (or -1)
84    mutable int whichSolution_;
85    /// Number of valid nodes (including whichSolution_)
86    mutable int numberNodes_;
87    /// For solving nodes
88    mutable ClpNodeStuff * nodeInfo_;
89};
90#endif //COIN_HAS_CLP
91#endif
Note: See TracBrowser for help on using the repository browser.