Fast shifting ratio test. 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... | |
virtual void | setTolerances (std::shared_ptr< Tolerances > newTolerances) |
set the _tolerances member variable More... | |
const std::shared_ptr< Tolerances > | tolerances () const |
get the _tolerances member variable 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... | |
const R | epsilonZero () const |
return 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 |
zero tolerance used by the ratio tester 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... | |
std::shared_ptr< Tolerances > | _tolerances |
tolerances used by the solver 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 53 of file spxfastrt.h.
SPxFastRT | ( | ) |
default constructor
Definition at line 189 of file spxfastrt.h.
Referenced by SPxFastRT< R >::clone().
copy constructor
Definition at line 197 of file spxfastrt.h.
SPxFastRT | ( | const char * | name | ) |
bound flipping constructor
Definition at line 219 of file spxfastrt.h.
|
virtual |
destructor
Definition at line 227 of file spxfastrt.h.
|
virtual |
clone function for polymorphism
Implements SPxRatioTester< R >.
Reimplemented in SPxBoundFlippingRT< R >, and SPxBoundFlippingRT< BP >.
Definition at line 230 of file spxfastrt.h.
References SPxFastRT< R >::SPxFastRT().
|
protected |
|
virtual |
Reimplemented from SPxRatioTester< R >.
Definition at line 257 of file spxfastrt.h.
References SPxFastRT< R >::fastDelta.
|
virtual |
Reimplemented from SPxRatioTester< R >.
|
protected |
|
protected |
|
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 |
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 |
|
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 |
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 |
|
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 |
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 205 of file spxfastrt.h.
References SPxFastRT< R >::epsilon, SPxFastRT< R >::fastDelta, SPxFastRT< R >::iscoid, 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< BP >, and SPxBoundFlippingRT< R >.
|
virtual |
Implements SPxRatioTester< R >.
Reimplemented in SPxBoundFlippingRT< BP >, and SPxBoundFlippingRT< R >.
|
virtual |
Reimplemented from SPxRatioTester< R >.
Definition at line 248 of file spxfastrt.h.
References SPxRatioTester< R >::delta, SPxFastRT< R >::epsilon, SPxFastRT< R >::fastDelta, and SPxRatioTester< R >::tolerances().
|
virtual |
Reimplemented from SPxRatioTester< R >.
|
protected |
Tests and returns whether a shortcut after phase 1 is feasible for the selected enter pivot.
|
protected |
tightens stability requirements.
|
protected |
zero tolerance used by the ratio tester
Definition at line 62 of file spxfastrt.h.
Referenced by SPxFastRT< R >::epsilonZero(), SPxFastRT< R >::operator=(), and SPxFastRT< R >::setDelta().
|
protected |
currently allowed infeasibility.
Definition at line 64 of file spxfastrt.h.
Referenced by SPxFastRT< R >::getDelta(), SPxFastRT< R >::operator=(), and SPxFastRT< R >::setDelta().
|
protected |
flag used in methods minSelect/maxSelect to retrieve correct basis status
Definition at line 66 of file spxfastrt.h.
Referenced by SPxFastRT< R >::operator=().
|
protected |
parameter for computing minimum stability requirement
Definition at line 60 of file spxfastrt.h.
Referenced by SPxFastRT< R >::operator=().