#include <lp.h>
Inheritance diagram for ABA_LP:
Public Types | |
enum | OPTSTAT { Optimal, Unoptimized, Error, Feasible, Infeasible, Unbounded } |
enum | SOLSTAT { Available, Missing } |
This enumeration describes if parts of the solution like ![]() | |
enum | METHOD { Primal, Dual, BarrierAndCrossover, BarrierNoCrossover, Approximate } |
Public Member Functions | |
ABA_LP (ABA_MASTER *master) | |
virtual | ~ABA_LP () |
The destructor. | |
void | initialize (ABA_OPTSENSE sense, int nRow, int maxRow, int nCol, int maxCol, ABA_ARRAY< double > &obj, ABA_ARRAY< double > &lBound, ABA_ARRAY< double > &uBound, ABA_ARRAY< ABA_ROW * > &rows) |
void | initialize (ABA_OPTSENSE sense, int nRow, int maxRow, int nCol, int maxCol, ABA_ARRAY< double > &obj, ABA_ARRAY< double > &lBound, ABA_ARRAY< double > &uBound, ABA_ARRAY< ABA_ROW * > &rows, ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat) |
This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments:. | |
virtual void | loadBasis (ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat) |
ABA_OPTSENSE | sense () const |
void | sense (const ABA_OPTSENSE &newSense) |
int | nRow () const |
int | maxRow () const |
int | nCol () const |
int | maxCol () const |
int | nnz () const |
double | obj (int i) const |
double | lBound (int i) const |
double | uBound (int i) const |
void | row (int i, ABA_ROW &r) const |
double | rhs (int i) const |
virtual double | value () const |
virtual double | xVal (int i) |
virtual double | barXVal (int i) |
virtual double | reco (int i) |
virtual double | yVal (int c) |
virtual double | slack (int c) |
SOLSTAT | xValStatus () const |
SOLSTAT | barXValStatus () const |
SOLSTAT | yValStatus () const |
SOLSTAT | recoStatus () const |
SOLSTAT | slackStatus () const |
SOLSTAT | basisStatus () const |
int | nOpt () const |
virtual bool | infeasible () const |
virtual int | getInfeas (int &infeasRow, int &infeasCol, double *bInvRow) |
Can be called if the last linear program has been solved with the dual simplex method and is infeasible and all inactive variables price out correctly. | |
virtual ABA_LPVARSTAT::STATUS | lpVarStat (int i) |
virtual ABA_SLACKSTAT::STATUS | slackStat (int i) |
virtual OPTSTAT | optimize (METHOD method) |
void | remRows (ABA_BUFFER< int > &ind) |
void | addRows (ABA_BUFFER< ABA_ROW * > &newRows) |
void | remCols (ABA_BUFFER< int > &cols) |
void | addCols (ABA_BUFFER< ABA_COLUMN * > &newCols) |
void | changeRhs (ABA_ARRAY< double > &newRhs) |
virtual void | changeLBound (int i, double newLb) |
virtual void | changeUBound (int i, double newUb) |
virtual int | pivotSlackVariableIn (ABA_BUFFER< int > &rows) |
void | rowRealloc (int newSize) |
void | colRealloc (int newSize) |
int | writeBasisMatrix (const char *fileName) |
Writes the complete basis of an optimal linear program to a file. | |
int | setSimplexIterationLimit (int limit) |
int | getSimplexIterationLimit (int &limit) |
ABA_CPUTIMER * | lpSolverTime () |
Protected Member Functions | |
void | colsNnz (int nRow, ABA_ARRAY< ABA_ROW * > &rows, ABA_ARRAY< int > &nnz) |
void | rows2cols (int nRow, ABA_ARRAY< ABA_ROW * > &rows, ABA_ARRAY< ABA_SPARVEC * > &cols) |
void | rowRangeCheck (int r) const |
void | colRangeCheck (int i) const |
virtual ABA_OPTSENSE | _sense () const=0 |
The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the optimization. | |
virtual void | _sense (const ABA_OPTSENSE &newSense)=0 |
virtual int | _nRow () const=0 |
The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows of the problem. | |
virtual int | _maxRow () const=0 |
The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal number of rows. | |
virtual int | _nCol () const=0 |
The pure virtual function _nCol() must be defined by the used LP-solver and return the number of columns. | |
virtual int | _maxCol () const=0 |
The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal number of columns. | |
virtual int | _nnz () const=0 |
The pure virtual function _nnz() must be defined by the used LP-solver and return the number of nonzero elements of the constraint matrix not including the right hand side and the bounds of the variables. | |
virtual double | _obj (int i) const=0 |
The pure virtual function _obj() must be defined by the used LP-solver and return the objective function coefficient of variable i. | |
virtual double | _lBound (int i) const=0 |
The pure virtual function _lBound() must be defined by the used LP-solver and return the lower bound of variable i. | |
virtual double | _uBound (int i) const=0 |
The pure virtual function _uBound() must be defined by the used LP-solver and return the upper bound of variable i. | |
virtual double | _rhs (int i) const=0 |
The pure virtual function _rhs() must be defined by the used LP-solver and return the right hand side of constraint i. | |
virtual void | _row (int i, ABA_ROW &r) const=0 |
virtual void | _initialize (ABA_OPTSENSE sense, int nRow, int maxRow, int nCol, int maxCol, ABA_ARRAY< double > &obj, ABA_ARRAY< double > &lBound, ABA_ARRAY< double > &uBound, ABA_ARRAY< ABA_ROW * > &rows)=0 |
The pure virtual function _initialize() must be defined by the used LP-solver and should initialize the LP-solver with. | |
virtual void | _loadBasis (ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat)=0 |
virtual OPTSTAT | _primalSimplex ()=0 |
The pure virtual function _primalSimplex() must be defined by the used LP-solver and should call the primal simplex method of the used LP-solver. | |
virtual OPTSTAT | _dualSimplex ()=0 |
The pure virtual function _dualSimplex() must be defined by the used LP-solver and should call the dual simplex method of the used LP-solver. | |
virtual OPTSTAT | _barrier (bool doCrossover)=0 |
The pure virtual function _barrier() must be defined by the used LP-solver and should call the barrier method of the used LP-solver. | |
virtual OPTSTAT | _approx ()=0 |
The pure virtual function _approx() must be defined by the used LP-solver and should call the approximative method of the used LP-solver. | |
virtual double | _value () const=0 |
The pure virtual function _value() must be defined by the used LP-solver and should return the optimum value of the linear program after it has been solved. | |
virtual double | _xVal (int i)=0 |
The pure virtual function _xVal() must be defined by the used LP-solver and should return the value of variable i in the LP-solution. | |
virtual double | _barXVal (int i)=0 |
virtual double | _reco (int i)=0 |
The pure virtual function _reco() must be defined by the used LP-solver and should return the reduced cost of variable i. | |
virtual double | _slack (int i)=0 |
The pure virtual function _slack() must be defined by the used LP-solver and should return the value of the slack variable i. | |
virtual double | _yVal (int i)=0 |
The pure virtual function _yVal() must be defined by the used LP-solver and should return the value of the dual variable of the constraint i. | |
virtual ABA_LPVARSTAT::STATUS | _lpVarStat (int i)=0 |
The pure virtual function _lpVarStat() must be defined by the used LP-solver and should return the status of the variable i in the LP-solution. | |
virtual ABA_SLACKSTAT::STATUS | _slackStat (int i)=0 |
The pure virtual function _slackStat() must be defined by the used LP-solver and should return the status of the slack variable i in the LP-solution. | |
virtual int | _getInfeas (int &infeasRow, int &infeasCol, double *bInvRow)=0 |
The pure virtual function _getInfeas() must be defined by the used LP-solver and can be called if the last linear program has been solved with the dual simplex method and is infeasible. | |
virtual void | _remRows (ABA_BUFFER< int > &ind)=0 |
The pure virtual function _remRows() must be defined by the used LP-solver and should remove the rows with numbers given in the buffer ind from the LP-solver. | |
virtual void | _addRows (ABA_BUFFER< ABA_ROW * > &newRows)=0 |
The pure virtual function _addRows() must be defined by the used LP-solver and should add the rows given in the buffer newRows to the LP. | |
virtual void | _remCols (ABA_BUFFER< int > &vars)=0 |
The pure virtual function _remCols() must be defined by the used LP-solver and should remove the columns with numbers given in vars from the LP. | |
virtual void | _addCols (ABA_BUFFER< ABA_COLUMN * > &newCols)=0 |
The pure virtual function _addCols() must be defined by the used LP-solver and should add the columns newCols to the LP. | |
virtual void | _changeRhs (ABA_ARRAY< double > &newRhs)=0 |
The pure virtual function _changeRhs() must be defined by the used LP-solver and should set the right hand side of the constraint matrix of the LP to newRhs. | |
virtual void | _changeLBound (int i, double newLb)=0 |
The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the lower bound of variable i to newLb. | |
virtual void | _changeUBound (int i, double newUb)=0 |
The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the upper bound of variable i to newUb. | |
virtual int | _pivotSlackVariableIn (ABA_BUFFER< int > &rows)=0 |
The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis. | |
virtual void | _rowRealloc (int newSize)=0 |
The pure virtual function _rowRealloc() must be defined in the used LP-solver and should reallocate its memory such that up to newSize rows can be handled. | |
virtual void | _colRealloc (int newSize)=0 |
The pure virtual function _colRealloc() must be defined by the used LP-solver and should reallocate its memory such that up to newSize columns can be handled. | |
virtual int | _setSimplexIterationLimit (int limit)=0 |
The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm. | |
virtual int | _getSimplexIterationLimit (int &limit)=0 |
The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm. | |
Protected Attributes | |
ABA_MASTER * | master_ |
OPTSTAT | optStat_ |
SOLSTAT | xValStatus_ |
This member becomes Available if the ![]() | |
SOLSTAT | barXValStatus_ |
SOLSTAT | yValStatus_ |
This member becomes Available if the values of the dual variables of the optimal solution can be accessed with the function yVal(), otherwise it has the value Missing/. | |
SOLSTAT | recoStatus_ |
This member becomes Available if the reduced costs of the optimal solution can be accessed with the function reco(), otherwise it has the value Missing. | |
SOLSTAT | slackStatus_ |
This member becomes Available if the values of the slack variables of the optimal solution can be accessed with the function slack(), otherwise it has the value Missing. | |
SOLSTAT | basisStatus_ |
This member becomes Available if the status of the variables and the slack variables of the optimal solution can be accessed with the functions lpVarStat() and slackStat(), otherwise it has the value Missing. | |
int | nOpt_ |
ABA_CPUTIMER | lpSolverTime_ |
Private Member Functions | |
void | initPostOpt () |
Resets the optimization status and the availability statuses of the solution. | |
ABA_LP (const ABA_LP &rhs) | |
const ABA_LP & | operator= (const ABA_LP &rhs) |
Friends | |
ostream & | operator<< (ostream &out, const ABA_LP &rhs) |
The output operator writes the objective function, followed by the constraints, the bounds on the columns and the solution values (if available) to an output stream. |
Definition at line 70 of file lp.h.
enum ABA_LP::OPTSTAT |
The optimization status of the linear program.
Unoptimized | Optimization is still required, this is also the case for reoptimization. | |
Optimized | The optimization has been performed, yet only a call to |()| can give us the status of optimization. | |
Error | An error has happened during optimization. | |
Optimal | The optimal solution has been computed. | |
Feasible | A primal feasible solution for the linear program, but not the optimal solution has been found. | |
Infeasible | The linear program is primal infeasible. | |
Unbounded | The linear program is unbounded. |
enum ABA_LP::SOLSTAT |
enum ABA_LP::METHOD |
The solution method for the linear program.
Primal | The primal simplex method. | |
Dual | The dual simplex method. | |
BarrierAndCrossover | The barrier method followed by a crossover to a basis. | |
BarrierNoCrossover | The barrier method without crossover. | |
Approximate | An approximative solver |
ABA_LP::ABA_LP | ( | ABA_MASTER * | master | ) |
The constructor.
master | A pointer to the corresponding master of the optimization. |
virtual ABA_LP::~ABA_LP | ( | ) | [virtual] |
The destructor.
ABA_LP::ABA_LP | ( | const ABA_LP & | rhs | ) | [private] |
void ABA_LP::initialize | ( | ABA_OPTSENSE | sense, | |
int | nRow, | |||
int | maxRow, | |||
int | nCol, | |||
int | maxCol, | |||
ABA_ARRAY< double > & | obj, | |||
ABA_ARRAY< double > & | lBound, | |||
ABA_ARRAY< double > & | uBound, | |||
ABA_ARRAY< ABA_ROW * > & | rows | |||
) |
Loads the linear program defined by its arguments.
We do not perform the initialization via arguments of a constructor, since for the most frequent application of linear programs within , the solution of the linear programming relaxations in the subproblems, the problem data is preprocessed before it is loaded. Only after the preprocessing in the constructor of the derived class, we can call initialize().
sense | The sense of the objective function. | |
nCol | The number of columns (variables). | |
maxCol | The maximal number of columns. | |
nRow | The number of rows. | |
maxRow | The maximal number of rows. | |
obj | An array with the objective function coefficients. | |
lb | An array with the lower bounds of the columns. | |
ub | An array with the upper bounds of the columns. | |
rows | An array storing the rows of the problem. |
Reimplemented in ABA_LPSUB.
void ABA_LP::initialize | ( | ABA_OPTSENSE | sense, | |
int | nRow, | |||
int | maxRow, | |||
int | nCol, | |||
int | maxCol, | |||
ABA_ARRAY< double > & | obj, | |||
ABA_ARRAY< double > & | lBound, | |||
ABA_ARRAY< double > & | uBound, | |||
ABA_ARRAY< ABA_ROW * > & | rows, | |||
ABA_ARRAY< ABA_LPVARSTAT::STATUS > & | lpVarStat, | |||
ABA_ARRAY< ABA_SLACKSTAT::STATUS > & | slackStat | |||
) |
This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments:.
lpVarStat | An array storing the status of the columns. | |
slackStat | An array storing the status of the slack variables. |
Reimplemented in ABA_LPSUB.
virtual void ABA_LP::loadBasis | ( | ABA_ARRAY< ABA_LPVARSTAT::STATUS > & | lpVarStat, | |
ABA_ARRAY< ABA_SLACKSTAT::STATUS > & | slackStat | |||
) | [virtual] |
Loads a new basis for the linear program.
lpVarStat | An array storing the status of the columns. | |
slackStat | An array storing the status of the slack variables. |
Reimplemented in ABA_LPSUB.
ABA_OPTSENSE ABA_LP::sense | ( | ) | const [inline] |
void ABA_LP::sense | ( | const ABA_OPTSENSE & | newSense | ) | [inline] |
int ABA_LP::nCol | ( | ) | const [inline] |
int ABA_LP::maxCol | ( | ) | const [inline] |
double ABA_LP::obj | ( | int | i | ) | const [inline] |
double ABA_LP::lBound | ( | int | i | ) | const [inline] |
double ABA_LP::uBound | ( | int | i | ) | const [inline] |
double ABA_LP::value | ( | ) | const [inline, virtual] |
double ABA_LP::xVal | ( | int | i | ) | [inline, virtual] |
double ABA_LP::barXVal | ( | int | i | ) | [inline, virtual] |
double ABA_LP::reco | ( | int | i | ) | [inline, virtual] |
ABA_LP::SOLSTAT ABA_LP::xValStatus | ( | ) | const [inline] |
ABA_LP::SOLSTAT ABA_LP::barXValStatus | ( | ) | const [inline] |
ABA_LP::SOLSTAT ABA_LP::yValStatus | ( | ) | const [inline] |
ABA_LP::SOLSTAT ABA_LP::recoStatus | ( | ) | const [inline] |
ABA_LP::SOLSTAT ABA_LP::slackStatus | ( | ) | const [inline] |
ABA_LP::SOLSTAT ABA_LP::basisStatus | ( | ) | const [inline] |
bool ABA_LP::infeasible | ( | ) | const [inline, virtual] |
virtual int ABA_LP::getInfeas | ( | int & | infeasRow, | |
int & | infeasCol, | |||
double * | bInvRow | |||
) | [virtual] |
Can be called if the last linear program has been solved with the dual simplex method and is infeasible and all inactive variables price out correctly.
Then, the basis is dual feasible, but primal infeasible, i.e., some variables or slack variables violate their bounds. In this case the function getInfeas() determines an infeasible variable or slack variable.
1 otherwise.
infeasRow | Holds after the execution the number of an infeasible slack variable, or ![]() | |
infeasVar | Holds after the execution the number of an infeasible column, or ![]() | |
bInvRow | Holds after the execution the row of the basis inverse corresponding to the infeasible column or slack variable, which is always a basic variable. If getInfeas() is successful, then either infeasRow or infeasVar is ![]() |
Reimplemented in ABA_LPSUB.
ABA_LPVARSTAT::STATUS ABA_LP::lpVarStat | ( | int | i | ) | [inline, virtual] |
ABA_SLACKSTAT::STATUS ABA_LP::slackStat | ( | int | i | ) | [inline, virtual] |
Performs the optimization of the linear program.
method | The method with which the optimization is performed. |
Reimplemented in ABA_LPSUB.
void ABA_LP::remRows | ( | ABA_BUFFER< int > & | ind | ) |
Removes rows of the linear program.
ind | The numbers of the rows that should be removed. |
void ABA_LP::addRows | ( | ABA_BUFFER< ABA_ROW * > & | newRows | ) |
Adds rows to the linear program.
If the new number of rows exceeds the maximal number of rows a reallocation is performed.
newRows | The rows that should be added to the linear program. |
void ABA_LP::remCols | ( | ABA_BUFFER< int > & | cols | ) |
Removes columns from the linear program.
cols | The numbers of the columns that should be removed. |
void ABA_LP::addCols | ( | ABA_BUFFER< ABA_COLUMN * > & | newCols | ) |
Adds columns to the linear program.
If the new number of columns exceeds the maximal number of columns a reallocation is performed.
newCols | The new columns that are added. |
void ABA_LP::changeRhs | ( | ABA_ARRAY< double > & | newRhs | ) |
Changes the complete right hand side of the linear program.
newRhs | The new right hand side of the rows. |
virtual void ABA_LP::changeLBound | ( | int | i, | |
double | newLb | |||
) | [virtual] |
Changes the lower bound of a single column.
i | The column. | |
newLb | The new lower bound of the column. |
Reimplemented in ABA_LPSUB.
virtual void ABA_LP::changeUBound | ( | int | i, | |
double | newUb | |||
) | [virtual] |
Changes the upper bound of a single column.
i | The column. | |
newUb | The new upper bound of the column. |
Reimplemented in ABA_LPSUB.
virtual int ABA_LP::pivotSlackVariableIn | ( | ABA_BUFFER< int > & | rows | ) | [virtual] |
Pivots the slack variables stored in the buffer rows into the basis.
1 otherwise.
rows | The numbers of the slack variables that should be pivoted in. |
void ABA_LP::rowRealloc | ( | int | newSize | ) |
Performs a reallocation of the row space of the linear program.
newSize | The new maximal number of rows of the linear program. |
Reimplemented in ABA_LPSUB.
void ABA_LP::colRealloc | ( | int | newSize | ) |
Performs a reallocation of the column space of the linear program.
newSize | The new maximal number of columns of the linear program. |
Reimplemented in ABA_LPSUB.
int ABA_LP::writeBasisMatrix | ( | const char * | fileName | ) |
Writes the complete basis of an optimal linear program to a file.
1 otherwise.
fileName | The name of the file the basis is written to. |
int ABA_LP::setSimplexIterationLimit | ( | int | limit | ) |
Changes the iteration limit of the Simplex algorithm.
1 otherwise.
limit | The new value of the iteration limit. |
int ABA_LP::getSimplexIterationLimit | ( | int & | limit | ) |
1 otherwise.
limit | Stores the iteration limit if the return value is 0. |
ABA_CPUTIMER* ABA_LP::lpSolverTime | ( | ) | [inline] |
void ABA_LP::colsNnz | ( | int | nRow, | |
ABA_ARRAY< ABA_ROW * > & | rows, | |||
ABA_ARRAY< int > & | nnz | |||
) | [protected] |
Computes the number of nonzero elements in each column of a given set of rows.
nRow | The number of rows. | |
rows | The array storing the rows. | |
nnz | An array of length at least the number of columns of the linear program which will hold the number of nonzero elements of each column. |
void ABA_LP::rows2cols | ( | int | nRow, | |
ABA_ARRAY< ABA_ROW * > & | rows, | |||
ABA_ARRAY< ABA_SPARVEC * > & | cols | |||
) | [protected] |
Computes the columnwise representation of the row matrix.
nRow | The number of rows. | |
rows | The array storing the rows. | |
cols | An array holding pointers to sparse vectors which will contain the columnwise representation of the constraint matrix defined by rows. The length of this array must be at least the number of columns. The elements of the array must not be 0-pointers. Sparse vectors of sufficient length should be allocated before the function is called. The size of these sparse vectors can be determined with the function colsNnz(). |
void ABA_LP::rowRangeCheck | ( | int | r | ) | const [protected] |
Terminates the program if there is no row with index r.
r | The number of a row of the linear program. |
void ABA_LP::colRangeCheck | ( | int | i | ) | const [protected] |
Terminates the program if there is no column with index i.
i | The number of a column. |
virtual ABA_OPTSENSE ABA_LP::_sense | ( | ) | const [protected, pure virtual] |
virtual void ABA_LP::_sense | ( | const ABA_OPTSENSE & | newSense | ) | [protected, pure virtual] |
Implemented in ABA_OSIIF.
virtual int ABA_LP::_nRow | ( | ) | const [protected, pure virtual] |
virtual int ABA_LP::_maxRow | ( | ) | const [protected, pure virtual] |
virtual int ABA_LP::_nCol | ( | ) | const [protected, pure virtual] |
virtual int ABA_LP::_maxCol | ( | ) | const [protected, pure virtual] |
virtual int ABA_LP::_nnz | ( | ) | const [protected, pure virtual] |
virtual double ABA_LP::_obj | ( | int | i | ) | const [protected, pure virtual] |
virtual double ABA_LP::_lBound | ( | int | i | ) | const [protected, pure virtual] |
virtual double ABA_LP::_uBound | ( | int | i | ) | const [protected, pure virtual] |
virtual double ABA_LP::_rhs | ( | int | i | ) | const [protected, pure virtual] |
virtual void ABA_LP::_row | ( | int | i, | |
ABA_ROW & | r | |||
) | const [protected, pure virtual] |
virtual void ABA_LP::_initialize | ( | ABA_OPTSENSE | sense, | |
int | nRow, | |||
int | maxRow, | |||
int | nCol, | |||
int | maxCol, | |||
ABA_ARRAY< double > & | obj, | |||
ABA_ARRAY< double > & | lBound, | |||
ABA_ARRAY< double > & | uBound, | |||
ABA_ARRAY< ABA_ROW * > & | rows | |||
) | [protected, pure virtual] |
The pure virtual function _initialize() must be defined by the used LP-solver and should initialize the LP-solver with.
sense | The sense of the optimization. | |
nRow | The number of rows. | |
maxRow | The maximal number of rows. | |
nCol | The number of columns. | |
maxCol | The maximal number of columns. | |
obj | An array with the objective functions coefficients. | |
lBound | An array with the lower bounds of the variables. | |
uBound | An array with the upper bounds of the variables. | |
rows | An array storing the constraint matrix in row format. |
Implemented in ABA_OSIIF.
virtual void ABA_LP::_loadBasis | ( | ABA_ARRAY< ABA_LPVARSTAT::STATUS > & | lpVarStat, | |
ABA_ARRAY< ABA_SLACKSTAT::STATUS > & | slackStat | |||
) | [protected, pure virtual] |
This pure virtual function should load a basis into the LP-solver.
lpVarStat | An array storing the status of the variables. | |
slackStat | An array storing the status of the slack variables. |
Implemented in ABA_OSIIF.
virtual OPTSTAT ABA_LP::_primalSimplex | ( | ) | [protected, pure virtual] |
The pure virtual function _primalSimplex() must be defined by the used LP-solver and should call the primal simplex method of the used LP-solver.
Implemented in ABA_OSIIF.
virtual OPTSTAT ABA_LP::_dualSimplex | ( | ) | [protected, pure virtual] |
The pure virtual function _dualSimplex() must be defined by the used LP-solver and should call the dual simplex method of the used LP-solver.
Implemented in ABA_OSIIF.
virtual OPTSTAT ABA_LP::_barrier | ( | bool | doCrossover | ) | [protected, pure virtual] |
The pure virtual function _barrier() must be defined by the used LP-solver and should call the barrier method of the used LP-solver.
Implemented in ABA_OSIIF.
virtual OPTSTAT ABA_LP::_approx | ( | ) | [protected, pure virtual] |
virtual double ABA_LP::_value | ( | ) | const [protected, pure virtual] |
virtual double ABA_LP::_xVal | ( | int | i | ) | [protected, pure virtual] |
virtual double ABA_LP::_barXVal | ( | int | i | ) | [protected, pure virtual] |
Implemented in ABA_OSIIF.
virtual double ABA_LP::_reco | ( | int | i | ) | [protected, pure virtual] |
virtual double ABA_LP::_slack | ( | int | i | ) | [protected, pure virtual] |
virtual double ABA_LP::_yVal | ( | int | i | ) | [protected, pure virtual] |
virtual ABA_LPVARSTAT::STATUS ABA_LP::_lpVarStat | ( | int | i | ) | [protected, pure virtual] |
The pure virtual function _lpVarStat() must be defined by the used LP-solver and should return the status of the variable i in the LP-solution.
Implemented in ABA_OSIIF.
virtual ABA_SLACKSTAT::STATUS ABA_LP::_slackStat | ( | int | i | ) | [protected, pure virtual] |
The pure virtual function _slackStat() must be defined by the used LP-solver and should return the status of the slack variable i in the LP-solution.
Implemented in ABA_OSIIF.
virtual int ABA_LP::_getInfeas | ( | int & | infeasRow, | |
int & | infeasCol, | |||
double * | bInvRow | |||
) | [protected, pure virtual] |
The pure virtual function _getInfeas() must be defined by the used LP-solver and can be called if the last linear program has been solved with the dual simplex method and is infeasible.
In this case it should compute the infeasible basic variable or constraint and the corresponding row bInvRow of the basis inverse. Either infeasRow or infeasCol is nonnegative. The nonnegative argument is an infeasible row or column, respectively.
1 otherwise.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_remRows | ( | ABA_BUFFER< int > & | ind | ) | [protected, pure virtual] |
The pure virtual function _remRows() must be defined by the used LP-solver and should remove the rows with numbers given in the buffer ind from the LP-solver.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_addRows | ( | ABA_BUFFER< ABA_ROW * > & | newRows | ) | [protected, pure virtual] |
The pure virtual function _addRows() must be defined by the used LP-solver and should add the rows given in the buffer newRows to the LP.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_remCols | ( | ABA_BUFFER< int > & | vars | ) | [protected, pure virtual] |
The pure virtual function _remCols() must be defined by the used LP-solver and should remove the columns with numbers given in vars from the LP.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_addCols | ( | ABA_BUFFER< ABA_COLUMN * > & | newCols | ) | [protected, pure virtual] |
The pure virtual function _addCols() must be defined by the used LP-solver and should add the columns newCols to the LP.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_changeRhs | ( | ABA_ARRAY< double > & | newRhs | ) | [protected, pure virtual] |
The pure virtual function _changeRhs() must be defined by the used LP-solver and should set the right hand side of the constraint matrix of the LP to newRhs.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_changeLBound | ( | int | i, | |
double | newLb | |||
) | [protected, pure virtual] |
The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the lower bound of variable i to newLb.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_changeUBound | ( | int | i, | |
double | newUb | |||
) | [protected, pure virtual] |
The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the upper bound of variable i to newUb.
Implemented in ABA_OSIIF.
virtual int ABA_LP::_pivotSlackVariableIn | ( | ABA_BUFFER< int > & | rows | ) | [protected, pure virtual] |
The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis.
1 otherwise.
rows | The numbers of the slack variables that should be pivoted in. |
Implemented in ABA_OSIIF.
virtual void ABA_LP::_rowRealloc | ( | int | newSize | ) | [protected, pure virtual] |
The pure virtual function _rowRealloc() must be defined in the used LP-solver and should reallocate its memory such that up to newSize rows can be handled.
Implemented in ABA_OSIIF.
virtual void ABA_LP::_colRealloc | ( | int | newSize | ) | [protected, pure virtual] |
The pure virtual function _colRealloc() must be defined by the used LP-solver and should reallocate its memory such that up to newSize columns can be handled.
Implemented in ABA_OSIIF.
virtual int ABA_LP::_setSimplexIterationLimit | ( | int | limit | ) | [protected, pure virtual] |
The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm.
1 otherwise.
limit | The new value of the iteration limit. |
Implemented in ABA_OSIIF.
virtual int ABA_LP::_getSimplexIterationLimit | ( | int & | limit | ) | [protected, pure virtual] |
The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm.
1 otherwise.
limit | Stores the value of the iteration limit if the function returns 0. |
Implemented in ABA_OSIIF.
void ABA_LP::initPostOpt | ( | ) | [private] |
Resets the optimization status and the availability statuses of the solution.
The function initPostOpt() must be called after each modification of the linear program. It resets the optimization status and the availability status of the solution.
ostream& operator<< | ( | ostream & | out, | |
const ABA_LP & | rhs | |||
) | [friend] |
The output operator writes the objective function, followed by the constraints, the bounds on the columns and the solution values (if available) to an output stream.
Every ten output columns we perform a line break for better readability. This has also the advantage that LP-solvers with an input function requiring a limited length of a line (e.g., Cplex 255 characters) have a higher chance to read a file generated by this output operator.
out | The output stream. | |
rhs | The linear program being output. |
ABA_MASTER* ABA_LP::master_ [protected] |
OPTSTAT ABA_LP::optStat_ [protected] |
SOLSTAT ABA_LP::xValStatus_ [protected] |
SOLSTAT ABA_LP::barXValStatus_ [protected] |
SOLSTAT ABA_LP::yValStatus_ [protected] |
SOLSTAT ABA_LP::recoStatus_ [protected] |
SOLSTAT ABA_LP::slackStatus_ [protected] |
SOLSTAT ABA_LP::basisStatus_ [protected] |
This member becomes Available if the status of the variables and the slack variables of the optimal solution can be accessed with the functions lpVarStat() and slackStat(), otherwise it has the value Missing.
int ABA_LP::nOpt_ [protected] |
ABA_CPUTIMER ABA_LP::lpSolverTime_ [protected] |