OsiSolverBranch.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef OsiSolverBranch_H
4 #define OsiSolverBranch_H
5 
7 #include "CoinWarmStartBasis.hpp"
8 #include "CoinFinite.hpp"
9 
10 //#############################################################################
11 
18 
19 public:
21 
22 
23  void addBranch(int iColumn, double value);
24 
26  void addBranch(int way,int numberTighterLower, const int * whichLower, const double * newLower,
27  int numberTighterUpper, const int * whichUpper, const double * newUpper);
29  void addBranch(int way,int numberColumns,const double * oldLower, const double * newLower,
30  const double * oldUpper, const double * newUpper);
31 
33  void applyBounds(OsiSolverInterface & solver,int way) const;
35  bool feasibleOneWay(const OsiSolverInterface & solver) const;
37  inline const int * starts() const
38  { return start_;}
40  inline const int * which() const
41  { return indices_;}
43  inline const double * bounds() const
44  { return bound_;}
46 
47 
49 
50 
51  OsiSolverBranch();
52 
54  OsiSolverBranch(const OsiSolverBranch & rhs);
55 
58 
61 
63 
64 private:
66 
67 
68  int start_[5];
70  int * indices_;
72  double * bound_;
74 };
75 //#############################################################################
76 
83 
84 public:
86 
87 
88  void createResult(const OsiSolverInterface & solver,const double * lowerBefore,
89  const double * upperBefore);
90 
92  void restoreResult(OsiSolverInterface & solver) const;
93 
95  inline const CoinWarmStartBasis & basis() const
96  { return basis_;}
97 
99  inline double objectiveValue() const
100  { return objectiveValue_;}
101 
103  inline const double * primalSolution() const
104  { return primalSolution_;}
105 
107  inline const double * dualSolution() const
108  { return dualSolution_;}
109 
111  inline const OsiSolverBranch & fixed() const
112  { return fixed_;}
114 
115 
117 
118 
119  OsiSolverResult();
120 
122  OsiSolverResult(const OsiSolverInterface & solver,const double * lowerBefore,
123  const double * upperBefore);
124 
126  OsiSolverResult(const OsiSolverResult & rhs);
127 
130 
132  ~OsiSolverResult ();
133 
135 
136 private:
138 
139 
142  CoinWarmStartBasis basis_;
144  double * primalSolution_;
146  double * dualSolution_;
150 };
151 #endif