Linear programs. More...
#include <ogdf/lib/abacus/lp.h>
Public Types | |
enum | METHOD { Primal, Dual, BarrierAndCrossover, BarrierNoCrossover, Approximate } |
The solution method for the linear program. More... | |
enum | OPTSTAT { Optimal, Unoptimized, Error, Feasible, Infeasible, Unbounded, LimitReached } |
The optimization status of the linear program. More... | |
enum | SOLSTAT { Available, Missing } |
Describes if parts of the solution like x-values, reduced costs, etc. are available. More... | |
Public Member Functions | |
LP (Master *master) | |
Creates a linear program. More... | |
virtual | ~LP () |
The destructor. More... | |
void | addCols (ArrayBuffer< Column * > &newCols) |
Adds columns to the linear program. More... | |
void | addRows (ArrayBuffer< Row * > &newRows) |
Adds rows to the linear program. More... | |
virtual double | barXVal (int i) const |
SOLSTAT | barXValStatus () const |
SOLSTAT | basisStatus () const |
virtual void | changeLBound (int i, double newLb) |
Changes the lower bound of a single column. More... | |
void | changeRhs (Array< double > &newRhs) |
Changes the complete right hand side of the linear program. More... | |
virtual void | changeUBound (int i, double newUb) |
Changes the upper bound of a single column. More... | |
void | colRealloc (int newSize) |
Performs a reallocation of the column space of the linear program. More... | |
virtual int | getInfeas (int &infeasRow, int &infeasCol, double *bInvRow) const |
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. More... | |
int | getSimplexIterationLimit (int &limit) const |
virtual bool | infeasible () const |
void | initialize (OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row * > &rows) |
Loads the linear program defined by its arguments. More... | |
void | initialize (OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row * > &rows, Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat) |
This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments: More... | |
double | lBound (int i) const |
virtual void | loadBasis (Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat) |
Loads a new basis for the linear program. More... | |
ogdf::StopwatchCPU * | lpSolverTime () |
virtual LPVARSTAT::STATUS | lpVarStat (int i) const |
int | maxCol () const |
int | maxRow () const |
int | nCol () const |
int | nnz () const |
int | nOpt () const |
int | nRow () const |
double | obj (int i) const |
virtual OPTSTAT | optimize (METHOD method) |
Performs the optimization of the linear program. More... | |
virtual int | pivotSlackVariableIn (ArrayBuffer< int > &rows) |
Pivots the slack variables stored in the buffer rows into the basis. More... | |
virtual double | reco (int i) const |
SOLSTAT | recoStatus () const |
void | remCols (ArrayBuffer< int > &cols) |
Removes columns from the linear program. More... | |
void | remRows (ArrayBuffer< int > &ind) |
Removes rows of the linear program. More... | |
double | rhs (int i) const |
void | row (int i, Row &r) const |
void | rowRealloc (int newSize) |
Performs a reallocation of the row space of the linear program. More... | |
OptSense | sense () const |
void | sense (const OptSense &newSense) |
int | setSimplexIterationLimit (int limit) |
Changes the iteration limit of the Simplex algorithm. More... | |
virtual double | slack (int c) const |
virtual SlackStat::STATUS | slackStat (int i) const |
SOLSTAT | slackStatus () const |
double | uBound (int i) const |
virtual double | value () const |
int | writeBasisMatrix (const char *fileName) |
Writes the complete basis of an optimal linear program to a file. More... | |
virtual double | xVal (int i) const |
SOLSTAT | xValStatus () const |
virtual double | yVal (int c) const |
SOLSTAT | yValStatus () const |
Public Member Functions inherited from abacus::AbacusRoot | |
virtual | ~AbacusRoot () |
The destructor. More... | |
Protected Member Functions | |
virtual void | _addCols (ArrayBuffer< 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. More... | |
virtual void | _addRows (ArrayBuffer< 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. More... | |
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. More... | |
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. More... | |
virtual double | _barXVal (int i) const =0 |
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. More... | |
virtual void | _changeRhs (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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual int | _getInfeas (int &infeasRow, int &infeasCol, double *bInvRow) const =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. More... | |
virtual int | _getSimplexIterationLimit (int &limit) const =0 |
The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm. More... | |
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)=0 |
The pure virtual function _initialize() must be defined by the used LP-solver and should initialize the LP-solver with. More... | |
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. More... | |
virtual void | _loadBasis (Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)=0 |
This pure virtual function should load a basis into the LP-solver. More... | |
virtual LPVARSTAT::STATUS | _lpVarStat (int i) const =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. More... | |
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. More... | |
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. More... | |
virtual int | _nCol () const =0 |
The pure virtual function _nCol() must be defined by the used LP-solver and return the number of columns. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual int | _pivotSlackVariableIn (ArrayBuffer< int > &rows)=0 |
The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis. More... | |
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. More... | |
virtual double | _reco (int i) const =0 |
The pure virtual function _reco() must be defined by the used LP-solver and should return the reduced cost of variable i. More... | |
virtual void | _remCols (ArrayBuffer< 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. More... | |
virtual void | _remRows (ArrayBuffer< 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. More... | |
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. More... | |
virtual void | _row (int i, Row &r) const =0 |
The pure virtual function _row() must be defined by the used LP-solver and store the i-th row of the problem in the row r. More... | |
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. More... | |
virtual OptSense | _sense () const =0 |
The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the optimization. More... | |
virtual void | _sense (const OptSense &newSense)=0 |
virtual int | _setSimplexIterationLimit (int limit)=0 |
The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm. More... | |
virtual double | _slack (int i) const =0 |
The pure virtual function _slack() must be defined by the used LP-solver and should return the value of the slack variable i. More... | |
virtual SlackStat::STATUS | _slackStat (int i) const =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. More... | |
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. More... | |
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. More... | |
virtual double | _xVal (int i) const =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. More... | |
virtual double | _yVal (int i) const =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. More... | |
void | colRangeCheck (int i) const |
Terminates the program if there is no column with index i. More... | |
void | colsNnz (int nRow, Array< Row * > &rows, Array< int > &nnz) |
Computes the number of nonzero elements in each column of a given set of rows. More... | |
void | rowRangeCheck (int r) const |
Terminates the program if there is no row with index r. More... | |
void | rows2cols (int nRow, Array< Row * > &rows, Array< SparVec * > &cols) |
Computes the columnwise representation of the row matrix. More... | |
Protected Attributes | |
SOLSTAT | barXValStatus_ |
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. More... | |
ogdf::StopwatchCPU | lpSolverTime_ |
Master * | master_ |
A pointer to the corresponding master of the optimization. More... | |
int | nOpt_ |
The number of optimizations of the linear program. More... | |
OPTSTAT | optStat_ |
The status of the linear program. More... | |
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. More... | |
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. More... | |
SOLSTAT | xValStatus_ |
This member becomes Available if the \(x\)-values of the optimal solution can be accessed with the function xVal(), otherwise it has the value Missing. More... | |
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/. More... | |
Private Member Functions | |
LP (const LP &rhs) | |
void | initPostOpt () |
Resets the optimization status and the availability statuses of the solution. More... | |
const LP & | operator= (const LP &rhs) |
Friends | |
std::ostream & | operator<< (std::ostream &out, const 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. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from abacus::AbacusRoot | |
static bool | ascii2bool (const string &str) |
Converts the string str to a boolean value. More... | |
static bool | endsWith (const string &str, const string &end) |
Returns true if str ends with end, false otherwise. More... | |
static double | fracPart (double x) |
Returns the absolute value of the fractional part of x. More... | |
static const char * | onOff (bool value) |
Converts a boolean variable to the strings "on" and "off". More... | |
Linear programs.
The following section provides a generic interface class to linear programs, from which we will derive further classes both for the solution of LP-relaxations (LpSub) with a linear-programming based branch-and-bound algorithm and for interfaces to LP-solvers (OsiIF).
The framework should be very flexible in the use of different LP-solvers. Therefore, we implement in the class LP a very general interface to the linear program. All functions of the framework communicate with the linear program only by the public functions of the class LP.
The public functions call pure virtual functions starting with the prefix _, which have to be implemented in the derived class for each specific LP-solver.
Linear programs cannot only be used for solving the LP-relaxation within the branch-and-cut algorithm. There are also techniques in integer programming where linear programming is used for generating cutting planes and for applying heuristics. Therefore, we design the class LP that it can be used very generally.
enum abacus::LP::METHOD |
enum abacus::LP::OPTSTAT |
The optimization status of the linear program.
enum abacus::LP::SOLSTAT |
|
inline |
|
private |
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _approx() must be defined by the used LP-solver and should call the approximative method of the used LP-solver.
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm.
limit | Stores the value of the iteration limit if the function returns 0. |
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _lBound() must be defined by the used LP-solver and return the lower bound of variable i.
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal number of columns.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal number of rows.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _nCol() must be defined by the used LP-solver and return the number of columns.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
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.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows of the problem.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _obj() must be defined by the used LP-solver and return the objective function coefficient of variable i.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis.
rows | The numbers of the slack variables that should be pivoted in. |
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _reco() must be defined by the used LP-solver and should return the reduced cost of variable i.
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _rhs() must be defined by the used LP-solver and return the right hand side of constraint i.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _row() must be defined by the used LP-solver and store the i-th row of the problem in the row r.
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the optimization.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm.
limit | The new value of the iteration limit. |
Implemented in abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _slack() must be defined by the used LP-solver and should return the value of the slack variable i.
Implemented in abacus::OsiIF.
|
protectedpure 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 abacus::OsiIF.
|
protectedpure virtual |
The pure virtual function _uBound() must be defined by the used LP-solver and return the upper bound of variable i.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
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.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
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.
Implemented in abacus::OsiIF.
|
protectedpure virtual |
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.
Implemented in abacus::OsiIF.
void abacus::LP::addCols | ( | ArrayBuffer< 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 abacus::LP::addRows | ( | ArrayBuffer< 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. |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
|
virtual |
Changes the lower bound of a single column.
i | The column. |
newLb | The new lower bound of the column. |
Reimplemented in abacus::LpSub.
|
inline |
|
virtual |
Changes the upper bound of a single column.
i | The column. |
newUb | The new upper bound of the column. |
Reimplemented in abacus::LpSub.
|
protected |
Terminates the program if there is no column with index i.
i | The number of a column. |
|
inline |
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. |
|
inlinevirtual |
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.
If getInfeas() is successful, then either infeasRow or infeasVar is \(-1\) and the other argument holds the nonnegative number of the infeasible variable.
infeasRow | Holds after the execution the number of an infeasible slack variable, or \(-1\). |
infeasCol | Holds after the execution the number of an infeasible column, or \(-1\). |
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. |
Reimplemented in abacus::LpSub.
|
inline |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
|
inline |
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 ABACUS, 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().
Of course, it would be possible to provide an extra constructor with automatic initialization if required.
sense | The sense of the objective function. |
nRow | The number of rows. |
maxRow | The maximal number of rows. |
nCol | The number of columns (variables). |
maxCol | The maximal number of columns. |
obj | An array with the objective function coefficients. |
lBound | An array with the lower bounds of the columns. |
uBound | An array with the upper bounds of the columns. |
rows | An array storing the rows of the problem. |
|
inline |
This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments:
sense | The sense of the objective function. |
nRow | The number of rows. |
maxRow | The maximal number of rows. |
nCol | The number of columns (variables). |
maxCol | The maximal number of columns. |
obj | An array with the objective function coefficients. |
lBound | An array with the lower bounds of the columns. |
uBound | An array with the upper bounds of the columns. |
rows | An array storing the rows of the problem. |
lpVarStat | An array storing the status of the columns. |
slackStat | An array storing the status of the slack variables. |
|
inlineprivate |
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.
|
inlinevirtual |
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 abacus::LpSub.
|
inline |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
Performs the optimization of the linear program.
method | The method with which the optimization is performed. |
Reimplemented in abacus::LpSub.
|
virtual |
Pivots the slack variables stored in the buffer rows into the basis.
rows | The numbers of the slack variables that should be pivoted in. |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
|
inline |
|
inline |
|
protected |
Terminates the program if there is no row with index r.
r | The number of a row of the linear program. |
|
inline |
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(). |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
int abacus::LP::writeBasisMatrix | ( | const char * | fileName | ) |
Writes the complete basis of an optimal linear program to a file.
fileName | The name of the file the basis is written to. |
|
inlinevirtual |
Reimplemented in abacus::LpSub.
|
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. |
|
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.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |