107 optStat_(Unoptimized),
108 xValStatus_(Missing),
109 barXValStatus_(Missing),
110 yValStatus_(Missing),
111 recoStatus_(Missing),
112 slackStatus_(Missing),
113 basisStatus_(Missing),
170 _initialize(sense, nRow, maxRow, nCol, maxCol, obj, lBound, uBound,
rows);
191 int nRow,
int maxRow,
192 int nCol,
int maxCol,
199 _initialize(sense, nRow, maxRow, nCol, maxCol, obj, lBound, uBound,
rows);
200 loadBasis(lpVarStat,slackStat);
212 _loadBasis(lpVarStat,slackStat);
219 int nRow()
const {
return _nRow(); }
223 int nCol()
const {
return _nCol(); }
227 int nnz()
const {
return _nnz(); }
264 virtual double value()
const {
return _value(); }
266 virtual double xVal(
int i)
const {
280 virtual double reco(
int i)
const {
287 virtual double yVal(
int c)
const {
313 int nOpt()
const {
return nOpt_; }
316 return ( optStat_ == Infeasible );
354 return _lpVarStat(i);
361 return _slackStat(i);
476 return _setSimplexIterationLimit(
limit);
486 return _getSimplexIterationLimit(
limit);
569 virtual double _obj(
int i)
const = 0;
584 virtual double _rhs(
int i)
const = 0;
605 int nCol,
int maxCol,
651 virtual double _xVal(
int i)
const = 0;
657 virtual double _reco(
int i)
const = 0;
668 virtual double _yVal(
int i)
const = 0;
842 optStat_= Unoptimized;
843 xValStatus_= barXValStatus_= recoStatus_= Missing;
844 slackStatus_= yValStatus_= basisStatus_= Missing;
888inline double LP::obj(
int i)
const
912inline void LP::row(
int i, Row &
r)
const
920inline double LP::rhs(
int i)
const
Declaration of stopwatch classes.
Base class of all other classes of ABACUS.
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...
void row(int i, Row &r) const
virtual void _loadBasis(Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)=0
This pure virtual function should load a basis into the LP-solver.
virtual bool infeasible() const
virtual OPTSTAT _primalSimplex()=0
The pure virtual function _primalSimplex() must be defined by the used LP-solver and should call the ...
virtual int _setSimplexIterationLimit(int limit)=0
The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm.
void initPostOpt()
Resets the optimization status and the availability statuses of the solution.
SOLSTAT slackStatus() const
virtual int pivotSlackVariableIn(ArrayBuffer< int > &rows)
Pivots the slack variables stored in the buffer rows into the basis.
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 t...
void remCols(ArrayBuffer< int > &cols)
Removes columns from the linear program.
virtual double _value() const =0
The pure virtual function _value() must be defined by the used LP-solver and should return the optimu...
Master * master_
A pointer to the corresponding master of the optimization.
virtual LPVARSTAT::STATUS lpVarStat(int i) const
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...
virtual int _nCol() const =0
The pure virtual function _nCol() must be defined by the used LP-solver and return the number of colu...
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 o...
SOLSTAT yValStatus() const
virtual int _getSimplexIterationLimit(int &limit) const =0
The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex alg...
OPTSTAT
The optimization status of the linear program.
@ Optimal
The optimal solution has been computed.
@ Infeasible
The linear program is primal infeasible.
@ Unbounded
The linear program is unbounded.
@ Error
An error has happened during optimization.
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 th...
ogdf::StopwatchCPU * lpSolverTime()
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...
SOLSTAT yValStatus_
This member becomes Available if the values of the dual variables of the optimal solution can be acce...
virtual double xVal(int i) const
virtual void _remCols(ArrayBuffer< int > &vars)=0
The pure virtual function _remCols() must be defined by the used LP-solver and should remove the colu...
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...
virtual OPTSTAT _approx()=0
The pure virtual function _approx() must be defined by the used LP-solver and should call the approxi...
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...
virtual void changeUBound(int i, double newUb)
Changes the upper bound of a single column.
OPTSTAT optStat_
The status of the linear program.
virtual double reco(int i) const
SOLSTAT xValStatus_
This member becomes Available if the -values of the optimal solution can be accessed with the functio...
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 gi...
void rows2cols(int nRow, Array< Row * > &rows, Array< SparVec * > &cols)
Computes the columnwise representation of the row matrix.
virtual int _maxRow() const =0
The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal numb...
void rowRealloc(int newSize)
Performs a reallocation of the row space of the linear program.
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 o...
SOLSTAT basisStatus_
This member becomes Available if the status of the variables and the slack variables of the optimal s...
double lBound(int i) const
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.
virtual double yVal(int c) const
virtual int _nnz() const =0
The pure virtual function _nnz() must be defined by the used LP-solver and return the number of nonze...
SOLSTAT recoStatus_
This member becomes Available if the reduced costs of the optimal solution can be accessed with the f...
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 st...
virtual void _colRealloc(int newSize)=0
The pure virtual function _colRealloc() must be defined by the used LP-solver and should reallocate i...
virtual double slack(int c) const
virtual double _barXVal(int i) const =0
virtual double _obj(int i) const =0
The pure virtual function _obj() must be defined by the used LP-solver and return the objective funct...
friend std::ostream & operator<<(std::ostream &out, const LP &rhs)
The output operator writes the objective function, followed by the constraints, the bounds on the col...
virtual OPTSTAT _dualSimplex()=0
The pure virtual function _dualSimplex() must be defined by the used LP-solver and should call the du...
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 ...
void colRangeCheck(int i) const
Terminates the program if there is no column with index i.
SOLSTAT basisStatus() const
virtual double value() const
void addRows(ArrayBuffer< Row * > &newRows)
Adds rows to the linear program.
virtual SlackStat::STATUS slackStat(int i) const
METHOD
The solution method for the linear program.
@ Dual
The dual simplex method.
@ BarrierAndCrossover
The barrier method followed by a crossover to a basis.
@ BarrierNoCrossover
The barrier method without crossover.
@ Primal
The primal simplex method.
void colRealloc(int newSize)
Performs a reallocation of the column space of the linear program.
const LP & operator=(const LP &rhs)
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...
void remRows(ArrayBuffer< int > &ind)
Removes rows of the linear program.
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 infeasib...
LP(Master *master)
Creates a linear program.
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 ...
virtual int _pivotSlackVariableIn(ArrayBuffer< int > &rows)=0
The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the bas...
void changeRhs(Array< double > &newRhs)
Changes the complete right hand side of the linear program.
virtual void changeLBound(int i, double newLb)
Changes the lower bound of a single column.
int writeBasisMatrix(const char *fileName)
Writes the complete basis of an optimal linear program to a file.
int nOpt_
The number of optimizations of the linear program.
SOLSTAT slackStatus_
This member becomes Available if the values of the slack variables of the optimal solution can be acc...
virtual OPTSTAT _barrier(bool doCrossover)=0
The pure virtual function _barrier() must be defined by the used LP-solver and should call the barrie...
virtual OPTSTAT optimize(METHOD method)
Performs the optimization of the linear program.
double uBound(int i) const
virtual OptSense _sense() const =0
The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the ...
ogdf::StopwatchCPU lpSolverTime_
virtual ~LP()
The destructor.
virtual int _maxCol() const =0
The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal ...
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 up...
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 ...
SOLSTAT barXValStatus() const
virtual void _sense(const OptSense &newSense)=0
int getSimplexIterationLimit(int &limit) const
SOLSTAT recoStatus() const
virtual double barXVal(int i) const
int setSimplexIterationLimit(int limit)
Changes the iteration limit of the Simplex algorithm.
void sense(const OptSense &newSense)
SOLSTAT xValStatus() const
SOLSTAT
Describes if parts of the solution like x-values, reduced costs, etc. are available.
@ Available
The part of the solution is available.
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 ...
void rowRangeCheck(int r) const
Terminates the program if there is no row with index r.
virtual int _nRow() const =0
The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows...
virtual void _rowRealloc(int newSize)=0
The pure virtual function _rowRealloc() must be defined in the used LP-solver and should reallocate i...
virtual void loadBasis(Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)
Loads a new basis for the linear program.
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 lo...
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.
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 st...
void addCols(ArrayBuffer< Column * > &newCols)
Adds columns to the linear program.
STATUS
The enumeration of the statuses a variable gets from the linear program solver.
The master of the optimization.
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.
Implements a stopwatch measuring CPU time.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
status of slack variables