source: trunk/Clp/src/ClpNode.hpp @ 1163

Last change on this file since 1163 was 1163, checked in by forrest, 12 years ago

add ClpNode?

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1// Copyright (C) 2008, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpNode_H
4#define ClpNode_H
5
6#include "CoinPragma.hpp"
7
8// This implements all stuff for Clp fathom
9/** This contains what is in a Clp "node"
10   
11 */
12
13class ClpFactorization;
14class ClpDualRowSteepest;
15class ClpNodeStuff;
16class ClpNode {
17 
18public:
19  /**@name Useful methods */
20  //@{
21  /// Applies node to model
22  void applyNode(ClpSimplex * model, bool justBounds );
23  /// Fix on reduced costs
24  int fixOnReducedCosts(ClpSimplex * model);
25  //@}
26 
27  /**@name Gets and sets */
28  //@{
29  /// Initial value of integer variable
30  inline double branchingValue() const
31  { return branchingValue_;}
32  /** Way for integer variable -1 down , +1 up */
33  int way() const;
34  /// Return true if branch exhausted
35  bool fathomed() const;
36  /// Change state of variable i.e. go other way
37  void changeState();
38  /// Sequence number of integer variable (-1 if none)
39  inline int sequence() const
40  { return sequence_;}
41  //@}
42 
43  /**@name Constructors, destructor */
44  //@{
45  /** Default constructor. */
46  ClpNode();
47  /// Constructor from model
48  ClpNode (const ClpSimplex * model, const ClpNodeStuff * stuff);
49  /// Does work of constructor (partly so gdb will work)
50  void gutsOfConstructor(const ClpSimplex * model, const ClpNodeStuff * stuff);
51  /** Destructor */
52  virtual ~ClpNode();
53  //@}
54 
55  /**@name Copy methods (at present illegal - will abort) */
56  //@{
57  /** The copy constructor. */
58  ClpNode(const ClpNode&);
59  /// Operator =
60  ClpNode& operator=(const ClpNode&);
61  //@}
62 
63protected:
64// For state of branch
65typedef struct {
66  unsigned int firstBranch:1; //  nonzero if first branch on variable is up
67  unsigned int branch:2; //  0 means do first branch next, 1 second, 2 finished
68  unsigned int spare:29;
69} branchState;
70  /**@name Data */
71  //@{
72  /// Initial value of integer variable
73  double branchingValue_;
74  /// Factorization
75  ClpFactorization * factorization_;
76  /// Steepest edge weights
77  ClpDualRowSteepest * weights_;
78  /// Status vector
79  unsigned char * status_;
80  /// Primal solution
81  double * primalSolution_;
82  /// Dual solution
83  double * dualSolution_;
84  /// Pivot variables for factorization
85  int * pivotVariables_;
86  /// Variables fixed by reduced costs (at end of branch) 0x10000000 added if fixed to UB
87  int * fixed_;
88  /// State of branch
89  branchState branchState_;
90  /// Sequence number of integer variable (-1 if none)
91  int sequence_;
92  /// Number fixed by reduced cost
93  int numberFixed_;
94  //@}
95};
96class ClpNodeStuff {
97 
98public:
99  /**@name Constructors, destructor */
100  //@{
101  /** Default constructor. */
102  ClpNodeStuff();
103  /** Destructor */
104  virtual ~ClpNodeStuff();
105  //@}
106 
107  /**@name Copy methods (at present illegal - will abort) */
108  //@{
109  /** The copy constructor. */
110  ClpNodeStuff(const ClpNodeStuff&);
111  /// Operator =
112  ClpNodeStuff& operator=(const ClpNodeStuff&);
113  //@}
114 
115public:
116  /**@name Data */
117  //@{
118  /// Integer tolerance
119  double integerTolerance_;
120  /// Integer increment
121  double integerIncrement_;
122  //@}
123};
124#endif
Note: See TracBrowser for help on using the repository browser.