9#ifndef BonminOuterApprox_H
10#define BonminOuterApprox_H
15 class OsiTMINLPInterface;
34 veryTiny_(other.veryTiny_){
42 veryTiny_ = rhs.veryTiny_;}
55 const double * x,
bool getObj);
59 const double * x,
bool getObj){
64 inline bool cleanNnz(
double &value,
double colLower,
double colUpper,
65 double rowLower,
double rowUpper,
double colsol,
66 double & lb,
double &ub,
double tiny,
double veryTiny);
72 static int nTimesCalled;
78OuterApprox::cleanNnz(
double &value,
double colLower,
double colUpper,
79 double rowLower,
double rowUpper,
double colsol,
80 double & lb,
double &ub,
double tiny,
double veryTiny)
82 if(fabs(value)>= tiny)
return 1;
84 if(fabs(value)<veryTiny)
return 0;
88 bool colUpBounded = colUpper < 10000;
89 bool colLoBounded = colLower > -10000;
90 bool rowNotLoBounded = rowLower <= - infty;
91 bool rowNotUpBounded = rowUpper >= infty;
94 if(colLoBounded && pos && rowNotUpBounded) {
95 lb += value * (colsol - colLower);
99 if(colLoBounded && !pos && rowNotLoBounded) {
100 ub += value * (colsol - colLower);
104 if(colUpBounded && !pos && rowNotUpBounded) {
105 lb += value * (colsol - colUpper);
109 if(colUpBounded && pos && rowNotLoBounded) {
110 ub += value * (colsol - colUpper);
114 if(pos) value = tiny;
A class to have all elements necessary to setup a branch-and-bound.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
A class to build outer approximations.
OuterApprox & operator=(const OuterApprox &rhs)
Assignment operator.
void extractLinearRelaxation(Bonmin::OsiTMINLPInterface &minlp, OsiSolverInterface *si, const double *x, bool getObj)
Build the Outer approximation in minlp and put it in si.
OuterApprox(const OuterApprox &other)
Copy constructor.
~OuterApprox()
Destructor.
void initialize(Bonmin::BabSetupBase &b)
Initialize using options.
OuterApprox()
Default constructor.
void operator()(Bonmin::OsiTMINLPInterface &minlp, OsiSolverInterface *si, const double *x, bool getObj)
Operator() calls extractLinearRelaxation.
(C) Copyright International Business Machines Corporation 2007