Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
8 class OsiSolverInterface;
9 #include "CoinWarmStartBasis.hpp"
10
11 //#############################################################################
12
18 class OsiSolverBranch {
19
20 public:
22
23 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 OsiSolverBranch();
58
60 OsiSolverBranch(const OsiSolverBranch &rhs);
61
63 OsiSolverBranch &operator=(const OsiSolverBranch &rhs);
64
66 ~OsiSolverBranch();
67
69
70 private:
72
73 int start_[5];
76 int *indices_;
78 double *bound_;
80 };
81 //#############################################################################
82
88 class OsiSolverResult {
89
90 public:
92
93 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 OsiSolverResult();
135
137 OsiSolverResult(const OsiSolverInterface &solver, const double *lowerBefore,
138 const double *upperBefore);
139
141 OsiSolverResult(const OsiSolverResult &rhs);
142
144 OsiSolverResult &operator=(const OsiSolverResult &rhs);
145
147 ~OsiSolverResult();
148
150
151 private:
153
154 double objectiveValue_;
157 CoinWarmStartBasis basis_;
159 double *primalSolution_;
161 double *dualSolution_;
163 OsiSolverBranch fixed_;
165 };
166 #endif
167
168 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
169 */
OsiSolverBranch::indices_
int * indices_
Column numbers (if &gt;= numberColumns treat as rows)
Definition: OsiSolverBranch.hpp:76
OsiSolverBranch::addBranch
void addBranch(int iColumn, double value)
Add a simple branch (i.e. first sets ub of floor(value), second lb of ceil(value)) ...
OsiSolverBranch::~OsiSolverBranch
~OsiSolverBranch()
Destructor.
OsiSolverBranch::start_
int start_[5]
Start of lower first, upper first, lower second, upper second.
Definition: OsiSolverBranch.hpp:74
OsiSolverBranch::bounds
const double * bounds() const
Bounds.
Definition: OsiSolverBranch.hpp:48
OsiSolverResult
Solver Result Class.
Definition: OsiSolverBranch.hpp:88
OsiSolverResult::dualSolution
const double * dualSolution() const
Dual solution.
Definition: OsiSolverBranch.hpp:119
CoinWarmStartBasis
The default COIN simplex (basis-oriented) warm start class.
Definition: CoinWarmStartBasis.hpp:40
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
OsiSolverBranch::starts
const int * starts() const
Starts.
Definition: OsiSolverBranch.hpp:38
OsiSolverResult::objectiveValue
double objectiveValue() const
Objective value (as minimization)
Definition: OsiSolverBranch.hpp:107
OsiSolverResult::basis_
CoinWarmStartBasis basis_
Warm start information.
Definition: OsiSolverBranch.hpp:157
OsiSolverBranch::bound_
double * bound_
New bounds.
Definition: OsiSolverBranch.hpp:78
OsiSolverBranch::which
const int * which() const
Which variables.
Definition: OsiSolverBranch.hpp:43
OsiSolverResult::OsiSolverResult
OsiSolverResult()
Default Constructor.
OsiSolverResult::createResult
void createResult(const OsiSolverInterface &solver, const double *lowerBefore, const double *upperBefore)
Create result.
OsiSolverResult::fixed
const OsiSolverBranch & fixed() const
Extra fixed.
Definition: OsiSolverBranch.hpp:125
OsiSolverResult::restoreResult
void restoreResult(OsiSolverInterface &solver) const
Restore result.
OsiSolverResult::objectiveValue_
double objectiveValue_
Value of objective (if &gt;= OsiSolverInterface::getInfinity() then infeasible)
Definition: OsiSolverBranch.hpp:155
OsiSolverResult::primalSolution_
double * primalSolution_
Primal solution (numberColumns)
Definition: OsiSolverBranch.hpp:159
OsiSolverResult::operator=
OsiSolverResult & operator=(const OsiSolverResult &rhs)
Assignment operator.
OsiSolverResult::~OsiSolverResult
~OsiSolverResult()
Destructor.
OsiSolverResult::fixed_
OsiSolverBranch fixed_
Which extra variables have been fixed (only way==-1 counts)
Definition: OsiSolverBranch.hpp:163
OsiSolverBranch::OsiSolverBranch
OsiSolverBranch()
Default Constructor.
OsiSolverResult::basis
const CoinWarmStartBasis & basis() const
Get basis.
Definition: OsiSolverBranch.hpp:101
OsiSolverBranch::operator=
OsiSolverBranch & operator=(const OsiSolverBranch &rhs)
Assignment operator.
CoinWarmStartBasis.hpp
OsiSolverResult::primalSolution
const double * primalSolution() const
Primal solution.
Definition: OsiSolverBranch.hpp:113
OsiSolverBranch
Solver Branch Class.
Definition: OsiSolverBranch.hpp:18
OsiSolverBranch::feasibleOneWay
bool feasibleOneWay(const OsiSolverInterface &solver) const
Returns true if current solution satsifies one side of branch.
OsiSolverResult::dualSolution_
double * dualSolution_
Dual solution (numberRows)
Definition: OsiSolverBranch.hpp:161
OsiSolverBranch::applyBounds
void applyBounds(OsiSolverInterface &solver, int way) const
Apply bounds.