SoPlex Documentation
Loading...
Searching...
No Matches
SPxSimplifier< R > Class Template Referenceabstract

LP simplification abstract base class. More...

#include <spxsimplifier.h>

Inheritance diagram for SPxSimplifier< R >:
Presol< R > SPxMainSM< R >

Public Member Functions

void setOutstream (SPxOut &newOutstream)
 
Access / modfication
virtual const chargetName () const
 get name of simplifier.
 
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.
 
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.
 
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 charm_name
 name of the simplifier
 
Timerm_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
 
SPxOutspxout
 message handler
 

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
 
SPxSimplifieroperator= (const SPxSimplifier &rhs)
 assignment operator
 
virtual ~SPxSimplifier ()
 destructor.
 
virtual SPxSimplifierclone () const =0
 clone function for polymorphism
 

Detailed Description

template<class R>
class soplex::SPxSimplifier< R >

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.

Member Enumeration Documentation

◆ Result

template<class R >
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 91 of file spxsimplifier.h.

Constructor & Destructor Documentation

◆ SPxSimplifier() [1/2]

template<class R >
SPxSimplifier ( const char * p_name,
Timer::TYPE ttype = Timer::USER_TIME )
explicit

◆ SPxSimplifier() [2/2]

◆ ~SPxSimplifier()

template<class R >
virtual ~SPxSimplifier ( )
virtual

Member Function Documentation

◆ addObjoffset()

template<class R >
virtual void addObjoffset ( const R val)
virtual

add objective offset.

Definition at line 240 of file spxsimplifier.h.

References SPxSimplifier< R >::m_objoffset.

◆ clone()

template<class R >
virtual SPxSimplifier * clone ( ) const
pure virtual

clone function for polymorphism

Implemented in SPxMainSM< R >, and Presol< R >.

◆ getBasis()

template<class R >
virtual void getBasis ( typename SPxSolverBase< R >::VarStatus [],
typename SPxSolverBase< R >::VarStatus [],
const int rowsSize = -1,
const int colsSize = -1 ) const
pure virtual

get optimal basis.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ getBasisColStatus()

template<class R >
virtual SPxSolverBase< R >::VarStatus getBasisColStatus ( int ) const
pure virtual

gets basis status for a single column.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ getBasisRowStatus()

template<class R >
virtual SPxSolverBase< R >::VarStatus getBasisRowStatus ( int ) const
pure virtual

gets basis status for a single row.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ getName()

template<class R >
virtual const char * getName ( ) const
virtual

get name of simplifier.

Definition at line 181 of file spxsimplifier.h.

References SPxSimplifier< R >::m_name.

◆ getObjoffset()

template<class R >
virtual R getObjoffset ( ) const
virtual

get objective offset.

Definition at line 234 of file spxsimplifier.h.

References SPxSimplifier< R >::m_objoffset.

◆ isConsistent()

template<class R >
virtual bool isConsistent ( ) const
virtual

◆ isUnsimplified()

template<class R >
virtual bool isUnsimplified ( ) const
virtual

specifies whether an optimal solution has already been unsimplified.

Reimplemented in SPxMainSM< R >, and Presol< R >.

Definition at line 207 of file spxsimplifier.h.

◆ operator=()

◆ result()

template<class R >
virtual Result result ( ) const
pure virtual

returns result status of the simplification

Implemented in SPxMainSM< R >, and Presol< R >.

◆ setMinReduction()

template<class R >
virtual void setMinReduction ( const R minRed)
virtual

set minimal reduction threshold to continue simplification

Definition at line 246 of file spxsimplifier.h.

References SPxSimplifier< R >::m_minReduction.

◆ setOutstream()

template<class R >
void setOutstream ( SPxOut & newOutstream)

Definition at line 263 of file spxsimplifier.h.

References SPxSimplifier< R >::spxout.

◆ simplify() [1/2]

template<class R >
virtual Result simplify ( SPxLPBase< R > & lp,
R eps,
R delta,
Real remainingTime )
pure virtual

simplify SPxLP lp with identical primal and dual feasibility tolerance.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ simplify() [2/2]

template<class R >
virtual Result simplify ( SPxLPBase< R > & lp,
R eps,
R feastol,
R opttol,
Real remainingTime,
bool keepbounds = false,
uint32_t seed = 0 )
pure virtual

simplify SPxLP lp with independent primal and dual feasibility tolerance.

Implemented in Presol< R >, and SPxMainSM< R >.

◆ timeUsed()

template<class R >
virtual R timeUsed ( ) const
virtual

Definition at line 185 of file spxsimplifier.h.

References SPxSimplifier< R >::m_timeUsed, and Timer::time().

◆ unsimplifiedDual()

template<class R >
virtual const VectorBase< R > & unsimplifiedDual ( )
pure virtual

returns a reference to the unsimplified dual solution.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ unsimplifiedPrimal()

template<class R >
virtual const VectorBase< R > & unsimplifiedPrimal ( )
pure virtual

returns a reference to the unsimplified primal solution.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ unsimplifiedRedCost()

template<class R >
virtual const VectorBase< R > & unsimplifiedRedCost ( )
pure virtual

returns a reference to the unsimplified reduced costs.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ unsimplifiedSlacks()

template<class R >
virtual const VectorBase< R > & unsimplifiedSlacks ( )
pure virtual

returns a reference to the unsimplified slack values.

Implemented in SPxMainSM< R >, and Presol< R >.

◆ unsimplify()

template<class R >
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 )
pure virtual

reconstructs an optimal solution for the unsimplified LP.

Implemented in Presol< R >, and SPxMainSM< R >.

Member Data Documentation

◆ m_chgBnds

template<class R >
int m_chgBnds
protected

number of changed bounds

Definition at line 70 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_chgLRhs

template<class R >
int m_chgLRhs
protected

number of change right-hand sides

Definition at line 72 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_keptBnds

template<class R >
int m_keptBnds
protected

number of kept bounds

Definition at line 74 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_keptLRhs

template<class R >
int m_keptLRhs
protected

number of kept left- and right-hand sides

Definition at line 76 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_minReduction

template<class R >
R m_minReduction
protected

minimal reduction (sum of removed rows/cols) to continue simplification

Definition at line 80 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=(), and SPxSimplifier< R >::setMinReduction().

◆ m_name

template<class R >
const char* m_name
protected

name of the simplifier

Definition at line 59 of file spxsimplifier.h.

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

◆ m_objoffset

template<class R >
R m_objoffset
protected

◆ m_remCols

template<class R >
int m_remCols
protected

number of removed columns

Definition at line 66 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_remNzos

template<class R >
int m_remNzos
protected

number of removed nonzero coefficients

Definition at line 68 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_remRows

template<class R >
int m_remRows
protected

number of removed rows

Definition at line 64 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=().

◆ m_timerType

template<class R >
Timer::TYPE m_timerType
protected

◆ m_timeUsed

◆ spxout

template<class R >
SPxOut* spxout
protected

message handler

Definition at line 82 of file spxsimplifier.h.

Referenced by SPxSimplifier< R >::operator=(), and SPxSimplifier< R >::setOutstream().