Bonmin
1.8.9
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Interfaces
BonAuxInfos.hpp
Go to the documentation of this file.
1
// (C) Copyright International Business Machines Corporation 2007
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// Authors :
6
// Pierre Bonami, International Business Machines Corporation
7
//
8
// Date : 04/23/2007
9
10
#ifndef BonAuxInfos_H
11
#define BonAuxInfos_H
12
#include <cstdlib>
13
#include <vector>
14
#include "
OsiAuxInfo.hpp
"
15
#include "
CoinSmartPtr.hpp
"
16
#include "
BonTypes.hpp
"
17
18
19
namespace
Bonmin
{
20
21
23
class
AuxInfo
:
public
OsiBabSolver
{
24
public
:
26
AuxInfo
(
int
type
);
27
29
AuxInfo
(
const
OsiBabSolver
&other);
30
32
AuxInfo
(
const
AuxInfo
&other);
33
35
virtual
~AuxInfo
();
36
38
virtual
OsiAuxInfo
*
clone
()
const
;
39
41
void
setFeasibleNode
(){
42
infeasibleNode_
=
false
;}
43
45
void
setInfeasibleNode
(){
46
infeasibleNode_
=
true
;}
47
49
bool
infeasibleNode
(){
50
return
infeasibleNode_
;}
51
53
const
double
*
nlpSolution
(){
54
55
if
(
hasNlpSolution_
)
56
return
nlpSolution_
;
57
else
58
return
NULL;
59
}
60
62
double
nlpObjValue
();
63
65
void
setNlpSolution
(
const
double
* sol,
int
numcols,
double
objValue);
66
68
void
setHasNlpSolution
(
bool
b){
69
hasNlpSolution_
= b;}
70
71
const
std::vector<double>&
bestSolution2
()
const
72
{
73
return
(*
bestSolution2_
)();
74
}
75
77
double
bestObj2
()
const
78
{
79
return
(*
bestObj2_
)();
80
}
81
82
void
setBestObj2
(
double
o)
83
{
84
(*bestObj2_)() = o;
85
}
86
void
setBestSolution2
(
int
n,
double
* d)
87
{
88
(*bestSolution2_)().clear();
89
(*bestSolution2_)().insert((*
bestSolution2_
)().end(),d, d+n);
90
}
91
protected
:
93
bool
infeasibleNode_
;
95
double
objValue_
;
97
double
*
nlpSolution_
;
99
int
numcols_
;
101
bool
hasNlpSolution_
;
103
Coin::SmartPtr< SimpleReferenced<std::vector<double>
> >
bestSolution2_
;
105
Coin::SmartPtr< SimpleReferenced<double>
>
bestObj2_
;
106
};
107
}
/* End namespace.*/
108
109
#endif
110
BonTypes.hpp
type
CoinParamType type() const
CoinSmartPtr.hpp
OsiAuxInfo.hpp
Bonmin::AuxInfo::bestSolution2
const std::vector< double > & bestSolution2() const
get the best solution computed with alternative objective function.
Definition
BonAuxInfos.hpp:71
Bonmin::AuxInfo::setNlpSolution
void setNlpSolution(const double *sol, int numcols, double objValue)
Pass a solution found by an nlp solver.
Bonmin::AuxInfo::bestObj2_
Coin::SmartPtr< SimpleReferenced< double > > bestObj2_
Alternate solution objective value.
Definition
BonAuxInfos.hpp:105
Bonmin::AuxInfo::bestObj2
double bestObj2() const
return objective value of the best solution computed with alternative objective function.
Definition
BonAuxInfos.hpp:77
Bonmin::AuxInfo::~AuxInfo
virtual ~AuxInfo()
Destructor.
Bonmin::AuxInfo::setHasNlpSolution
void setHasNlpSolution(bool b)
Say if has an nlp solution.
Definition
BonAuxInfos.hpp:68
Bonmin::AuxInfo::setInfeasibleNode
void setInfeasibleNode()
Declare the node to be infeasible.
Definition
BonAuxInfos.hpp:45
Bonmin::AuxInfo::setFeasibleNode
void setFeasibleNode()
Declare the node to be feasible.
Definition
BonAuxInfos.hpp:41
Bonmin::AuxInfo::AuxInfo
AuxInfo(int type)
Default constructor.
Bonmin::AuxInfo::nlpSolution_
double * nlpSolution_
nlp solution found by heuristic if any.
Definition
BonAuxInfos.hpp:97
Bonmin::AuxInfo::objValue_
double objValue_
value of the objective function of this nlp solution
Definition
BonAuxInfos.hpp:95
Bonmin::AuxInfo::clone
virtual OsiAuxInfo * clone() const
Virtual copy constructor.
Bonmin::AuxInfo::infeasibleNode_
bool infeasibleNode_
Say if current node was found infeasible during cut generation.
Definition
BonAuxInfos.hpp:93
Bonmin::AuxInfo::setBestObj2
void setBestObj2(double o)
Set an alternate objective value.
Definition
BonAuxInfos.hpp:82
Bonmin::AuxInfo::setBestSolution2
void setBestSolution2(int n, double *d)
Definition
BonAuxInfos.hpp:86
Bonmin::AuxInfo::AuxInfo
AuxInfo(const AuxInfo &other)
Copy constructor.
Bonmin::AuxInfo::bestSolution2_
Coin::SmartPtr< SimpleReferenced< std::vector< double > > > bestSolution2_
Stores the solution with alternate objective.
Definition
BonAuxInfos.hpp:103
Bonmin::AuxInfo::AuxInfo
AuxInfo(const OsiBabSolver &other)
Constructor from OsiBabSolver.
Bonmin::AuxInfo::nlpObjValue
double nlpObjValue()
Get objective value of nlp solution found, or +infinity if none exists.
Bonmin::AuxInfo::nlpSolution
const double * nlpSolution()
Get solution found by nlp solver (or NULL if none found).
Definition
BonAuxInfos.hpp:53
Bonmin::AuxInfo::hasNlpSolution_
bool hasNlpSolution_
say if has a solution.
Definition
BonAuxInfos.hpp:101
Bonmin::AuxInfo::infeasibleNode
bool infeasibleNode()
Say if current node is found feasible by cut generators.
Definition
BonAuxInfos.hpp:49
Bonmin::AuxInfo::numcols_
int numcols_
numcols_ gives the size of nlpSolution_.
Definition
BonAuxInfos.hpp:99
Coin::SmartPtr
OsiAuxInfo::OsiAuxInfo
OsiAuxInfo(void *appData=NULL)
OsiBabSolver::OsiBabSolver
OsiBabSolver(int solverType=0)
Bonmin
(C) Copyright International Business Machines Corporation 2007
Definition
BonAmplSetup.hpp:16
Generated by
1.17.0