SoPlex Doxygen Documentation
SPxDefaultRT Class Reference

Textbook ratio test for SoPlex.Class SPxDefaultRT provides an implementation of the textbook ratio test as a derived class of SPxRatioTester. This class is not intended for reliably solving LPs (even though it does the job for ``numerically simple'' LPs). Instead, it should serve as a demonstration of how to write ratio tester classes. More...

#include <spxdefaultrt.h>

Inheritance diagram for SPxDefaultRT:

Public Member Functions

Construction / destruction
 SPxDefaultRT ()
 default constructor
 
 SPxDefaultRT (const SPxDefaultRT &old)
 copy constructor
 
SPxDefaultRT & operator= (const SPxDefaultRT &rhs)
 assignment operator
 
virtual ~SPxDefaultRT ()
 destructor
 
virtual SPxRatioTester * clone () const
 clone function for polymorphism
 
Select enter/leave
virtual int selectLeave (Real &val, SPxId)
 
virtual SPxId selectEnter (Real &val, int)
 
- Public Member Functions inherited from SPxRatioTester
virtual const char * getName () const
 get name of ratio tester.
 
virtual void load (SPxSolver *p_solver)
 loads LP.
 
virtual void clear ()
 unloads LP.
 
virtual SPxSolver * solver () const
 returns loaded LP solver.
 
virtual void setDelta (Real newDelta)
 set allowed bound violation
 
virtual Real getDelta ()
 get allowed bound violation
 
virtual void setType (SPxSolver::Type)
 sets Simplex type.
 
 SPxRatioTester (const char *name)
 default constructor
 
 SPxRatioTester (const SPxRatioTester &old)
 copy constructor
 
SPxRatioTester & operator= (const SPxRatioTester &rhs)
 assignment operator
 
virtual ~SPxRatioTester ()
 destructor.
 

Additional Inherited Members

- Protected Attributes inherited from SPxRatioTester
SPxSolver * thesolver
 the solver
 
const char * m_name
 name of the ratio tester
 
SPxSolver::Type m_type
 internal storage of type
 
Real delta
 allowed bound violation
 

Detailed Description

Textbook ratio test for SoPlex.

Class SPxDefaultRT provides an implementation of the textbook ratio test as a derived class of SPxRatioTester. This class is not intended for reliably solving LPs (even though it does the job for ``numerically simple'' LPs). Instead, it should serve as a demonstration of how to write ratio tester classes.

See SPxRatioTester for a class documentation.

Definition at line 42 of file spxdefaultrt.h.

Constructor & Destructor Documentation

default constructor

Definition at line 50 of file spxdefaultrt.h.

Referenced by SPxDefaultRT::clone().

SPxDefaultRT ( const SPxDefaultRT &  old)

copy constructor

Definition at line 54 of file spxdefaultrt.h.

virtual ~SPxDefaultRT ( )
virtual

destructor

Definition at line 68 of file spxdefaultrt.h.

Member Function Documentation

virtual SPxRatioTester* clone ( ) const
virtual

clone function for polymorphism

Implements SPxRatioTester.

Definition at line 71 of file spxdefaultrt.h.

References SPxDefaultRT::SPxDefaultRT().

SPxDefaultRT& operator= ( const SPxDefaultRT &  rhs)

assignment operator

Definition at line 58 of file spxdefaultrt.h.

References SPxRatioTester::operator=().

int selectLeave ( Real &  val,
SPxId   
)
virtual

Here comes the ratio test for selecting a variable to leave the basis. It is assumed that Vec.delta() and fVec.idx() have been setup correctly!

The leaving variable is selected such that the update of fVec() (using fVec.value() * fVec.delta()) keeps the basis feasible within solver()->entertol(). Hence, fVec.value() must be chosen such that one updated value of theFvec just reaches its bound and no other one exceeds them by more than solver()->entertol(). Further, fVec.value() must have the same sign as argument val.

The return value of selectLeave() is the number of a variable in the basis selected to leave the basis. -1 indicates that no variable could be selected. Otherwise, parameter val contains the chosen fVec.value().

Implements SPxRatioTester.

Definition at line 42 of file spxdefaultrt.cpp.

References ASSERT_WARN, SPxRatioTester::delta, UpdateVector::delta(), SPxSolver::epsilon(), SPxSolver::fVec(), Vector::get_const_ptr(), UpdateVector::idx(), IdxSet::index(), soplex::infinity, SPxSolver::lbBound(), SSVector::setup(), IdxSet::size(), SPxRatioTester::solver(), SPxSolver::ubBound(), and SSVector::values().