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. More...
#include <spxsimplifier.h>
Public Member Functions | |
void | setOutstream (SPxOut &newOutstream) |
Access / modfication | |
virtual const char * | getName () const |
get name of simplifier. More... | |
virtual R | timeUsed () const |
Simplifying / unsimplifying | |
virtual Result | simplify (SPxLPBase< R > &lp, R eps, R delta, Real remainingTime)=0 |
simplify SPxLP lp with identical primal and dual feasibility tolerance. More... | |
virtual Result | simplify (SPxLPBase< R > &lp, R eps, R feastol, R opttol, Real remainingTime, bool keepbounds=false, uint32_t seed=0)=0 |
simplify SPxLP lp with independent primal and dual feasibility tolerance. More... | |
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. More... | |
virtual Result | result () const =0 |
returns result status of the simplification More... | |
virtual bool | isUnsimplified () const |
specifies whether an optimal solution has already been unsimplified. More... | |
virtual const VectorBase< R > & | unsimplifiedPrimal ()=0 |
returns a reference to the unsimplified primal solution. More... | |
virtual const VectorBase< R > & | unsimplifiedDual ()=0 |
returns a reference to the unsimplified dual solution. More... | |
virtual const VectorBase< R > & | unsimplifiedSlacks ()=0 |
returns a reference to the unsimplified slack values. More... | |
virtual const VectorBase< R > & | unsimplifiedRedCost ()=0 |
returns a reference to the unsimplified reduced costs. More... | |
virtual SPxSolverBase< R >::VarStatus | getBasisRowStatus (int) const =0 |
gets basis status for a single row. More... | |
virtual SPxSolverBase< R >::VarStatus | getBasisColStatus (int) const =0 |
gets basis status for a single column. More... | |
virtual void | getBasis (typename SPxSolverBase< R >::VarStatus[], typename SPxSolverBase< R >::VarStatus[], const int rowsSize=-1, const int colsSize=-1) const =0 |
get optimal basis. More... | |
virtual R | getObjoffset () const |
get objective offset. More... | |
virtual void | addObjoffset (const R val) |
add objective offset. More... | |
virtual void | setMinReduction (const R minRed) |
set minimal reduction threshold to continue simplification More... | |
Consistency check | |
virtual bool | isConsistent () const |
consistency check More... | |
Protected Attributes | |
Protected Data | |
const char * | m_name |
name of the simplifier More... | |
Timer * | m_timeUsed |
user time used for simplification More... | |
Timer::TYPE | m_timerType |
int | m_remRows |
number of removed rows More... | |
int | m_remCols |
number of removed columns More... | |
int | m_remNzos |
number of removed nonzero coefficients More... | |
int | m_chgBnds |
number of changed bounds More... | |
int | m_chgLRhs |
number of change right-hand sides More... | |
int | m_keptBnds |
number of kept bounds More... | |
int | m_keptLRhs |
number of kept left- and right-hand sides More... | |
R | m_objoffset |
objective offset More... | |
R | m_minReduction |
minimal reduction (sum of removed rows/cols) to continue simplification More... | |
SPxOut * | spxout |
message handler More... | |
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 More... | |
SPxSimplifier (const SPxSimplifier &old) | |
copy constructor More... | |
SPxSimplifier & | operator= (const SPxSimplifier &rhs) |
assignment operator More... | |
virtual | ~SPxSimplifier () |
destructor. More... | |
virtual SPxSimplifier * | clone () const =0 |
clone function for polymorphism More... | |
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 42 of file spxsimplifier.h.
enum Result |
Result of the simplification.
Definition at line 82 of file spxsimplifier.h.
|
explicit |
constructor
Definition at line 96 of file spxsimplifier.h.
References TimerFactory::createTimer(), and SPxSimplifier< R >::isConsistent().
SPxSimplifier | ( | const SPxSimplifier< R > & | old | ) |
copy constructor
Definition at line 116 of file spxsimplifier.h.
References TimerFactory::createTimer(), and SPxSimplifier< R >::isConsistent().
|
virtual |
destructor.
Definition at line 158 of file spxsimplifier.h.
References SPxSimplifier< R >::clone(), soplex::spx_free(), and Timer::~Timer().
|
virtual |
add objective offset.
Definition at line 231 of file spxsimplifier.h.
|
pure virtual |
clone function for polymorphism
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::~SPxSimplifier().
|
pure virtual |
get optimal basis.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
gets basis status for a single column.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
gets basis status for a single row.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
virtual |
get name of simplifier.
Definition at line 172 of file spxsimplifier.h.
References SPxSimplifier< R >::m_name.
|
virtual |
get objective offset.
Definition at line 225 of file spxsimplifier.h.
References SPxSimplifier< R >::m_objoffset.
|
virtual |
consistency check
Definition at line 248 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=(), and SPxSimplifier< R >::SPxSimplifier().
|
virtual |
specifies whether an optimal solution has already been unsimplified.
Reimplemented in SPxMainSM< R >, and Presol< R >.
Definition at line 198 of file spxsimplifier.h.
References SPxSimplifier< R >::getBasis(), SPxSimplifier< R >::getBasisColStatus(), SPxSimplifier< R >::getBasisRowStatus(), SPxSimplifier< R >::unsimplifiedDual(), SPxSimplifier< R >::unsimplifiedPrimal(), SPxSimplifier< R >::unsimplifiedRedCost(), and SPxSimplifier< R >::unsimplifiedSlacks().
SPxSimplifier& operator= | ( | const SPxSimplifier< R > & | rhs | ) |
assignment operator
Definition at line 134 of file spxsimplifier.h.
References SPxSimplifier< R >::isConsistent(), SPxSimplifier< R >::m_chgBnds, SPxSimplifier< R >::m_chgLRhs, SPxSimplifier< R >::m_keptBnds, SPxSimplifier< R >::m_keptLRhs, SPxSimplifier< R >::m_minReduction, SPxSimplifier< R >::m_name, SPxSimplifier< R >::m_objoffset, SPxSimplifier< R >::m_remCols, SPxSimplifier< R >::m_remNzos, SPxSimplifier< R >::m_remRows, SPxSimplifier< R >::m_timerType, SPxSimplifier< R >::m_timeUsed, and SPxSimplifier< R >::spxout.
Referenced by Presol< R >::getBasis(), and SPxMainSM< R >::operator=().
|
pure virtual |
returns result status of the simplification
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::timeUsed().
|
virtual |
set minimal reduction threshold to continue simplification
Definition at line 237 of file spxsimplifier.h.
void setOutstream | ( | SPxOut & | newOutstream | ) |
Definition at line 254 of file spxsimplifier.h.
simplify SPxLP lp
with identical primal and dual feasibility tolerance.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::timeUsed().
|
pure virtual |
simplify SPxLP lp
with independent primal and dual feasibility tolerance.
Implemented in SPxMainSM< R >, and Presol< R >.
|
virtual |
Definition at line 176 of file spxsimplifier.h.
References SPxSimplifier< R >::result(), SPxSimplifier< R >::simplify(), Timer::time(), and SPxSimplifier< R >::unsimplify().
|
pure virtual |
returns a reference to the unsimplified dual solution.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified primal solution.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified reduced costs.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified slack values.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::isUnsimplified().
|
pure virtual |
reconstructs an optimal solution for the unsimplified LP.
Implemented in SPxMainSM< R >, and Presol< R >.
Referenced by SPxSimplifier< R >::timeUsed().
|
protected |
number of changed bounds
Definition at line 61 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
number of change right-hand sides
Definition at line 63 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
number of kept bounds
Definition at line 65 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
number of kept left- and right-hand sides
Definition at line 67 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
minimal reduction (sum of removed rows/cols) to continue simplification
Definition at line 71 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
name of the simplifier
Definition at line 50 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::getName(), and SPxSimplifier< R >::operator=().
|
protected |
objective offset
Definition at line 69 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::getObjoffset(), and SPxSimplifier< R >::operator=().
|
protected |
number of removed columns
Definition at line 57 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
number of removed nonzero coefficients
Definition at line 59 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
number of removed rows
Definition at line 55 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
Definition at line 53 of file spxsimplifier.h.
Referenced by SPxSimplifier< R >::operator=().
|
protected |
user time used for simplification
Definition at line 52 of file spxsimplifier.h.
Referenced by Presol< R >::getBasis(), and SPxSimplifier< R >::operator=().
|
protected |
message handler
Definition at line 73 of file spxsimplifier.h.
Referenced by Presol< R >::getBasis(), and SPxSimplifier< R >::operator=().