70 themax = (x > themax) ? x : themax;
71 x = (up[i] - vec[i] +
delta) / x;
78 themax = (-x > themax) ? -x : themax;
79 x = (low[i] - vec[i] -
delta) / x;
125 themax = (x > themax) ? x : themax;
126 x = (low[i] - vec[i] -
delta) / x;
128 if(x > theval && low[i] > -
infinity)
131 else if(x < -epsilon)
133 themax = (-x > themax) ? -x : themax;
134 x = (up[i] - vec[i] +
delta) / x;
177 assert(
delta > epsilon);
179 assert(
solver()->maxCycle() > 0);
207 useeps = maxabs * epsilon * 0.001;
212 for(j = upd.
size() - 1; j >= 0; --j)
227 if(y <= max && y > sel - epsilon && x > stab)
245 if(y <= max && y > sel - epsilon && -x > stab)
259 else if(max < -epsilon)
279 useeps = maxabs * epsilon * 0.001;
284 for(j = upd.
size() - 1; j >= 0; --j)
299 if(y >= max && y < sel + epsilon && -x > stab)
317 if(y >= max && y < sel + epsilon && x > stab)
334 if(lastshift !=
solver()->shift())
358 Real minStability = 0.0001;
373 assert(
delta > epsilon);
375 assert(
solver()->maxCycle() > 0);
388 assert(
delta > epsilon);
420 ruseeps = rmaxabs * 0.001 * epsilon;
422 if(ruseeps < epsilon)
425 cuseeps = cmaxabs * 0.001 * epsilon;
427 if(cuseeps < epsilon)
430 for(j = pupd.
size() - 1; j >= 0; --j)
437 y = upb[i] - pvec[i];
445 if(y <= max && x >= stab)
454 else if(x < -ruseeps)
456 y = lpb[i] - pvec[i];
464 if(y <= max && -x >= stab)
475 MSG_DEBUG(std::cout <<
"DHARRI01 removing value " << pupd[i] << std::endl;)
480 for(j = cupd.
size() - 1; j >= 0; --j)
487 y = ucb[i] - cvec[i];
495 if(y <= max && x >= stab)
504 else if(x < -cuseeps)
506 y = lcb[i] - cvec[i];
514 if(y <= max && -x >= stab)
525 MSG_DEBUG(std::cout <<
"DHARRI02 removing value " << cupd[i] << std::endl;)
530 if(lastshift ==
solver()->shift())
534 if(
solver()->isBasic(enterId))
546 if(
solver()->isBasic(enterId))
557 sel = upb[pnr] - pvec[pnr];
559 if(x < minStability && sel <
delta)
568 sel = lpb[pnr] - pvec[pnr];
570 if(-x < minStability && -sel <
delta)
595 else if(val < -epsilon)
603 assert(
delta > epsilon);
638 ruseeps = rmaxabs * epsilon * 0.001;
639 cuseeps = cmaxabs * epsilon * 0.001;
641 for(j = pupd.
size() - 1; j >= 0; --j)
648 y = lpb[i] - pvec[i];
656 if(y >= max && x > stab)
665 else if(x < -ruseeps)
667 y = upb[i] - pvec[i];
675 if(y >= max && -x > stab)
686 MSG_DEBUG(std::cout <<
"DHARRI03 removing value " << pupd[i] << std::endl;)
691 for(j = cupd.
size() - 1; j >= 0; --j)
698 y = lcb[i] - cvec[i];
706 if(y >= max && x > stab)
715 else if(x < -cuseeps)
717 y = ucb[i] - cvec[i];
725 if(y >= max && -x > stab)
736 MSG_DEBUG(std::cout <<
"DHARRI04 removing value " << x << std::endl;);
741 if(lastshift ==
solver()->shift())
745 if(
solver()->isBasic(enterId))
757 if(
solver()->isBasic(enterId))
768 sel = lpb[pnr] - pvec[pnr];
770 if(x < minStability && -sel <
delta)
779 sel = upb[pnr] - pvec[pnr];
781 if(-x < minStability && sel <
delta)
807 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