38 for(
int i =
dim() - 1; i >= 0; --i)
42 MSG_DEBUG(std::cout <<
"DSHIFT08 theUBbound[" << i <<
"] violated by " <<
56 (*
theFvec)[i] - allow << std::endl);
70 MSG_DEBUG(std::cout <<
"DSHIFT01 shiftFvec: OK" << std::endl;)
96 for(i =
dim() - 1; i >= 0; --i)
107 (*theCoLbound)[i] = (*theCoUbound)[i];
117 (*theCoUbound)[i] = (*theCoLbound)[i];
122 for(i =
coDim() - 1; i >= 0; --i)
133 (*theLbound)[i] = (*theUbound)[i];
143 (*theUbound)[i] = (*theLbound)[i];
150 MSG_DEBUG(std::cout <<
"DSHIFT02 shiftPvec: OK" << std::endl;)
163 assert(uvec.
dim() == p_low.
dim());
164 assert(uvec.
dim() == p_up.
dim());
167 Real minrandom = 10.0 * p_delta;
168 Real maxrandom = 100.0 * p_delta;
176 for(i = uvec.
dim() - start - 1; i >= 0; i -= incr)
184 p_up[i] = x +
random.
next(minrandom, maxrandom);
190 p_low[i] = x -
random.
next(minrandom, maxrandom);
200 for(
int j = uvec.
delta().
size() - start - 1; j >= 0; j -= incr)
217 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
225 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
242 assert(uvec.
dim() == p_low.
dim());
243 assert(uvec.
dim() == p_up.
dim());
246 Real minrandom = 10.0 * p_delta;
247 Real maxrandom = 100.0 * p_delta;
255 for(i = uvec.
dim() - start - 1; i >= 0; i -= incr)
263 p_up[i] = x +
random.
next(minrandom, maxrandom);
269 p_low[i] = x -
random.
next(minrandom, maxrandom);
279 for(
int j = uvec.
delta().
size() - start - 1; j >= 0; j -= incr)
296 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
304 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
340 assert(uvec.
dim() == p_low.
dim());
341 assert(uvec.
dim() == p_up.
dim());
344 Real minrandom = 10.0 * p_delta;
345 Real maxrandom = 100.0 * p_delta;
354 for(i = uvec.
dim() - start - 1; i >= 0; i -= incr)
362 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
363 l_theShift += p_up[i] - u;
366 if(
GT(l, -
infinity) &&
NE(l, u) && l >= x - eps &&
rep() * stat[i] < 0)
368 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
369 l_theShift -= p_low[i] - l;
378 for(
int j = uvec.
delta().
size() - start - 1; j >= 0; j -= incr)
387 if(
LT(u,
infinity) &&
NE(l, u) && vec[i] >= u - eps &&
rep() * stat[i] < 0)
389 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
390 l_theShift += p_up[i] - u;
395 if(
GT(l, -
infinity) &&
NE(l, u) && vec[i] <= l + eps &&
rep() * stat[i] < 0)
397 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
398 l_theShift -= p_low[i] - l;
417 assert(uvec.
dim() == p_low.
dim());
418 assert(uvec.
dim() == p_up.
dim());
421 Real minrandom = 10.0 * p_delta;
422 Real maxrandom = 100.0 * p_delta;
431 for(i = uvec.
dim() - start - 1; i >= 0; i -= incr)
439 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
440 l_theShift += p_up[i] - u;
443 if(
GT(l, -
infinity) &&
NE(l, u) && l >= x - eps &&
rep() * stat[i] < 0)
445 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
446 l_theShift -= p_low[i] - l;
455 for(
int j = uvec.
delta().
size() - start - 1; j >= 0; j -= incr)
464 if(
LT(u,
infinity) &&
NE(l, u) && vec[i] >= u - eps &&
rep() * stat[i] < 0)
466 p_up[i] = vec[i] +
random.
next(minrandom, maxrandom);
467 l_theShift += p_up[i] - u;
472 if(
GT(l, -
infinity) &&
NE(l, u) && vec[i] <= l + eps &&
rep() * stat[i] < 0)
474 p_low[i] = vec[i] -
random.
next(minrandom, maxrandom);
475 l_theShift -= p_low[i] - l;
493 desc().coStatus(), 0, 1);
506 desc().coStatus(), 0, 1);
529 for(i =
dim(); i-- > 0;)
543 t_low =
lower(l_num);
553 if((*
theFvec)[i] > t_low - eps)
567 for(i =
nRows(); i-- > 0;)
582 for(i =
nCols(); i-- > 0;)
601 for(i =
dim(); i-- > 0;)
632 if((*
theFvec)[i] > t_low + eps)
639 for(i =
nRows(); i-- > 0;)
654 for(i =
nCols(); i-- > 0;)
678 for(i =
nRows(); i-- > 0;)
711 for(i =
nCols(); i-- > 0;)
713 t_up = t_low = -
maxObj(i);
718 if((*
thePvec)[i] < -t_up + eps)
728 if((*
thePvec)[i] > -t_low - eps)
748 for(i =
nRows(); i-- > 0;)
767 if((*
thePvec)[i] > t_low - eps)
778 for(i =
nCols(); i-- > 0;)
virtual void unShift(void)
remove shift as much as possible.
const VectorBase< R > & rhs() const
Returns right hand side vector.
SPxId coId(int i) const
id of i 'th covector.
const Vector & ucBound() const
int iteration() const
returns number of basis changes since last load().
virtual Real shift() const
total current shift amount.
const VectorBase< R > & upper() const
Returns upper bound vector.
SPxOut * spxout
message handler
THREADLOCAL const Real infinity
DVector * theUbound
Upper bound for vars.
Real leavetol() const
feasibility tolerance maintained by ratio test during LEAVE algorithm.
DVector * theCoUbound
Upper bound for covars.
Status & rowStatus(int i)
bool LT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a < b + eps
void clearDualBounds(SPxBasis::Desc::Status, Real &, Real &) const
virtual void perturbMaxLeave(void)
perturb nonbasic bounds.
bool NE(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| > eps
int number(const SPxRowId &id) const
Returns the row number of the row with identifier id.
const Vector & lcBound() const
virtual void perturbMinEnter(void)
int dim() const
dimension of basis matrix.
void shiftLBbound(int i, Real to)
shift i 'th lbBound to to.
virtual void perturbMaxEnter(void)
perturb basis bounds.
Desc::Status dualStatus(const SPxColId &id) const
dual Status for the column variable with ID id of the loaded LP.
const R * get_const_ptr() const
Conversion to C-style pointer.
Wrapper for different output streams and verbosity levels.
int nRows() const
Returns number of rows in LP.
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.
Status status() const
Status of solution process.
void shiftLPbound(int i, Real to)
shift i 'th lpBound to to.
bool GT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a > b + eps
DVector * theLbound
Lower bound for vars.
Real entertol() const
feasibility tolerance maintained by ratio test during ENTER algorithm.
const Vector & lbBound() const
lower bound for fVec.
const IdxSet & indices() const
Returns indices.
UpdateVector & fVec() const
feasibility vector.
DVector theLBbound
Lower Basic Feasibility bound.
bool isBasic(SPxBasis::Desc::Status stat) const
does stat describe a basic index ?
Real next(Real minimum=0.0, Real maximum=1.0)
returns next random number.
const VectorBase< R > & lhs() const
Returns left hand side vector.
void shiftPvec()
Perform initial shifting to optain an feasible or pricable basis.
Dense vector with semi-sparse vector for updatesIn many algorithms vectors are updated in every itera...
void shiftUCbound(int i, Real to)
shift i 'th ucBound to to.
DVector theURbound
Upper Row Feasibility bound.
const VectorBase< R > & maxRowObj() const
void shiftUBbound(int i, Real to)
shift i 'th ubBound to to.
Status & colStatus(int i)
DVector theUBbound
Upper Basic Feasibility bound.
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
DVector * theCoLbound
Lower bound for covars.
Real epsilon() const
values are considered to be 0.
Debugging, floating point type and parameter definitions.
UpdateVector & pVec() const
pricing vector.
bool fullPerturbation
whether to perturb the entire problem or just the bounds relevant for the current pivot ...
const Vector & lpBound() const
DVector theLRbound
Lower Row Feasibility bound.
void perturbMin(const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
DVector theUCbound
Upper Column Feasibility bound.
bool isInitialized() const
has the internal data been initialized?
int dim() const
Dimension of vector.
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.
void shiftLCbound(int i, Real to)
shift i 'th lcBound to to.
const VectorBase< R > & maxObj() const
Returns objective vector for maximization problem.
void setup()
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elemen...
DVector theLCbound
Lower Column Feasibility bound.
const Vector & upBound() const
virtual void perturbMinLeave(void)
void shiftFvec()
Perform initial shifting to optain an feasible or pricable basis.
Type type() const
returns the type of the id.
Type type() const
return current Type.
Real theShift
sum of all shifts applied to any bound.
int coDim() const
codimension.
Random random
The random number generator used throughout the whole computation. Its seed can be modified...
int nCols() const
Returns number of columns in LP.
dual variable has two bounds
void perturbMax(const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
SSVector & delta()
update vector , writeable
int index(int n) const
access n 'th index.
Status
Status of a variable.
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
const Desc & desc() const
Representation rep() const
return the current basis representation.
Set of indices.Class IdxSet provides a set of indices. At construction it must be given an array of i...
columnwise representation.