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