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

Last change on this file since 1293 was 1293, checked in by EdwinStraver, 10 years ago
File size: 2.0 KB
Line 
1// Edwin 11/9/2009-- carved out of CbcBranchActual
2/** Define an n-way class for variables.
3    Only valid value is one at UB others at LB
4    Normally 0-1
5*/
6#ifndef CbcNWay_H
7#define CbcNWay_H
8
9class CbcNWay : public CbcObject {
10
11public:
12
13    // Default Constructor
14    CbcNWay ();
15
16    /** Useful constructor (which are matrix indices)
17    */
18    CbcNWay (CbcModel * model, int numberMembers,
19             const int * which, int identifier);
20
21    // Copy constructor
22    CbcNWay ( const CbcNWay &);
23
24    /// Clone
25    virtual CbcObject * clone() const;
26
27    /// Assignment operator
28    CbcNWay & operator=( const CbcNWay& rhs);
29
30    /// Destructor
31    virtual ~CbcNWay ();
32
33    /// Set up a consequence for a single member
34    void setConsequence(int iColumn, const CbcConsequence & consequence);
35
36    /// Applies a consequence for a single member
37    void applyConsequence(int iSequence, int state) const;
38
39    /// Infeasibility - large is 0.5 (and 0.5 will give this)
40    virtual double infeasibility(const OsiBranchingInformation * info,
41                                 int &preferredWay) const;
42
43    using CbcObject::feasibleRegion ;
44    /// This looks at solution and sets bounds to contain solution
45    virtual void feasibleRegion();
46
47    /// Creates a branching object
48    virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
49
50    /// Number of members
51    inline int numberMembers() const {
52        return numberMembers_;
53    }
54
55    /// Members (indices in range 0 ... numberColumns-1)
56    inline const int * members() const {
57        return members_;
58    }
59    /// Redoes data when sequence numbers change
60    virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
61
62protected:
63    /// data
64    /// Number of members
65    int numberMembers_;
66
67    /// Members (indices in range 0 ... numberColumns-1)
68    int * members_;
69    /// Consequences (normally NULL)
70    CbcConsequence ** consequence_;
71};
72#endif
Note: See TracBrowser for help on using the repository browser.