37 #include <coin/CoinPackedMatrix.hpp> 38 #include <coin/CoinPackedVector.hpp> 39 #include <coin/CoinWarmStartBasis.hpp> 40 #include <coin/CoinBuild.hpp> 132 void freeStatus(CoinWarmStartBasis::Status*&);
148 int nRow,
int maxRow,
149 int nCol,
int maxCol,
225 virtual double _rhs(
int i)
const override {
return rhs_[i]; }
231 virtual void _row(
int i,
Row &r)
const override;
237 virtual int _nnz()
const override {
return osiLP_->getNumElements(); }
273 virtual double _xVal(
int i)
const override {
return xVal_[i]; }
279 virtual double _barXVal(
int i)
const override;
285 virtual double _reco(
int i)
const override {
return reco_[i]; }
291 virtual double _slack(
int i)
const override;
297 virtual double _yVal(
int i)
const override {
return yVal_[i]; }
326 virtual int _getInfeas(
int &infeasRow,
int &infeasCol,
double *bInvRow)
const override;
418 void loadDummyRow(OsiSolverInterface* s2,
const double* lbounds,
const double* ubounds,
const double* objectives);
452 return(!osiLP_->setIntParam(OsiMaxNumIteration, limit));
462 return(!osiLP_->getIntParam(OsiMaxNumIteration, limit));
475 lower = upper = right;
486 lower = right - range;
virtual void _initialize(OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row *> &rows) override
Loads the linear program defined by the following arguments to the solver.
SlackStat::STATUS osi2slackStat(CoinWarmStartBasis::Status stat) const
Converts the OSI slack status to ABACUS format.
STATUS
The different statuses of a slack variable.
CSense::SENSE osi2csense(char sense) const
Converts the OSI representation of the row sense to the ABACUS representation.
char * cStat_
An array storing the statuses of the variables after the linear program has been optimized.
virtual int _nnz() const override
Returns the number of nonzero elements in the constraint matrix (not including the right hand side)...
virtual double _reco(int i) const override
Returns the reduced cost of the column i.
The parameterized class Array implements dynamic arrays of type E.
Representation of constraints in the row format.
The master of the optimization.
virtual double _lBound(int i) const override
Returns the lower bound of column i.
virtual void _remCols(ArrayBuffer< int > &vars) override
Removes the columns listed in vars.
OsiIF(Master *master)
Constructor without initialization.
virtual void _addRows(ArrayBuffer< Row *> &newRows) override
Adds the rows to the linear program.
virtual void _remRows(ArrayBuffer< int > &ind) override
Removes the rows listed in ind.
LpMasterOsi * lpMasterOsi_
void _colRealloc(int newSize) override
Reallocates the internal memory such that newSize columns can be stored.
virtual void _changeUBound(int i, double newUb) override
Sets the upper bound of column i to newLb.
SOLVERTYPE currentSolverType() const
void freeChar(const char *&ptr)
const OsiIF & operator=(const OsiIF &rhs)
void _rowRealloc(int newSize) override
Reallocates the internal memory such that newSize rows can be stored.
int numRows_
The number of rows currently used in the LP.
virtual int _getSimplexIterationLimit(int &limit) const override
Defines a pure virtual function of the base class LP.
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
CoinWarmStartBasis * ws_
A warm start object storing information about a basis of the linear program.
virtual int _maxCol() const override
Returns the maximal number of columns of the linear program.
virtual int _getInfeas(int &infeasRow, int &infeasCol, double *bInvRow) const override
Can be called if the last linear program has been solved with the dual simplex method and is infeasib...
virtual void _changeLBound(int i, double newLb) override
Sets the lower bound of column i to newLb.
void freeDouble(double *&ptr)
LPVARSTAT::STATUS osi2lpVarStat(CoinWarmStartBasis::Status stat) const
Converts the OSI variable status to ABACUS format.
virtual int _pivotSlackVariableIn(ArrayBuffer< int > &rows) override
Pivots the slack variables stored in the buffer rows into the basis.
virtual double _value() const override
Returns the optimum value of the linear program.
status of slack variables
OPTSTAT
The optimization status of the linear program.
virtual OPTSTAT _primalSimplex() override
Calls the primal simplex method.
void freeDouble(const double *&ptr)
double * rowactivity_
An array storing the row activity of the linear program.
char csense2osi(CSense *sense) const
Converts the ABACUS representation of the row sense to the Osi representation.
virtual int _nRow() const override
Returns the number of rows of the linear program.
double * reco_
An array storing the values of the reduced costs after the linear program has been optimized...
virtual SlackStat::STATUS slackStat(int i) const
virtual LPVARSTAT::STATUS lpVarStat(int i) const
const double * objcoeff_
An array storing the objective function coefficients of the linear program.
virtual double _obj(int i) const override
Returns the objective function coefficient of column i.
virtual double _yVal(int i) const override
Returns the value of the dual column of the row i.
void loadDummyRow(OsiSolverInterface *s2, const double *lbounds, const double *ubounds, const double *objectives)
Initializes the problem with a dummy row.
virtual LPVARSTAT::STATUS _lpVarStat(int i) const override
Returns the status of the column i.
SOLVERTYPE currentSolverType_
The type of the current solver interface.
OsiSolverInterface * getDefaultInterface()
Allocates an Open Solver Interface of type defaultOsiSolver.
double * xVal_
An array storing the values of the variables after the linear program has been optimized.
OsiSolverInterface * osiLP_
Pointer to the Osi solver interface.
CoinWarmStartBasis::Status slackStat2osi(SlackStat::STATUS stat) const
Converts the ABACUS slack status to OSI format.
OsiSolverInterface * switchInterfaces(SOLVERTYPE newMethod)
Switches between exact and approximate solvers.
virtual int _setSimplexIterationLimit(int limit) override
Changes the iteration limit of the Simplex algorithm.
CoinWarmStartBasis::Status lpVarStat2osi(LPVARSTAT::STATUS stat) const
Converts the ABACUS variable status to OSI format.
const char * rowsense_
An array storing the row senses of the linear program.
virtual ~OsiIF()
The destructor.
virtual double _slack(int i) const override
Returns the value of the slack column of the row i.
virtual OPTSTAT _dualSimplex() override
Calls the dual simplex method.
virtual OPTSTAT _barrier(bool doCrossover) override
Calls the barrier method.
void freeStatus(CoinWarmStartBasis::Status *&)
virtual OptSense _sense() const override
Returns the sense of the optimization.
virtual double _uBound(int i) const override
Returns the upper bound of column i.
virtual OPTSTAT _approx() override
Calls an approximate method.
virtual void _row(int i, Row &r) const override
Stores a copy of row i in r.
STATUS
The enumeration of the statuses a variable gets from the linear program solver.
void convertSenseToBound(double inf, const char sense, const double right, const double range, double &lower, double &upper) const
double uBound(int i) const
void getSol()
Extracts the solution.
virtual double _rhs(int i) const override
Returns the right hand side of row i.
int numCols_
The number of columns currently used in the LP.
double lBound(int i) const
double value_
The value of the optimal solution.
void freeChar(char *&ptr)
const double * rhs_
An array storing the right hand sides of the linear program.
const double * collower_
An array storing the column lower bounds of the linear program.
virtual int _maxRow() const override
Returns the maximal number of rows of the linear program.
virtual int _nCol() const override
Returns the number of columns of the linear program.
SOLVERTYPE
The enumeration of possible solver types.
double * yVal_
An array storing the values of the dual variables after the linear program has been optimized...
virtual double _barXVal(int i) const override
Returns the value of the column i.
char * rStat_
An array storing the statuses of the slack variables after the linear program has been optimized...
virtual void _addCols(ArrayBuffer< Column *> &newVars) override
Adds the columns newCols to the linear program.
OsiSolverInterface * osiLP()
virtual SlackStat::STATUS _slackStat(int i) const override
Returns the status of the slack column i.
const double * colupper_
An array storing the column upper bounds of the linear program.
virtual double _xVal(int i) const override
Returns the value of the column i.
virtual void _loadBasis(Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat) override
Loads a basis to the solver.
virtual void _changeRhs(Array< double > &newRhs) override
Sets the right hand side of the linear program to newRhs.