SoPlex
|
LP simplification abstract base class. More...
#include <spxsimplifier.h>
Public Member Functions | |
void | setOutstream (SPxOut &newOutstream) |
virtual void | setTolerances (std::shared_ptr< Tolerances > newTolerances) |
set the _tolerances member variable | |
const std::shared_ptr< Tolerances > | tolerances () const |
get the _tolerances member variable | |
Access / modfication | |
virtual const char * | getName () const |
get name of simplifier. | |
virtual R | timeUsed () const |
Simplifying / unsimplifying | |
virtual Result | simplify (SPxLPBase< R > &lp, Real remainingTime, bool keepbounds=false, uint32_t seed=0)=0 |
simplify SPxLP lp | |
virtual void | unsimplify (const VectorBase< R > &, const VectorBase< R > &, const VectorBase< R > &, const VectorBase< R > &, const typename SPxSolverBase< R >::VarStatus[], const typename SPxSolverBase< R >::VarStatus[], bool isOptimal=true)=0 |
reconstructs an optimal solution for the unsimplified LP. | |
virtual Result | result () const =0 |
returns result status of the simplification | |
virtual bool | isUnsimplified () const |
specifies whether an optimal solution has already been unsimplified. | |
virtual const VectorBase< R > & | unsimplifiedPrimal ()=0 |
returns a reference to the unsimplified primal solution. | |
virtual const VectorBase< R > & | unsimplifiedDual ()=0 |
returns a reference to the unsimplified dual solution. | |
virtual const VectorBase< R > & | unsimplifiedSlacks ()=0 |
returns a reference to the unsimplified slack values. | |
virtual const VectorBase< R > & | unsimplifiedRedCost ()=0 |
returns a reference to the unsimplified reduced costs. | |
virtual SPxSolverBase< R >::VarStatus | getBasisRowStatus (int) const =0 |
gets basis status for a single row. | |
virtual SPxSolverBase< R >::VarStatus | getBasisColStatus (int) const =0 |
gets basis status for a single column. | |
virtual void | getBasis (typename SPxSolverBase< R >::VarStatus[], typename SPxSolverBase< R >::VarStatus[], const int rowsSize=-1, const int colsSize=-1) const =0 |
get optimal basis. | |
virtual R | getObjoffset () const |
get objective offset. | |
virtual void | addObjoffset (const R val) |
add objective offset. | |
virtual void | setMinReduction (const R minRed) |
set minimal reduction threshold to continue simplification | |
Consistency check | |
virtual bool | isConsistent () const |
consistency check | |
Protected Attributes | |
Protected Data | |
const char * | m_name |
name of the simplifier | |
Timer * | m_timeUsed |
user time used for simplification | |
Timer::TYPE | m_timerType |
int | m_remRows |
number of removed rows | |
int | m_remCols |
number of removed columns | |
int | m_remNzos |
number of removed nonzero coefficients | |
int | m_chgBnds |
number of changed bounds | |
int | m_chgLRhs |
number of change right-hand sides | |
int | m_keptBnds |
number of kept bounds | |
int | m_keptLRhs |
number of kept left- and right-hand sides | |
R | m_objoffset |
objective offset | |
R | m_minReduction |
minimal reduction (sum of removed rows/cols) to continue simplification | |
SPxOut * | spxout |
message handler | |
std::shared_ptr< Tolerances > | _tolerances |
Types | |
enum | Result { OKAY = 0 , INFEASIBLE = 1 , DUAL_INFEASIBLE = 2 , UNBOUNDED = 3 , VANISHED = 4 } |
Result of the simplification. More... | |
SPxSimplifier (const char *p_name, Timer::TYPE ttype=Timer::USER_TIME) | |
constructor | |
SPxSimplifier (const SPxSimplifier &old) | |
copy constructor | |
SPxSimplifier & | operator= (const SPxSimplifier &rhs) |
assignment operator | |
virtual | ~SPxSimplifier () |
destructor. | |
virtual SPxSimplifier * | clone () const =0 |
clone function for polymorphism | |
LP simplification abstract base class.
Instances of classes derived from SPxSimplifier may be loaded to SoPlex in order to simplify LPs before solving them. SoPlex will call simplify() on itself. Generally any SPxLP can be given to a SPxSimplifier for simplify()ing it. The simplification cannot be undone, but given an primal/dual solution for the simplified SPxLP, the simplifier can reconstruct the primal/dual solution of the unsimplified LP.
Definition at line 51 of file spxsimplifier.h.
enum Result |
Result of the simplification.
Definition at line 92 of file spxsimplifier.h.
|
explicit |
constructor
Definition at line 106 of file spxsimplifier.h.
References TimerFactory::createTimer(), isConsistent(), m_chgBnds, m_chgLRhs, m_keptBnds, m_keptLRhs, m_minReduction, m_name, m_objoffset, m_remCols, m_remNzos, m_remRows, m_timerType, m_timeUsed, spxout, and Timer::USER_TIME.
Referenced by Presol< R >::clone(), SPxMainSM< R >::clone(), clone(), operator=(), Presol< R >::Presol(), Presol< R >::Presol(), SPxMainSM< R >::SPxMainSM(), SPxMainSM< R >::SPxMainSM(), and SPxSimplifier().
SPxSimplifier | ( | const SPxSimplifier< R > & | old | ) |
copy constructor
Definition at line 126 of file spxsimplifier.h.
References TimerFactory::createTimer(), isConsistent(), m_chgBnds, m_chgLRhs, m_keptBnds, m_keptLRhs, m_minReduction, m_name, m_objoffset, m_remCols, m_remNzos, m_remRows, m_timerType, m_timeUsed, spxout, and SPxSimplifier().
|
virtual |
destructor.
Definition at line 168 of file spxsimplifier.h.
References m_name, m_timeUsed, and soplex::spx_free().
|
virtual |
add objective offset.
Definition at line 239 of file spxsimplifier.h.
References m_objoffset.
Referenced by SPxMainSM< R >::FixVariablePS::FixVariablePS(), SPxMainSM< R >::FreeColSingletonPS::FreeColSingletonPS(), and SPxMainSM< R >::MultiAggregationPS::MultiAggregationPS().
|
pure virtual |
clone function for polymorphism
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
References SPxSimplifier().
|
pure virtual |
get optimal basis.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
gets basis status for a single column.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
gets basis status for a single row.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
virtual |
|
virtual |
|
virtual |
consistency check
Definition at line 256 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
virtual |
specifies whether an optimal solution has already been unsimplified.
Reimplemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
Definition at line 206 of file spxsimplifier.h.
SPxSimplifier & operator= | ( | const SPxSimplifier< R > & | rhs | ) |
assignment operator
Definition at line 144 of file spxsimplifier.h.
References isConsistent(), m_chgBnds, m_chgLRhs, m_keptBnds, m_keptLRhs, m_minReduction, m_name, m_objoffset, m_remCols, m_remNzos, m_remRows, m_timerType, m_timeUsed, spxout, and SPxSimplifier().
Referenced by SPxMainSM< R >::operator=().
|
pure virtual |
returns result status of the simplification
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
virtual |
set minimal reduction threshold to continue simplification
Definition at line 245 of file spxsimplifier.h.
References m_minReduction.
void setOutstream | ( | SPxOut & | newOutstream | ) |
Definition at line 262 of file spxsimplifier.h.
References spxout.
|
virtual |
set the _tolerances member variable
Definition at line 268 of file spxsimplifier.h.
|
pure virtual |
simplify SPxLP lp
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
virtual |
Definition at line 186 of file spxsimplifier.h.
References m_timeUsed.
const std::shared_ptr< Tolerances > tolerances | ( | ) | const |
get the _tolerances member variable
Definition at line 273 of file spxsimplifier.h.
References _tolerances.
Referenced by SPxMainSM< R >::epsZero(), SPxMainSM< R >::feastol(), and SPxMainSM< R >::opttol().
|
pure virtual |
returns a reference to the unsimplified dual solution.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
returns a reference to the unsimplified primal solution.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
returns a reference to the unsimplified reduced costs.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
returns a reference to the unsimplified slack values.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
pure virtual |
reconstructs an optimal solution for the unsimplified LP.
Implemented in Presol< R >, Presol< BP >, SPxMainSM< R >, and SPxMainSM< BP >.
|
protected |
Definition at line 83 of file spxsimplifier.h.
Referenced by tolerances().
|
protected |
number of changed bounds
Definition at line 69 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of change right-hand sides
Definition at line 71 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of kept bounds
Definition at line 73 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of kept left- and right-hand sides
Definition at line 75 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
minimal reduction (sum of removed rows/cols) to continue simplification
Definition at line 79 of file spxsimplifier.h.
Referenced by operator=(), setMinReduction(), SPxSimplifier(), and SPxSimplifier().
|
protected |
name of the simplifier
Definition at line 58 of file spxsimplifier.h.
Referenced by getName(), operator=(), SPxSimplifier(), SPxSimplifier(), and ~SPxSimplifier().
|
protected |
objective offset
Definition at line 77 of file spxsimplifier.h.
Referenced by addObjoffset(), getObjoffset(), operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of removed columns
Definition at line 65 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of removed nonzero coefficients
Definition at line 67 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
number of removed rows
Definition at line 63 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
Definition at line 61 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), and SPxSimplifier().
|
protected |
user time used for simplification
Definition at line 60 of file spxsimplifier.h.
Referenced by operator=(), SPxSimplifier(), SPxSimplifier(), timeUsed(), and ~SPxSimplifier().
|
protected |
message handler
tolerances used by the solver
Definition at line 81 of file spxsimplifier.h.
Referenced by operator=(), setOutstream(), SPxSimplifier(), and SPxSimplifier().