 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
38 #pragma GCC visibility push(default)
108 optStat_(Unoptimized),
109 xValStatus_(Missing),
110 barXValStatus_(Missing),
111 yValStatus_(Missing),
112 recoStatus_(Missing),
113 slackStatus_(Missing),
114 basisStatus_(Missing),
171 _initialize(sense, nRow, maxRow, nCol, maxCol, obj, lBound, uBound, rows);
192 int nRow,
int maxRow,
193 int nCol,
int maxCol,
200 _initialize(sense, nRow, maxRow, nCol, maxCol, obj, lBound, uBound, rows);
201 loadBasis(lpVarStat,slackStat);
213 _loadBasis(lpVarStat,slackStat);
220 int nRow()
const {
return _nRow(); }
224 int nCol()
const {
return _nCol(); }
228 int nnz()
const {
return _nnz(); }
265 virtual double value()
const {
return _value(); }
267 virtual double xVal(
int i)
const {
281 virtual double reco(
int i)
const {
288 virtual double yVal(
int c)
const {
314 int nOpt()
const {
return nOpt_; }
317 return ( optStat_ == Infeasible );
347 virtual int getInfeas(
int &infeasRow,
int &infeasCol,
double *bInvRow)
const {
348 return _getInfeas(infeasRow,infeasCol,bInvRow);
355 return _lpVarStat(i);
362 return _slackStat(i);
371 virtual OPTSTAT optimize(METHOD method);
423 virtual void changeLBound(
int i,
double newLb);
430 virtual void changeUBound(
int i,
double newUb);
447 _rowRealloc(newSize);
455 _colRealloc(newSize);
467 int writeBasisMatrix(
const char *fileName);
477 return _setSimplexIterationLimit(limit);
487 return _getSimplexIterationLimit(limit);
525 void rowRangeCheck(
int r)
const;
531 void colRangeCheck(
int i)
const;
536 virtual OptSense _sense()
const = 0;
537 virtual void _sense(
const OptSense &newSense) = 0;
542 virtual int _nRow()
const = 0;
547 virtual int _maxRow()
const = 0;
552 virtual int _nCol()
const = 0;
557 virtual int _maxCol()
const = 0;
564 virtual int _nnz()
const = 0;
570 virtual double _obj(
int i)
const = 0;
575 virtual double _lBound(
int i)
const = 0;
580 virtual double _uBound(
int i)
const = 0;
585 virtual double _rhs(
int i)
const = 0;
590 virtual void _row(
int i,
Row &
r)
const = 0;
605 virtual void _initialize(
OptSense sense,
int nRow,
int maxRow,
606 int nCol,
int maxCol,
622 virtual OPTSTAT _primalSimplex() = 0;
628 virtual OPTSTAT _dualSimplex() = 0;
634 virtual OPTSTAT _barrier(
bool doCrossover) = 0;
640 virtual OPTSTAT _approx() = 0;
646 virtual double _value()
const = 0;
652 virtual double _xVal(
int i)
const = 0;
653 virtual double _barXVal(
int i)
const = 0;
658 virtual double _reco(
int i)
const = 0;
663 virtual double _slack(
int i)
const = 0;
669 virtual double _yVal(
int i)
const = 0;
695 virtual int _getInfeas(
int &infeasRow,
int &infeasCol,
696 double *bInvRow)
const = 0;
732 virtual void _changeLBound(
int i,
double newLb) = 0;
738 virtual void _changeUBound(
int i,
double newUb) = 0;
756 virtual void _rowRealloc(
int newSize) = 0;
762 virtual void _colRealloc(
int newSize) = 0;
772 virtual int _setSimplexIterationLimit(
int limit) = 0;
783 virtual int _getSimplexIterationLimit(
int &limit)
const = 0;
843 optStat_= Unoptimized;
844 xValStatus_= barXValStatus_= recoStatus_= Missing;
845 slackStatus_= yValStatus_= basisStatus_= Missing;
849 const LP &operator=(
const LP &rhs);
859 inline void LP::sense(
const OptSense &newSense)
889 inline double LP::obj(
int i)
const
913 inline void LP::row(
int i, Row &
r)
const
921 inline double LP::rhs(
int i)
const
1033 #pragma GCC visibility pop
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
void rowRealloc(int newSize)
Performs a reallocation of the row space of the linear program.
@ BarrierAndCrossover
The barrier method followed by a crossover to a basis.
virtual double reco(int i) const
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 double yVal(int c) const
SOLSTAT slackStatus() const
SOLSTAT basisStatus() 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, Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)
This version of the function initialize() performs like its previous version, but also initializes th...
virtual double _barXVal(int i) const =0
std::ostream & operator<<(std::ostream &out, const Active< BaseType, CoType > &rhs)
SOLSTAT recoStatus() const
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 ...
void remCols(ArrayBuffer< int > &cols)
Removes columns from the linear program.
SOLSTAT recoStatus_
This member becomes Available if the reduced costs of the optimal solution can be accessed with the f...
@ Primal
The primal simplex method.
virtual LPVARSTAT::STATUS lpVarStat(int i) const
virtual double xVal(int i) const
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 ...
STATUS
The enumeration of the statuses a variable gets from the linear program solver.
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...
virtual int _nnz() const =0
The pure virtual function _nnz() must be defined by the used LP-solver and return the number of nonze...
virtual int _maxCol() const =0
The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal ...
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 basisStatus_
This member becomes Available if the status of the variables and the slack variables of the optimal s...
Implements a stopwatch measuring CPU time.
SOLSTAT slackStatus_
This member becomes Available if the values of the slack variables of the optimal solution can be acc...
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 ...
ogdf::StopwatchCPU lpSolverTime_
@ Optimal
The optimal solution has been computed.
STATUS
The different statuses of a slack variable.
virtual int _maxRow() const =0
The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal numb...
virtual int _nCol() const =0
The pure virtual function _nCol() must be defined by the used LP-solver and return the number of colu...
@ Unbounded
The linear program is unbounded.
virtual double slack(int c) const
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...
void rowRangeCheck(int r) const
Terminates the program if there is no row with index r.
void colRealloc(int newSize)
Performs a reallocation of the column space of the linear program.
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...
SOLSTAT yValStatus_
This member becomes Available if the values of the dual variables of the optimal solution can be acce...
SOLSTAT barXValStatus() const
void row(int i, Row &r) const
virtual SlackStat::STATUS slackStat(int i) const
@ Available
The part of the solution is available.
Master * master_
A pointer to the corresponding master of the optimization.
void sense(const OptSense &newSense)
OPTSTAT
The optimization status of the linear program.
SOLSTAT yValStatus() const
int getSimplexIterationLimit(int &limit) const
LP(Master *master)
Creates a linear program.
Base class of all other classes of ABACUS.
@ BarrierNoCrossover
The barrier method without crossover.
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...
The parameterized class Array implements dynamic arrays of type E.
void changeRhs(Array< double > &newRhs)
Changes the complete right hand side of the linear program.
Representation of constraints in the row format.
double uBound(int i) const
SOLSTAT xValStatus() const
Declaration of stopwatch classes.
virtual double barXVal(int i) 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.
virtual double _value() const =0
The pure virtual function _value() must be defined by the used LP-solver and should return the optimu...
METHOD
The solution method for the linear program.
void colRangeCheck(int i) const
Terminates the program if there is no column with index i.
SOLSTAT xValStatus_
This member becomes Available if the -values of the optimal solution can be accessed with the functio...
virtual double value() const
@ Dual
The dual simplex method.
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...
virtual bool infeasible() const
int setSimplexIterationLimit(int limit)
Changes the iteration limit of the Simplex algorithm.
void remRows(ArrayBuffer< int > &ind)
Removes rows of the linear program.
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...
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
void initPostOpt()
Resets the optimization status and the availability statuses of the solution.
SOLSTAT
Describes if parts of the solution like x-values, reduced costs, etc. are available.
double lBound(int i) const
virtual void loadBasis(Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)
Loads a new basis for the linear program.
@ Error
An error has happened during optimization.
virtual int _nRow() const =0
The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows...
@ Infeasible
The linear program is primal infeasible.
ogdf::StopwatchCPU * lpSolverTime()
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 ~LP()
The destructor.
virtual OptSense _sense() const =0
The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the ...
The master of the optimization.
int nOpt_
The number of optimizations of the linear program.
status of slack variables
OPTSTAT optStat_
The status of the linear program.