9#ifndef BonminTMINLP2OsiLP_H
10#define BonminTMINLP2OsiLP_H
46 void set_tols(
double tiny,
double very_tiny,
double rhs_relax,
double infty){
73 const double * x,
bool getObj) = 0;
82 const double * x,
bool getObj,
bool global)
const = 0;
88 inline bool cleanNnz(
double &value,
double colLower,
double colUpper,
89 double rowLower,
double rowUpper,
double colsol,
90 double & lb,
double &ub,
double tiny,
double veryTiny)
const;
121 double rowLower,
double rowUpper,
double colsol,
122 double & lb,
double &ub,
double tiny,
double veryTiny)
const
124 if(fabs(value)>= tiny)
return 1;
127 if(fabs(value)<veryTiny)
return 0;
131 bool colUpBounded = colUpper < 10000;
132 bool colLoBounded = colLower > -10000;
133 bool rowNotLoBounded = rowLower <= - infty;
134 bool rowNotUpBounded = rowUpper >= infty;
135 bool pos = value > 0;
137 if(colLoBounded && !pos && rowNotUpBounded) {
138 lb += value * (colsol - colLower);
142 if(colLoBounded && pos && rowNotLoBounded) {
143 ub += value * (colsol - colLower);
147 if(colUpBounded && pos && rowNotUpBounded) {
148 lb += value * (colsol - colUpper);
152 if(colUpBounded && !pos && rowNotLoBounded) {
153 ub += value * (colsol - colUpper);
A transformer class to build outer approximations i.e.
virtual void get_oas(OsiCuts &cs, const double *x, bool getObj, bool global) const =0
Get OAs of nonlinear constraints in x.
virtual void get_refined_oa(OsiCuts &cs) const =0
Get OAs of nonlinear constraints in x.
bool cleanNnz(double &value, double colLower, double colUpper, double rowLower, double rowUpper, double colsol, double &lb, double &ub, double tiny, double veryTiny) const
Facilitator to clean up coefficient.
virtual void extract(OsiSolverInterface *si, const double *x, bool getObj)=0
Build the Outer approximation of model_ in x and put it in si.
vector< int > iRow_
Rows of jacobian.
void set_model(Bonmin::TMINLP2TNLP *model)
TMINLP2OsiLP & operator=(const TMINLP2OsiLP &rhs)
Assignment operator.
TMINLP2OsiLP()
Default constructor.
virtual TMINLP2OsiLP * clone() const =0
virtual copy constructor
static int nTimesCalled
Count the number of linear outer approximations taken.
double tiny_
If constraint coefficient is below this, we try to remove it.
void initialize_jac_storage()
vector< int > jCol_
Cache Jacobian matrix.
~TMINLP2OsiLP()
Destructor.
void set_tols(double tiny, double very_tiny, double rhs_relax, double infty)
vector< double > value_
Values of jacobian.
double very_tiny_
If constraint coefficient is below this, we neglect it.
vector< Ipopt::TNLP::LinearityType > const_types_
double rhs_relax_
Amount by which to relax OA constraints RHSes.
Ipopt::SmartPtr< Bonmin::TMINLP2TNLP > model_
TMINLP2OsiLP(const TMINLP2OsiLP &other)
Copy constructor.
This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.
A small wrap around std::vector to give easy access to array for interfacing with fortran code.
(C) Copyright International Business Machines Corporation 2007