SoPlex Doxygen Documentation
SPxSimplifier Class Referenceabstract

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>

Inheritance diagram for SPxSimplifier:

Public Member Functions

Access / modfication
virtual const char * getName () const
 get name of simplifier.
 
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.
 
virtual Result simplify (SPxLP &lp, Real eps, Real feastol, Real opttol)=0
 simplify SPxLP lp with independent primal and dual feasibility tolerance.
 
virtual void unsimplify (const Vector &, const Vector &, const Vector &, const Vector &, const SPxSolver::VarStatus[], const SPxSolver::VarStatus[])
 reconstructs an optimal solution for the unsimplified LP.
 
virtual bool isUnsimplified () const
 specifies whether an optimal solution has already been unsimplified.
 
virtual const VectorunsimplifiedPrimal ()=0
 returns a reference to the unsimplified primal solution.
 
virtual const VectorunsimplifiedDual ()=0
 returns a reference to the unsimplified dual solution.
 
virtual const VectorunsimplifiedSlacks ()=0
 returns a reference to the unsimplified slack values.
 
virtual const VectorunsimplifiedRedCost ()=0
 returns a reference to the unsimplified reduced costs.
 
virtual SPxSolver::VarStatus getBasisRowStatus (int) const =0
 gets basis status for a single row.
 
virtual SPxSolver::VarStatus getBasisColStatus (int) const =0
 gets basis status for a single column.
 
virtual void getBasis (SPxSolver::VarStatus[], SPxSolver::VarStatus[]) const =0
 get optimal basis.
 
virtual Real getObjoffset () const
 get objective offset.
 
virtual void addObjoffset (const Real val)
 add objective offset.
 
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
 
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
 
Real m_objoffset
 objective offset
 

Types

enum  Result {
  OKAY = 0, INFEASIBLE = 1, DUAL_INFEASIBLE = 2, UNBOUNDED = 3,
  VANISHED = 4
}
 Result of the simplification. More...
 
 SPxSimplifier (const char *p_name)
 constructor
 
 SPxSimplifier (const SPxSimplifier &old)
 copy constructor
 
SPxSimplifieroperator= (const SPxSimplifier &rhs)
 assignment operator
 
virtual ~SPxSimplifier ()
 destructor.
 
virtual SPxSimplifierclone () const =0
 clone function for polymorphism
 

Detailed Description

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.

Member Enumeration Documentation

enum Result

Result of the simplification.

Enumerator
OKAY 

simplification could be done

INFEASIBLE 

primal infeasibility was detected

DUAL_INFEASIBLE 

dual infeasibility was detected

UNBOUNDED 

primal unboundedness was detected

VANISHED 

the problem was so much simplified that it vanished

Definition at line 72 of file spxsimplifier.h.

Constructor & Destructor Documentation

SPxSimplifier ( const char *  p_name)
explicit

constructor

Definition at line 86 of file spxsimplifier.h.

References SPxSimplifier::isConsistent().

SPxSimplifier ( const SPxSimplifier old)

copy constructor

Definition at line 98 of file spxsimplifier.h.

References SPxSimplifier::isConsistent().

virtual ~SPxSimplifier ( )
virtual

destructor.

Definition at line 128 of file spxsimplifier.h.

References SPxSimplifier::m_name.

Member Function Documentation

virtual void addObjoffset ( const Real  val)
virtual
virtual SPxSimplifier* clone ( ) const
pure virtual

clone function for polymorphism

Implemented in SPxMainSM.

Referenced by SoPlex::operator=(), and SoPlex::SoPlex().

virtual void getBasis ( SPxSolver::VarStatus  [],
SPxSolver::VarStatus  [] 
) const
pure virtual

get optimal basis.

Implemented in SPxMainSM.

Referenced by SoPlex::getBasis().

virtual SPxSolver::VarStatus getBasisColStatus ( int  ) const
pure virtual

gets basis status for a single column.

Implemented in SPxMainSM.

Referenced by SoPlex::getBasisColStatus().

virtual SPxSolver::VarStatus getBasisRowStatus ( int  ) const
pure virtual

