69 themax = (x > themax) ? x : themax;
70 x = (up[i] - vec[i] +
delta) / x;
74 else if (x < -epsilon)
76 themax = (-x > themax) ? -x : themax;
77 x = (low[i] - vec[i] -
delta) / x;
78 if (x < theval && low[i] > -
infinity)
120 themax = (x > themax) ? x : themax;
121 x = (low[i] - vec[i] -
delta) / x;
122 if (x > theval && low[i] > -
infinity)
125 else if (x < -epsilon)
127 themax = (-x > themax) ? -x : themax;
128 x = (up[i] - vec[i] +
delta) / x;
169 assert(
delta > epsilon);
171 assert(
solver()->maxCycle() > 0);
199 useeps = maxabs * epsilon * 0.001;
200 if (useeps < epsilon)
202 for (j = upd.
size() - 1; j >= 0; --j)
214 if (y <= max && y > sel - epsilon && x > stab)
222 else if (x < -useeps)
230 if (y <= max && y > sel - epsilon && -x > stab)
244 else if (max < -epsilon)
264 useeps = maxabs * epsilon * 0.001;
265 if (useeps < epsilon)
267 for (j = upd.
size() - 1; j >= 0; --j)
279 if (y >= max && y < sel + epsilon && -x > stab)
295 if (y >= max && y < sel + epsilon && x > stab)
312 if (lastshift !=
solver()->shift())
336 Real minStability = 0.0001;
351 assert(
delta > epsilon);
353 assert(
solver()->maxCycle() > 0);
366 assert(
delta > epsilon);
398 ruseeps = rmaxabs * 0.001 * epsilon;
399 if (ruseeps < epsilon)
401 cuseeps = cmaxabs * 0.001 * epsilon;
402 if (cuseeps < epsilon)
404 for (j = pupd.
size() - 1; j >= 0; --j)
410 y = upb[i] - pvec[i];
416 if (y <= max && x >= stab)
425 else if (x < -ruseeps)
427 y = lpb[i] - pvec[i];
433 if (y <= max && -x >= stab)
444 MSG_DEBUG( std::cout <<
"DHARRI01 removing value " << pupd[i] << std::endl; )
448 for (j = cupd.
size() - 1; j >= 0; --j)
454 y = ucb[i] - cvec[i];
460 if (y <= max && x >= stab)
469 else if (x < -cuseeps)
471 y = lcb[i] - cvec[i];
477 if (y <= max && -x >= stab)
488 MSG_DEBUG( std::cout <<
"DHARRI02 removing value " << cupd[i] << std::endl; )
493 if (lastshift ==
solver()->shift())
497 if (
solver()->isBasic(enterId))
508 if (
solver()->isBasic(enterId))
518 sel = upb[pnr] - pvec[pnr];
519 if (x < minStability && sel <
delta)
528 sel = lpb[pnr] - pvec[pnr];
529 if (-x < minStability && -sel <
delta)
552 else if (val < -epsilon)
560 assert(
delta > epsilon);
595 ruseeps = rmaxabs * epsilon * 0.001;
596 cuseeps = cmaxabs * epsilon * 0.001;
597 for (j = pupd.
size() - 1; j >= 0; --j)
603 y = lpb[i] - pvec[i];
609 if (y >= max && x > stab)
618 else if (x < -ruseeps)
620 y = upb[i] - pvec[i];
626 if (y >= max && -x > stab)
637 MSG_DEBUG( std::cout <<
"DHARRI03 removing value " << pupd[i] << std::endl; )
641 for (j = cupd.
size() - 1; j >= 0; --j)
647 y = lcb[i] - cvec[i];
653 if (y >= max && x > stab)
662 else if (x < -cuseeps)
664 y = ucb[i] - cvec[i];
670 if (y >= max && -x > stab)
681 MSG_DEBUG( std::cout <<
"DHARRI04 removing value " << x << std::endl; );
686 if (lastshift ==
solver()->shift())
690 if (
solver()->isBasic(enterId))
701 if (
solver()->isBasic(enterId))
711 sel = lpb[pnr] - pvec[pnr];
712 if (x < minStability && -sel <
delta)
721 sel = upb[pnr] - pvec[pnr];
722 if (-x < minStability && sel <
delta)
744 assert(max * val >= 0);
SPxId coId(int i) const
id of i 'th covector.
const Vector & ucBound() const
virtual Real shift() const
total current shift amount.
virtual SPxId selectEnter(Real &val, int, bool)
THREADLOCAL const Real infinity
Real delta
allowed bound violation
virtual int selectLeave(Real &val, Real, bool)
void inValidate()
makes the id invalid.
void setValue(int i, R x)
Sets i 'th element to x.
Real degenerateEps() const
const Vector & lcBound() const
void shiftLBbound(int i, Real to)
shift i 'th lbBound to to.
int maxCycle() const
maximum number of degenerate simplex steps before we detect cycling.
const R * get_const_ptr() const
Conversion to C-style pointer.
const Vector & ubBound() const
upper bound for fVec.
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
UpdateVector & coPvec() const
copricing vector.
const R * values() const
Returns array values.
void shiftLPbound(int i, Real to)
shift i 'th lpBound to to.
const Vector & lbBound() const
lower bound for fVec.
SPxId id(int i) const
id of i 'th vector.
UpdateVector & fVec() const
feasibility vector.
void clearNum(int n)
Sets n 'th nonzero element to 0 (index n must exist).
int minDelta(Real *, Real *val, int num, const int *idx, const Real *upd, const Real *vec, const Real *low, const Real *up, Real epsilon) const
Real delta() const
guaranteed primal and dual bound violation for optimal solution, returning the maximum of feastol() a...
int maxDelta(Real *, Real *val, int num, const int *idx, const Real *upd, const Real *vec, const Real *low, const Real *up, Real epsilon) const
void shiftUCbound(int i, Real to)
shift i 'th ucBound to to.
int index(int n) const
Returns index of the n 'th nonzero element.
void shiftUBbound(int i, Real to)
shift i 'th ubBound to to.
const int * indexMem() const
Returns array indices.
Real epsilon() const
values are considered to be 0.
Debugging, floating point type and parameter definitions.
UpdateVector & pVec() const
pricing vector.
const Vector & lpBound() const
int size() const
Returns the number of nonzeros.
Everything should be within this namespace.
void shiftUPbound(int i, Real to)
shift i 'th upBound to to.
Harris pricing with shifting.
void shiftLCbound(int i, Real to)
shift i 'th lcBound to to.
virtual SPxSolver * solver() const
returns loaded LP solver.
void setup()
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elemen...
int numCycle() const
actual number of degenerate simplex steps encountered so far.
const Vector & upBound() const
Type type() const
returns the type of the id.
const SVector & vector(int i) const
i 'th vector.
SSVector & delta()
update vector , writeable