Osi 0.108.9
Loading...
Searching...
No Matches
OsiSolverBranch.hpp
Go to the documentation of this file.
1// Copyright (C) 2005, International Business Machines
2// Corporation and others. All Rights Reserved.
3// This code is licensed under the terms of the Eclipse Public License (EPL).
4
5#ifndef OsiSolverBranch_H
6#define OsiSolverBranch_H
7
9#include "CoinWarmStartBasis.hpp"
10
11//#############################################################################
12
19
20public:
22
23
24 void addBranch(int iColumn, double value);
25
27 void addBranch(int way, int numberTighterLower, const int *whichLower, const double *newLower,
28 int numberTighterUpper, const int *whichUpper, const double *newUpper);
30 void addBranch(int way, int numberColumns, const double *oldLower, const double *newLower,
31 const double *oldUpper, const double *newUpper);
32
34 void applyBounds(OsiSolverInterface &solver, int way) const;
36 bool feasibleOneWay(const OsiSolverInterface &solver) const;
38 inline const int *starts() const
39 {
40 return start_;
41 }
43 inline const int *which() const
44 {
45 return indices_;
46 }
48 inline const double *bounds() const
49 {
50 return bound_;
51 }
53
55
56
58
61
64
67
69
70private:
72
73
74 int start_[5];
78 double *bound_;
80};
81//#############################################################################
82
89
90public:
92
93
94 void createResult(const OsiSolverInterface &solver, const double *lowerBefore,
95 const double *upperBefore);
96
98 void restoreResult(OsiSolverInterface &solver) const;
99
101 inline const CoinWarmStartBasis &basis() const
102 {
103 return basis_;
104 }
105
107 inline double objectiveValue() const
108 {
109 return objectiveValue_;
110 }
111
113 inline const double *primalSolution() const
114 {
115 return primalSolution_;
116 }
117
119 inline const double *dualSolution() const
120 {
121 return dualSolution_;
122 }
123
125 inline const OsiSolverBranch &fixed() const
126 {
127 return fixed_;
128 }
130
132
133
135
137 OsiSolverResult(const OsiSolverInterface &solver, const double *lowerBefore,
138 const double *upperBefore);
139
142
145
148
150
151private:
153
154
157 CoinWarmStartBasis basis_;
165};
166#endif
167
168/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
169*/
Solver Branch Class.
const int * starts() const
Starts.
OsiSolverBranch(const OsiSolverBranch &rhs)
Copy constructor.
int start_[5]
Start of lower first, upper first, lower second, upper second.
OsiSolverBranch()
Default Constructor.
void addBranch(int way, int numberColumns, const double *oldLower, const double *newLower, const double *oldUpper, const double *newUpper)
Add bounds - way =-1 is first , +1 is second.
int * indices_
Column numbers (if >= numberColumns treat as rows)
const int * which() const
Which variables.
const double * bounds() const
Bounds.
OsiSolverBranch & operator=(const OsiSolverBranch &rhs)
Assignment operator.
void addBranch(int iColumn, double value)
Add a simple branch (i.e. first sets ub of floor(value), second lb of ceil(value))
bool feasibleOneWay(const OsiSolverInterface &solver) const
Returns true if current solution satsifies one side of branch.
double * bound_
New bounds.
~OsiSolverBranch()
Destructor.
void applyBounds(OsiSolverInterface &solver, int way) const
Apply bounds.
void addBranch(int way, int numberTighterLower, const int *whichLower, const double *newLower, int numberTighterUpper, const int *whichUpper, const double *newUpper)
Add bounds - way =-1 is first , +1 is second.
Abstract Base Class for describing an interface to a solver.
Solver Result Class.
OsiSolverResult(const OsiSolverResult &rhs)
Copy constructor.
const double * dualSolution() const
Dual solution.
OsiSolverResult(const OsiSolverInterface &solver, const double *lowerBefore, const double *upperBefore)
Constructor from solver.
~OsiSolverResult()
Destructor.
double objectiveValue_
Value of objective (if >= OsiSolverInterface::getInfinity() then infeasible)
CoinWarmStartBasis basis_
Warm start information.
void restoreResult(OsiSolverInterface &solver) const
Restore result.
OsiSolverResult & operator=(const OsiSolverResult &rhs)
Assignment operator.
double objectiveValue() const
Objective value (as minimization)
double * primalSolution_
Primal solution (numberColumns)
const double * primalSolution() const
Primal solution.
const CoinWarmStartBasis & basis() const
Get basis.
void createResult(const OsiSolverInterface &solver, const double *lowerBefore, const double *upperBefore)
Create result.
const OsiSolverBranch & fixed() const
Extra fixed.
OsiSolverBranch fixed_
Which extra variables have been fixed (only way==-1 counts)
OsiSolverResult()
Default Constructor.
double * dualSolution_
Dual solution (numberRows)