Fast shifting ratio test.Class SPxFastRT is an implementation class of SPxRatioTester providing fast and stable ratio test. Stability is achieved by allowing some infeasibility to ensure numerical stability such as the Harris procedure. Performance is achieved by skipping the second phase if the first phase already shows a stable enough pivot. More...
#include <spxfastrt.h>
Public Member Functions | |
Construction / destruction | |
SPxFastRT () | |
default constructor More... | |
SPxFastRT (const SPxFastRT &old) | |
copy constructor More... | |
SPxFastRT & | operator= (const SPxFastRT &rhs) |
assignment operator More... | |
SPxFastRT (const char *name) | |
bound flipping constructor More... | |
virtual | ~SPxFastRT () |
destructor More... | |
virtual SPxRatioTester< R > * | clone () const |
clone function for polymorphism More... | |
Access / modification | |
virtual void | load (SPxSolverBase< R > *solver) |
virtual int | selectLeave (R &val, R, bool polish=false) |
virtual SPxId | selectEnter (R &val, int, bool polish=false) |
virtual void | setType (typename SPxSolverBase< R >::Type type) |
virtual void | setDelta (R newDelta) |
virtual R | getDelta () |
Public Member Functions inherited from SPxRatioTester< R > | |
virtual const char * | getName () const |
get name of ratio tester. More... | |
virtual void | clear () |
unloads LP. More... | |
virtual SPxSolverBase< R > * | solver () const |
returns loaded LP solver. More... | |
SPxRatioTester (const char *name) | |
default constructor More... | |
SPxRatioTester (const SPxRatioTester &old) | |
copy constructor More... | |
SPxRatioTester & | operator= (const SPxRatioTester &rhs) |
assignment operator More... | |
virtual | ~SPxRatioTester () |
destructor. More... | |
Protected Member Functions | |
Private helpers | |
void | resetTols () |
resets tolerances (epsilon). More... | |
void | relax () |
relaxes stability requirements. More... | |
void | tighten () |
tightens stability requirements. More... | |
R | minStability (R maxabs) |
Compute stability requirement. More... | |
int | maxDelta (R &val, R &maxabs, UpdateVector< R > &update, const VectorBase< R > &lowBound, const VectorBase< R > &upBound, int start, int incr) const |
Max phase 1 value. More... | |
int | maxDelta (R &val, R &maxabs) |
SPxId | maxDelta (int &nr, R &val, R &maxabs) |
int | minDelta (R &val, R &maxabs, UpdateVector< R > &update, const VectorBase< R > &lowBound, const VectorBase< R > &upBound, int start, int incr) const |
Min phase 1 value. More... | |
int | minDelta (R &val, R &maxabs) |
SPxId | minDelta (int &nr, R &val, R &maxabs) |
int | maxSelect (R &val, R &stab, R &best, R &bestDelta, R max, const UpdateVector< R > &upd, const VectorBase< R > &low, const VectorBase< R > &up, int start=0, int incr=1) const |
selects stable index for maximizing ratio test. More... | |
int | maxSelect (R &val, R &stab, R &bestDelta, R max) |
SPxId | maxSelect (int &nr, R &val, R &stab, R &bestDelta, R max) |
int | minSelect (R &val, R &stab, R &best, R &bestDelta, R max, const UpdateVector< R > &upd, const VectorBase< R > &low, const VectorBase< R > &up, int start=0, int incr=1) const |
selects stable index for minimizing ratio test. More... | |
int | minSelect (R &val, R &stab, R &bestDelta, R max) |
SPxId | minSelect (int &nr, R &val, R &stab, R &bestDelta, R max) |
bool | minShortLeave (R &sel, int leave, R maxabs) |
tests for stop after phase 1. More... | |
bool | maxShortLeave (R &sel, int leave, R maxabs) |
bool | minReLeave (R &sel, int leave, R maxabs, bool polish=false) |
numerical stability tests. More... | |
bool | maxReLeave (R &sel, int leave, R maxabs, bool polish=false) |
bool | minReEnter (R &sel, R maxabs, const SPxId &id, int nr, bool polish=false) |
numerical stability check. More... | |
bool | maxReEnter (R &sel, R maxabs, const SPxId &id, int nr, bool polish=false) |
bool | shortEnter (const SPxId &enterId, int nr, R max, R maxabs) const |
Tests and returns whether a shortcut after phase 1 is feasible for the selected enter pivot. More... | |
Protected Attributes | |
Data | |
R | minStab |
parameter for computing minimum stability requirement More... | |
R | epsilon |
|value| < epsilon is considered 0. More... | |
R | fastDelta |
currently allowed infeasibility. More... | |
bool | iscoid |
flag used in methods minSelect/maxSelect to retrieve correct basis status More... | |
Protected Attributes inherited from SPxRatioTester< R > | |
SPxSolverBase< R > * | thesolver |
the solver More... | |
const char * | m_name |
name of the ratio tester More... | |
SPxSolverBase< R >::Type | m_type |
internal storage of type More... | |
R | delta |
allowed bound violation More... | |
Fast shifting ratio test.
Class SPxFastRT is an implementation class of SPxRatioTester providing fast and stable ratio test. Stability is achieved by allowing some infeasibility to ensure numerical stability such as the Harris procedure. Performance is achieved by skipping the second phase if the first phase already shows a stable enough pivot.
See SPxRatioTester for a class documentation.
Definition at line 42 of file spxfastrt.h.
SPxFastRT | ( | ) |
default constructor
Definition at line 173 of file spxfastrt.h.
Referenced by SPxFastRT< R >::clone().
copy constructor
Definition at line 181 of file spxfastrt.h.
SPxFastRT | ( | const char * | name | ) |
bound flipping constructor
Definition at line 203 of file spxfastrt.h.
|
virtual |
destructor
Definition at line 211 of file spxfastrt.h.
|
virtual |
clone function for polymorphism
Implements SPxRatioTester< R >.
Reimplemented in SPxBoundFlippingRT< R >.
Definition at line 214 of file spxfastrt.h.
References SPxFastRT< R >::load(), SPxFastRT< R >::selectEnter(), SPxFastRT< R >::selectLeave(), SPxFastRT< R >::setType(), SPxRatioTester< R >::solver(), and SPxFastRT< R >::SPxFastRT().
|
virtual |
Reimplemented from SPxRatioTester< R >.
Definition at line 241 of file spxfastrt.h.
References SPxFastRT< R >::fastDelta.
|
virtual |
Reimplemented from SPxRatioTester< R >.
Referenced by SPxFastRT< R >::clone().
|
protected |
Max phase 1 value.
Computes the maximum value val
that could be used for updating update
such that it would still fulfill the upper and lower bounds upBound
and lowBound
, respectively, within delta. Return value is the index where the maximum value is encountered. At the same time the maximum absolute value of update.delta()
is computed and returned in maxabs
. Internally all loops are started at start
and incremented by incr
.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
selects stable index for maximizing ratio test.
Selects from all update values val
< max
the one with the largest value of upd.delta()
which must be greater than stab
and is returned in stab
. The index is returned as well as the corresponding update value val
. Internally all loops are started at start
and incremented by incr
.
|
protected |
|
protected |
|
protected |
|
protected |
Min phase 1 value.
Computes the minimum value val
that could be used for updating update
such that it would still fulfill the upper and lower bounds upBound
and lowBound
, respectively, within delta. Return value is the index where the minimum value is encountered. At the same time the maximum absolute value of update.delta()
is computed and returned in maxabs
. Internally all loops are started at start
and incremented by incr
.
|
protected |
|
protected |
|
protected |
numerical stability check.
Tests whether the selected enter id
needs to be discarded (and do so) and the ratio test is to be recomputed.
|
protected |
numerical stability tests.
Tests whether the selected leave index needs to be discarded (and do so) and the ratio test is to be recomputed. If polish
is set to true no shifts are applied.
|
protected |
selects stable index for minimizing ratio test.
Select from all update values val
> max
the one with the largest value of upd.delta()
which must be greater than stab
and is returned in stab
. The index is returned as well as the corresponding update value val
. Internally all loops are started at start
and incremented by incr
.
|
protected |
|
protected |
|
protected |
tests for stop after phase 1.
Tests whether a shortcut after phase 1 is feasible for the selected leave pivot. In this case return the update value in sel
.
|
protected |
Compute stability requirement.
assignment operator
Definition at line 189 of file spxfastrt.h.
References SPxFastRT< R >::epsilon, SPxFastRT< R >::fastDelta, SPxFastRT< R >::minStab, and SPxRatioTester< R >::operator=().
Referenced by SPxBoundFlippingRT< R >::operator=().
|
protected |
relaxes stability requirements.
|
protected |
resets tolerances (epsilon).
|
virtual |
Implements SPxRatioTester< R >.
Reimplemented in SPxBoundFlippingRT< R >.
Referenced by SPxFastRT< R >::clone().
|
virtual |
Implements SPxRatioTester< R >.
Reimplemented in SPxBoundFlippingRT< R >.
Referenced by SPxFastRT< R >::clone().
|
virtual |
Reimplemented from SPxRatioTester< R >.
Definition at line 232 of file spxfastrt.h.
References DEFAULT_EPS_ZERO, and SPxRatioTester< R >::delta.
|
virtual |
Reimplemented from SPxRatioTester< R >.
Referenced by SPxFastRT< R >::clone().
|
protected |
Tests and returns whether a shortcut after phase 1 is feasible for the selected enter pivot.
|
protected |
tightens stability requirements.
|
protected |
|value| < epsilon is considered 0.
Definition at line 51 of file spxfastrt.h.
Referenced by SPxFastRT< R >::operator=().
|
protected |
currently allowed infeasibility.
Definition at line 53 of file spxfastrt.h.
Referenced by SPxFastRT< R >::getDelta(), and SPxFastRT< R >::operator=().
|
protected |
flag used in methods minSelect/maxSelect to retrieve correct basis status
Definition at line 55 of file spxfastrt.h.
|
protected |
parameter for computing minimum stability requirement
Definition at line 49 of file spxfastrt.h.
Referenced by SPxFastRT< R >::operator=().