Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implementation of the bound flipping ratio test as a derived class of SPxRatioTester. Dual step length is increased beyond some breakpoints and corresponding primal nonbasic variables are set to their other bound to handle the resulting dual infeasibility. More...
#include <spxboundflippingrt.h>
Classes | |
struct | Breakpoint |
struct | BreakpointCompare |
Public Member Functions | |
Construction / destruction | |
SPxBoundFlippingRT () | |
default constructor More... | |
SPxBoundFlippingRT (const SPxBoundFlippingRT &old) | |
copy constructor More... | |
SPxBoundFlippingRT & | operator= (const SPxBoundFlippingRT &rhs) |
assignment operator More... | |
virtual | ~SPxBoundFlippingRT () |
destructor More... | |
virtual SPxRatioTester< R > * | clone () const |
clone function for polymorphism More... | |
Select enter/leave | |
virtual int | selectLeave (R &val, R enterTest, bool polish=false) |
virtual SPxId | selectEnter (R &val, int leaveIdx, bool polish=false) |
void | useBoundFlips (bool bf) |
void | useBoundFlipsRow (bool bf) |
Public Member Functions inherited from SPxFastRT< R > | |
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 void | load (SPxSolverBase< R > *solver) |
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... | |
Private Types | |
substructures | |
enum | BreakpointSource { FVEC = -1, PVEC = 0, COPVEC = 1 } |
Private Member Functions | |
void | collectBreakpointsMax (int &nBp, int &minIdx, const int *idx, int nnz, const R *upd, const R *vec, const R *upp, const R *low, BreakpointSource src) |
void | collectBreakpointsMin (int &nBp, int &minIdx, const int *idx, int nnz, const R *upd, const R *vec, const R *upp, const R *low, BreakpointSource src) |
bool | getData (R &val, SPxId &enterId, int idx, R stab, R degeneps, const R *upd, const R *vec, const R *low, const R *upp, BreakpointSource src, R max) |
bool | getData (R &val, int &leaveIdx, int idx, R stab, R degeneps, const R *upd, const R *vec, const R *low, const R *upp, BreakpointSource src, R max) |
void | flipAndUpdate (int &usedBp) |
Static Private Member Functions | |
static bool | isSmaller (Breakpoint x, Breakpoint y) |
Private Attributes | |
Data | |
bool | enableBoundFlips |
bool | enableRowBoundFlips |
R | flipPotential |
int | relax_count |
Array< Breakpoint > | breakpoints |
SSVectorBase< R > | updPrimRhs |
SSVectorBase< R > | updPrimVec |
Additional Inherited Members | |
Protected Member Functions inherited from SPxFastRT< R > | |
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 inherited from SPxFastRT< R > | |
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... | |
Bound flipping ratio test ("long step dual") for SoPlex.
Class SPxBoundFlippingRT provides an implementation of the bound flipping ratio test as a derived class of SPxRatioTester. Dual step length is increased beyond some breakpoints and corresponding primal nonbasic variables are set to their other bound to handle the resulting dual infeasibility.
The implementation mostly follows the papers
See SPxRatioTester for a class documentation.
Definition at line 51 of file spxboundflippingrt.h.
|
private |
enumerator to remember which vector we have been searching to find a breakpoint
Enumerator | |
---|---|
FVEC | |
PVEC | |
COPVEC |
Definition at line 58 of file spxboundflippingrt.h.
default constructor
Definition at line 189 of file spxboundflippingrt.h.
Referenced by SPxBoundFlippingRT< R >::clone().
SPxBoundFlippingRT | ( | const SPxBoundFlippingRT< R > & | old | ) |
copy constructor
Definition at line 200 of file spxboundflippingrt.h.
|
virtual |
destructor
Definition at line 225 of file spxboundflippingrt.h.
|
virtual |
clone function for polymorphism
Reimplemented from SPxFastRT< R >.
Definition at line 228 of file spxboundflippingrt.h.
References SPxBoundFlippingRT< R >::selectEnter(), SPxBoundFlippingRT< R >::selectLeave(), SPxBoundFlippingRT< R >::SPxBoundFlippingRT(), and SPxBoundFlippingRT< R >::Breakpoint::val.
|
private |
store all available pivots/breakpoints in an array (positive pivot search direction)
nBp | number of found breakpoints so far |
minIdx | index to current minimal breakpoint |
idx | pointer to indices of current vector |
nnz | number of nonzeros in current vector |
upd | pointer to update values of current vector |
vec | pointer to values of current vector |
upp | pointer to upper bound/rhs of current vector |
low | pointer to lower bound/lhs of current vector |
src | type of vector (pVec or coPvec) |
|
private |
store all available pivots/breakpoints in an array (negative pivot search direction)
nBp | number of found breakpoints so far |
minIdx | index to current minimal breakpoint |
idx | pointer to indices of current vector |
nnz | number of nonzeros in current vector |
upd | pointer to update values of current vector |
vec | pointer to values of current vector |
upp | pointer to upper bound/rhs of current vector |
low | pointer to lower bound/lhs of current vector |
src | type of vector (pVec or coPvec) |
|
private |
perform necessary bound flips to restore dual feasibility
usedBp | number of bounds that should be flipped |
|
private |
get values for entering index and perform shifts if necessary
|
private |
get values for leaving index and perform shifts if necessary
|
staticprivate |
comparison method for breakpoints
Definition at line 175 of file spxboundflippingrt.h.
References soplex::spxAbs(), and SPxBoundFlippingRT< R >::Breakpoint::val.
SPxBoundFlippingRT& operator= | ( | const SPxBoundFlippingRT< R > & | rhs | ) |
assignment operator
Definition at line 211 of file spxboundflippingrt.h.
References SPxBoundFlippingRT< R >::enableBoundFlips, SPxBoundFlippingRT< R >::enableRowBoundFlips, SPxBoundFlippingRT< R >::flipPotential, and SPxFastRT< R >::operator=().
|
virtual |
Reimplemented from SPxFastRT< R >.
Referenced by SPxBoundFlippingRT< R >::clone().
|
virtual |
Reimplemented from SPxFastRT< R >.
Referenced by SPxBoundFlippingRT< R >::clone().
void useBoundFlips | ( | bool | bf | ) |
Definition at line 250 of file spxboundflippingrt.h.
void useBoundFlipsRow | ( | bool | bf | ) |
Definition at line 255 of file spxboundflippingrt.h.
|
private |
array of breakpoints
Definition at line 106 of file spxboundflippingrt.h.
|
private |
enable or disable long steps in BoundFlippingRT
Definition at line 101 of file spxboundflippingrt.h.
Referenced by SPxBoundFlippingRT< R >::operator=().
|
private |
enable bound flips also for row representation
Definition at line 102 of file spxboundflippingrt.h.
Referenced by SPxBoundFlippingRT< R >::operator=().
|
private |
tracks bound flip history and decides which ratio test to use
Definition at line 104 of file spxboundflippingrt.h.
Referenced by SPxBoundFlippingRT< R >::operator=().
|
private |
count rounds of ratio test
Definition at line 105 of file spxboundflippingrt.h.
|
private |
right hand side vector of additional system to be solved after the ratio test
Definition at line 108 of file spxboundflippingrt.h.
|
private |
allocation of memory for additional solution vector
Definition at line 110 of file spxboundflippingrt.h.