|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
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 );
346 virtual int getInfeas(
int &infeasRow,
int &infeasCol,
double *bInvRow)
const {
347 return _getInfeas(infeasRow,infeasCol,bInvRow);
354 return _lpVarStat(i);
361 return _slackStat(i);
370 virtual OPTSTAT optimize(METHOD method);
422 virtual void changeLBound(
int i,
double newLb);
429 virtual void changeUBound(
int i,
double newUb);
446 _rowRealloc(newSize);
454 _colRealloc(newSize);
466 int writeBasisMatrix(
const char *fileName);
476 return _setSimplexIterationLimit(limit);
486 return _getSimplexIterationLimit(limit);
524 void rowRangeCheck(
int r)
const;
530 void colRangeCheck(
int i)
const;
535 virtual OptSense _sense()
const = 0;
536 virtual void _sense(
const OptSense &newSense) = 0;
541 virtual int _nRow()
const = 0;
546 virtual int _maxRow()
const = 0;
551 virtual int _nCol()
const = 0;
556 virtual int _maxCol()
const = 0;
563 virtual int _nnz()
const = 0;
569 virtual double _obj(
int i)
const = 0;
574 virtual double _lBound(
int i)
const = 0;
579 virtual double _uBound(
int i)
const = 0;
584 virtual double _rhs(
int i)
const = 0;
589 virtual void _row(
int i,
Row &
r)
const = 0;
604 virtual void _initialize(
OptSense sense,
int nRow,
int maxRow,
605 int nCol,
int maxCol,
621 virtual OPTSTAT _primalSimplex() = 0;
627 virtual OPTSTAT _dualSimplex() = 0;
633 virtual OPTSTAT _barrier(
bool doCrossover) = 0;
639 virtual OPTSTAT _approx() = 0;
645 virtual double _value()
const = 0;
651 virtual double _xVal(
int i)
const = 0;
652 virtual double _barXVal(
int i)
const = 0;
657 virtual double _reco(
int i)
const = 0;
662 virtual double _slack(
int i)
const = 0;
668 virtual double _yVal(
int i)
const = 0;
694 virtual int _getInfeas(
int &infeasRow,
int &infeasCol,
695 double *bInvRow)
const = 0;
731 virtual void _changeLBound(
int i,
double newLb) = 0;
737 virtual void _changeUBound(
int i,
double newUb) = 0;
755 virtual void _rowRealloc(
int newSize) = 0;
761 virtual void _colRealloc(
int newSize) = 0;
771 virtual int _setSimplexIterationLimit(
int limit) = 0;
782 virtual int _getSimplexIterationLimit(
int &limit)
const = 0;
842 optStat_= Unoptimized;
843 xValStatus_= barXValStatus_= recoStatus_= Missing;
844 slackStatus_= yValStatus_= basisStatus_= Missing;
848 const LP &operator=(
const LP &rhs);
858 inline void LP::sense(
const OptSense &newSense)
888 inline double LP::obj(
int i)
const
912 inline void LP::row(
int i, Row &
r)
const
920 inline double LP::rhs(
int i)
const
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 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.