source: trunk/Cbc/src/CbcPartialNodeInfo.hpp @ 1422

Last change on this file since 1422 was 1357, checked in by coin, 10 years ago

run 'astyle -A4 -p' and dos2unix

File size: 3.0 KB
Line 
1// Edwin 11/24/09 carved from CbcNode
2#ifndef CbcPartialNodeInfo_H
3#define CbcPartialNodeInfo_H
4
5#include <string>
6#include <vector>
7
8#include "CoinWarmStartBasis.hpp"
9#include "CoinSearchTree.hpp"
10#include "CbcBranchBase.hpp"
11#include "CbcNodeInfo.hpp"
12
13class OsiSolverInterface;
14class OsiSolverBranch;
15
16class OsiCuts;
17class OsiRowCut;
18class OsiRowCutDebugger;
19class CoinWarmStartBasis;
20class CbcCountRowCut;
21class CbcModel;
22class CbcNode;
23class CbcSubProblem;
24class CbcGeneralBranchingObject;
25/** \brief Holds information for recreating a subproblem by incremental change
26           from the parent.
27
28  A CbcPartialNodeInfo object contains changes to the bounds and basis, and
29  additional cuts, required to recreate a subproblem by modifying and
30  augmenting the parent subproblem.
31*/
32
33class CbcPartialNodeInfo : public CbcNodeInfo {
34
35public:
36
37    /** \brief Modify model according to information at node
38
39        The routine modifies the model according to bound and basis change
40        information at node and adds any cuts to the addCuts array.
41    */
42    virtual void applyToModel (CbcModel *model, CoinWarmStartBasis *&basis,
43                               CbcCountRowCut **addCuts,
44                               int &currentNumberCuts) const ;
45
46    /// Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible)
47    virtual int applyBounds(int iColumn, double & lower, double & upper, int force) ;
48    /** Builds up row basis backwards (until original model).
49        Returns NULL or previous one to apply .
50        Depends on Free being 0 and impossible for cuts
51    */
52    virtual CbcNodeInfo * buildRowBasis(CoinWarmStartBasis & basis ) const ;
53    // Default Constructor
54    CbcPartialNodeInfo ();
55
56    // Constructor from current state
57    CbcPartialNodeInfo (CbcNodeInfo * parent, CbcNode * owner,
58                        int numberChangedBounds, const int * variables,
59                        const double * boundChanges,
60                        const CoinWarmStartDiff *basisDiff) ;
61
62    // Copy constructor
63    CbcPartialNodeInfo ( const CbcPartialNodeInfo &);
64
65    // Destructor
66    ~CbcPartialNodeInfo ();
67
68    /// Clone
69    virtual CbcNodeInfo * clone() const;
70    /// Basis diff information
71    inline const CoinWarmStartDiff *basisDiff() const {
72        return basisDiff_ ;
73    }
74    /// Which variable (top bit if upper bound changing)
75    inline const int * variables() const {
76        return variables_;
77    }
78    // New bound
79    inline const double * newBounds() const {
80        return newBounds_;
81    }
82    /// Number of bound changes
83    inline int numberChangedBounds() const {
84        return numberChangedBounds_;
85    }
86protected:
87    /* Data values */
88
89    /// Basis diff information
90    CoinWarmStartDiff *basisDiff_ ;
91    /// Which variable (top bit if upper bound changing)
92    int * variables_;
93    // New bound
94    double * newBounds_;
95    /// Number of bound changes
96    int numberChangedBounds_;
97private:
98
99    /// Illegal Assignment operator
100    CbcPartialNodeInfo & operator=(const CbcPartialNodeInfo& rhs);
101};
102
103#endif //CbcPartialNodeInfo_H
Note: See TracBrowser for help on using the repository browser.