gets basis status for a single row.

Implemented in SPxMainSM.

Referenced by SoPlex::getBasisRowStatus().

virtual const char* getName ( ) const
virtual

get name of simplifier.

Definition at line 140 of file spxsimplifier.h.

References SPxSimplifier::m_name.

Referenced by get_simplifier(), and SPxMainSM::unsimplify().

virtual Real getObjoffset ( ) const
virtual

get objective offset.

Definition at line 187 of file spxsimplifier.h.

References SPxSimplifier::m_objoffset.

virtual bool isConsistent ( ) const
virtual

consistency check

Definition at line 203 of file spxsimplifier.h.

Referenced by SPxSimplifier::operator=(), and SPxSimplifier::SPxSimplifier().

virtual bool isUnsimplified ( ) const
virtual

specifies whether an optimal solution has already been unsimplified.

Reimplemented in SPxMainSM.

Definition at line 161 of file spxsimplifier.h.

Referenced by SoPlex::getBasis(), SoPlex::getBasisColStatus(), SoPlex::getBasisRowStatus(), SoPlex::getDual(), SoPlex::getPrimal(), SoPlex::getRedCost(), SoPlex::getSlacks(), and SoPlex::unsimplify().

virtual Result simplify ( SPxLP lp,
Real  eps,
Real  delta 
)
pure virtual

simplify SPxLP lp with identical primal and dual feasibility tolerance.

Implemented in SPxMainSM.

Referenced by SoPlex::solve().

virtual Result simplify ( SPxLP lp,
Real  eps,
Real  feastol,
Real  opttol 
)
pure virtual

simplify SPxLP lp with independent primal and dual feasibility tolerance.

Implemented in SPxMainSM.

virtual Real timeUsed ( ) const
virtual

Definition at line 144 of file spxsimplifier.h.

References SPxSimplifier::m_timeUsed, and Timer::userTime().

virtual const Vector& unsimplifiedDual ( )
pure virtual

returns a reference to the unsimplified dual solution.

Implemented in SPxMainSM.

Referenced by SoPlex::getDual().

virtual const Vector& unsimplifiedPrimal ( )
pure virtual

returns a reference to the unsimplified primal solution.

Implemented in SPxMainSM.

Referenced by SoPlex::getPrimal().

virtual const Vector& unsimplifiedRedCost ( )
pure virtual

returns a reference to the unsimplified reduced costs.

Implemented in SPxMainSM.

Referenced by SoPlex::getRedCost().

virtual const Vector& unsimplifiedSlacks ( )
pure virtual

returns a reference to the unsimplified slack values.

Implemented in SPxMainSM.

Referenced by SoPlex::getSlacks().

virtual void unsimplify ( const Vector ,
const Vector ,
const Vector ,
const Vector ,
const SPxSolver::VarStatus  [],
const SPxSolver::VarStatus  [] 
)
virtual

reconstructs an optimal solution for the unsimplified LP.

Reimplemented in SPxMainSM.

Definition at line 158 of file spxsimplifier.h.

Referenced by SoPlex::unsimplify().

Member Data Documentation

int m_chgBnds
protected
int m_chgLRhs
protected

number of change right-hand sides

Definition at line 61 of file spxsimplifier.h.

Referenced by SPxMainSM::handleExtremes(), SPxSimplifier::operator=(), SPxMainSM::simplify(), and SPxMainSM::simplifyRows().

const char* m_name
protected

name of the simplifier

Definition at line 49 of file spxsimplifier.h.

Referenced by SPxSimplifier::getName(), SPxSimplifier::operator=(), and SPxSimplifier::~SPxSimplifier().

Real m_objoffset
protected

objective offset

Definition at line 63 of file spxsimplifier.h.

Referenced by SPxSimplifier::addObjoffset(), SPxSimplifier::getObjoffset(), and SPxSimplifier::operator=().

int m_remCols
protected
Timer m_timeUsed
protected

user time used for simplification

Definition at line 51 of file spxsimplifier.h.

Referenced by SPxMainSM::simplify(), and SPxSimplifier::timeUsed().