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