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 | |
Access / modfication | |
virtual const char * | getName () const |
get name of simplifier. More... | |
virtual Real | timeUsed () const |
Simplifying / unsimplifying | |
virtual Result | simplify (SPxLP &lp, Real eps, Real delta)=0 |
simplify SPxLP lp with identical primal and dual feasibility tolerance. More... | |
virtual Result | simplify (SPxLP &lp, Real eps, Real feastol, Real opttol, bool keepbounds=false)=0 |
simplify SPxLP lp with independent primal and dual feasibility tolerance. More... | |
virtual void | unsimplify (const Vector &, const Vector &, const Vector &, const Vector &, const SPxSolver::VarStatus[], const SPxSolver::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 Vector & | unsimplifiedPrimal ()=0 |
returns a reference to the unsimplified primal solution. More... | |
virtual const Vector & | unsimplifiedDual ()=0 |
returns a reference to the unsimplified dual solution. More... | |
virtual const Vector & | unsimplifiedSlacks ()=0 |
returns a reference to the unsimplified slack values. More... | |
virtual const Vector & | unsimplifiedRedCost ()=0 |
returns a reference to the unsimplified reduced costs. More... | |
virtual SPxSolver::VarStatus | getBasisRowStatus (int) const =0 |
gets basis status for a single row. More... | |
virtual SPxSolver::VarStatus | getBasisColStatus (int) const =0 |
gets basis status for a single column. More... | |
virtual void | getBasis (SPxSolver::VarStatus[], SPxSolver::VarStatus[], const int rowsSize=-1, const int colsSize=-1) const =0 |
get optimal basis. More... | |
virtual Real | getObjoffset () const |
get objective offset. More... | |
virtual void | addObjoffset (const Real val) |
add objective offset. More... | |
virtual void | setMinReduction (const Real 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... | |
Real | m_objoffset |
objective offset More... | |
Real | 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 41 of file spxsimplifier.h.
enum Result |
Result of the simplification.
Definition at line 81 of file spxsimplifier.h.
|
explicit |
constructor
Definition at line 95 of file spxsimplifier.h.
References TimerFactory::createTimer(), and SPxSimplifier::isConsistent().
SPxSimplifier | ( | const SPxSimplifier & | old | ) |
copy constructor
Definition at line 115 of file spxsimplifier.h.
References TimerFactory::createTimer(), and SPxSimplifier::isConsistent().
|
virtual |
destructor.
Definition at line 157 of file spxsimplifier.h.
References SPxSimplifier::clone(), soplex::spx_free(), and Timer::~Timer().
|
virtual |
add objective offset.
Definition at line 228 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::FixVariablePS::FixVariablePS(), SPxMainSM::FreeColSingletonPS::FreeColSingletonPS(), and SPxMainSM::MultiAggregationPS::MultiAggregationPS().
|
pure virtual |
clone function for polymorphism
Implemented in SPxMainSM.
Referenced by SPxSimplifier::~SPxSimplifier().
|
pure virtual |
get optimal basis.
Implemented in SPxMainSM.
Referenced by SoPlex::_decompResolveWithoutPreprocessing(), SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::isUnsimplified().
|
pure virtual |
gets basis status for a single column.
Implemented in SPxMainSM.
Referenced by SPxSimplifier::isUnsimplified().
|
pure virtual |
gets basis status for a single row.
Implemented in SPxMainSM.
Referenced by SPxSimplifier::isUnsimplified().
|
virtual |
get name of simplifier.
Definition at line 171 of file spxsimplifier.h.
References SPxSimplifier::m_name.
Referenced by SoPlex::getSimplifierName().
|
virtual |
get objective offset.
Definition at line 222 of file spxsimplifier.h.
References SPxSimplifier::m_objoffset.
Referenced by SoPlex::_decompSimplifyAndSolve(), and SoPlex::_preprocessAndSolveReal().
|
virtual |
consistency check
Definition at line 245 of file spxsimplifier.h.
References soplex::operator<<().
Referenced by SPxSimplifier::operator=(), and SPxSimplifier::SPxSimplifier().
|
virtual |
specifies whether an optimal solution has already been unsimplified.
Reimplemented in SPxMainSM.
Definition at line 195 of file spxsimplifier.h.
References SPxSimplifier::getBasis(), SPxSimplifier::getBasisColStatus(), SPxSimplifier::getBasisRowStatus(), SPxSimplifier::unsimplifiedDual(), SPxSimplifier::unsimplifiedPrimal(), SPxSimplifier::unsimplifiedRedCost(), and SPxSimplifier::unsimplifiedSlacks().
Referenced by SoPlex::_decompResolveWithoutPreprocessing(), SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), and SoPlex::_storeSolutionRealFromPresol().
SPxSimplifier& operator= | ( | const SPxSimplifier & | rhs | ) |
assignment operator
Definition at line 133 of file spxsimplifier.h.
References SPxSimplifier::isConsistent(), SPxSimplifier::m_chgBnds, SPxSimplifier::m_chgLRhs, SPxSimplifier::m_keptBnds, SPxSimplifier::m_keptLRhs, SPxSimplifier::m_minReduction, SPxSimplifier::m_name, SPxSimplifier::m_objoffset, SPxSimplifier::m_remCols, SPxSimplifier::m_remNzos, SPxSimplifier::m_remRows, SPxSimplifier::m_timerType, SPxSimplifier::m_timeUsed, and SPxSimplifier::spxout.
Referenced by SPxMainSM::operator=().
|
pure virtual |
returns result status of the simplification
Implemented in SPxMainSM.
Referenced by SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::timeUsed().
|
virtual |
set minimal reduction threshold to continue simplification
Definition at line 234 of file spxsimplifier.h.
Referenced by SoPlex::_enableSimplifierAndScaler().
simplify SPxLP lp
with identical primal and dual feasibility tolerance.
Implemented in SPxMainSM.
Referenced by SoPlex::_decompSimplifyAndSolve(), SoPlex::_preprocessAndSolveReal(), SoPlex::_solveRealForRational(), and SPxSimplifier::timeUsed().
|
pure virtual |
simplify SPxLP lp
with independent primal and dual feasibility tolerance.
Implemented in SPxMainSM.
|
virtual |
Definition at line 175 of file spxsimplifier.h.
References SPxSimplifier::result(), SPxSimplifier::simplify(), Timer::time(), and SPxSimplifier::unsimplify().
|
pure virtual |
returns a reference to the unsimplified dual solution.
Implemented in SPxMainSM.
Referenced by SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified primal solution.
Implemented in SPxMainSM.
Referenced by SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified reduced costs.
Implemented in SPxMainSM.
Referenced by SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::isUnsimplified().
|
pure virtual |
returns a reference to the unsimplified slack values.
Implemented in SPxMainSM.
Referenced by SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::isUnsimplified().
|
pure virtual |
reconstructs an optimal solution for the unsimplified LP.
Implemented in SPxMainSM.
Referenced by SoPlex::_decompResolveWithoutPreprocessing(), SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), and SPxSimplifier::timeUsed().
|
protected |
number of changed bounds
Definition at line 60 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::handleExtremes(), SPxSimplifier::operator=(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), and SPxMainSM::simplifyRows().
|
protected |
number of change right-hand sides
Definition at line 62 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::handleExtremes(), SPxSimplifier::operator=(), SPxMainSM::simplify(), and SPxMainSM::simplifyRows().
|
protected |
number of kept bounds
Definition at line 64 of file spxsimplifier.h.
Referenced by SPxSimplifier::operator=(), SPxMainSM::simplify(), and SPxMainSM::simplifyRows().
|
protected |
number of kept left- and right-hand sides
Definition at line 66 of file spxsimplifier.h.
Referenced by SPxSimplifier::operator=(), SPxMainSM::simplify(), and SPxMainSM::simplifyRows().
|
protected |
minimal reduction (sum of removed rows/cols) to continue simplification
Definition at line 70 of file spxsimplifier.h.
Referenced by SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SPxMainSM::multiaggregation(), SPxSimplifier::operator=(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), and SPxMainSM::simplifyRows().
|
protected |
name of the simplifier
Definition at line 49 of file spxsimplifier.h.
Referenced by SPxSimplifier::getName(), and SPxSimplifier::operator=().
|
protected |
objective offset
Definition at line 68 of file spxsimplifier.h.
Referenced by SPxSimplifier::getObjoffset(), SPxSimplifier::operator=(), SPxMainSM::propagatePseudoobj(), SPxMainSM::simplify(), and SPxMainSM::trivialHeuristic().
|
protected |
number of removed columns
Definition at line 56 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::duplicateCols(), SPxMainSM::multiaggregation(), SPxSimplifier::operator=(), SPxMainSM::removeEmpty(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), and SPxMainSM::simplifyDual().
|
protected |
number of removed nonzero coefficients
Definition at line 58 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SPxMainSM::handleExtremes(), SPxMainSM::multiaggregation(), SPxSimplifier::operator=(), SPxMainSM::removeRowSingleton(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), and SPxMainSM::simplifyRows().
|
protected |
number of removed rows
Definition at line 54 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::duplicateRows(), SPxMainSM::handleExtremes(), SPxMainSM::multiaggregation(), SPxSimplifier::operator=(), SPxMainSM::removeEmpty(), SPxMainSM::removeRowSingleton(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), and SPxMainSM::simplifyRows().
|
protected |
Definition at line 52 of file spxsimplifier.h.
Referenced by SPxSimplifier::operator=().
|
protected |
user time used for simplification
Definition at line 51 of file spxsimplifier.h.
Referenced by SPxSimplifier::operator=(), and SPxMainSM::simplify().
|
protected |
message handler
Definition at line 72 of file spxsimplifier.h.
Referenced by SPxMainSM::aggregateVars(), SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SPxMainSM::fixColumn(), SPxMainSM::handleExtremes(), SPxMainSM::multiaggregation(), SPxSimplifier::operator=(), SPxMainSM::removeEmpty(), SPxMainSM::removeRowSingleton(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), SPxMainSM::simplifyRows(), and SPxMainSM::unsimplify().