summaryrefslogtreecommitdiff
path: root/build/Bonmin/include/coin/BonCbcNode.hpp
blob: 9594124c22e71bd8dbded654ae072fed1a188232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// (C) Copyright International Business Machines Corporation and Carnegie Mellon University 2006
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// John J. Forrest, International Business Machines Corporation
// Pierre Bonami, Carnegie Mellon University,
//
// Date : 03/15/2006

#ifndef BonminCbcNode_H
#define BonminCbcNode_H

#include "CbcNode.hpp"
#include "BonRegisteredOptions.hpp"


namespace Bonmin
{
  /** \brief Holds information for recreating a subproblem by incremental change
  	   from the parent for Bonmin

    A BonminBonminCbcPartialNodeInfo object contains changes to the bounds and basis, and
    additional cuts, required to recreate a subproblem by modifying and
    augmenting the parent subproblem.
  */

  class BonCbcFullNodeInfo : public CbcFullNodeInfo
  {

  public:
    friend class BonCbcPartialNodeInfo;
    // Default Constructor
    BonCbcFullNodeInfo ();

    // Constructor from current state
    BonCbcFullNodeInfo (CbcModel * model, int numberRowsAtContinuous);

    // Copy constructor
    BonCbcFullNodeInfo ( const BonCbcFullNodeInfo &);

    // Destructor
    ~BonCbcFullNodeInfo ();

    /// Clone
    virtual CbcNodeInfo * clone() const;

    /**Method called when all direct sons have been explored to flush
       useless warm start information.*/
    virtual void allBranchesGone();

    /** Number of consecutive infeasible parents only recorded if node is infeasible*/
    inline int getSequenceOfInfeasiblesSize()
    {
      return sequenceOfInfeasiblesSize_;
    }
    /** Number of consecutive unsolved parents only recorded if node is infeasible*/
    inline int getSequenceOfUnsolvedSize()
    {
      return sequenceOfUnsolvedSize_;
    }
    /** Register all the options for class instance.*/
    static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);

  private:
    /* Data values */
    /** Number of consecutive infeasible parents only recorded if node is infeasible*/
    int sequenceOfInfeasiblesSize_;
    /** Number of consecutive unsolved parents only recorded if node is infeasible*/
    int sequenceOfUnsolvedSize_;
  private:

    /// Illegal Assignment operator
    BonCbcFullNodeInfo & operator=(const BonCbcFullNodeInfo& rhs);
  };

  /** \brief Holds information for recreating a subproblem by incremental change
  	   from the parent for

    A BonminCbcPartialNodeInfo object contains changes to the bounds and basis, and
    additional cuts, required to recreate a subproblem by modifying and
    augmenting the parent subproblem.
  */

  class BonCbcPartialNodeInfo : public CbcPartialNodeInfo
  {

  public:
    // Default Constructor
    BonCbcPartialNodeInfo ();

    // Constructor from current state
    BonCbcPartialNodeInfo (CbcModel * model, CbcNodeInfo * parent, CbcNode * owner,
        int numberChangedBounds,const int * variables,
        const double * boundChanges,
        const CoinWarmStartDiff *basisDiff) ;

    // Copy constructor
    BonCbcPartialNodeInfo ( const BonCbcPartialNodeInfo &);

    // Destructor
    ~BonCbcPartialNodeInfo ();

    /// Clone
    virtual CbcNodeInfo * clone() const;

    /**Method called when all direct sons have been explored to flush
       useless warm start information.*/
    virtual void allBranchesGone();

    /** Number of consecutive infeasible parents only recorded if node is infeasible*/
    inline int getSequenceOfInfeasiblesSize()
    {
      return sequenceOfInfeasiblesSize_;
    }
    /** Number of consecutive unsolved parents only recorded if node is infeasible*/
    inline int getSequenceOfUnsolvedSize()
    {
      return sequenceOfUnsolvedSize_;
    }
  private:
    /* Data values */
    /** Number of consecutive infeasible parents only recorded if node is infeasible*/
    int sequenceOfInfeasiblesSize_;
    /** Number of consecutive unsolved parents only recorded if node is infeasible*/
    int sequenceOfUnsolvedSize_;
  private:

    /// Illegal Assignment operator
    BonCbcPartialNodeInfo & operator=(const Bonmin::BonCbcPartialNodeInfo& rhs);
  };
}
#endif