19 #define DEVEX_REFINETOL 2.0 33 #ifdef ENABLE_CONSISTENCY_CHECKS 113 return viol * viol / tol;
115 return viol * viol / weight;
138 if(fTesti < -feastol)
154 for(
int i = 0; i < nsorted; ++i)
192 assert(retid < thesolver->dim());
207 for(; start < end; start += incr)
209 if(fTest[start] < -feastol)
318 assert(x < -feastol);
349 Real rhov_1 = 1 / rhoVec[n];
357 << rhoVec[n] <<
" with smaller absolute value than theeps = " <<
theeps << std::endl;)
366 for(i = len - 1; i >= 0; --i)
369 x = rhoVec[j] * rhoVec[j] * beta_q;
374 coWeights[n] = beta_q;
416 for(
int i = 0; i < nsorted; ++i)
469 for(
int i = 0; i < nsorted; ++i)
808 for(; start < end; start += incr)
842 for(; start < end; start += incr)
846 if(test[start] < -feastol)
875 if(n >= 0 && n < thesolver->dim())
887 xi_p = xi_p * xi_p *
last;
889 for(j = coPidx.
size() - 1; j >= 0; --j)
892 coWeights[i] += xi_p * coPvec[i] * coPvec[i];
894 if(coWeights[i] <= 1 || coWeights[i] > 1e+6)
901 for(j = pIdx.
size() - 1; j >= 0; --j)
904 weights[i] += xi_p * pVec[i] * pVec[i];
906 if(weights[i] <= 1 || weights[i] > 1e+6)
922 for(
int i = weights.
dim() - 1; i >= n; --i)
923 weights[i] = initval;
933 for(
int i = coWeights.
dim() - 1; i >= n; --i)
934 coWeights[i] = initval;
Rational spxAbs(const Rational &r)
Absolute.
SPxId coId(int i) const
id of i 'th covector.
virtual SPxId selectEnter()
DIdxSet bestPricesCo
set of best pricing candidates
void reDim(int newdim, const bool setZero=true)
Resets DVectorBase's dimension to newdim.
SPxId buildBestPriceVectorEnterCoDim(Real &best, Real feastol)
const Vector & fTest() const
Violations of fVec.
DIdxSet updateViols
store indices that were changed in the previous iteration and must be checked in hyper pricing ...
SPxOut * spxout
message handler
bool sparsePricingLeave
These values enable or disable sparse pricing.
THREADLOCAL const Real infinity
DataArray< IdxElement > pricesCo
temporary array of precomputed pricing values
virtual bool isConsistent() const
consistency check
T * get_ptr()
get a C pointer to the data.
Representation
LP basis representation.
bool sparsePricingEnterCo
true if sparsePricing is turned on in the entering Simplex
Real computePrice(Real viol, Real weight, Real tol)
DataArray< int > isInfeasible
0: index not violated, 1: index violated, 2: index violated and among candidate list ...
virtual void left4(int n, SPxId id)
SPxId selectEnterDenseCoDim(Real &best, Real feastol, int start=0, int incr=1)
SPxPricer::selectEnter() in dense case.
void clear()
removes all indices.
int lastUpdate() const
returns number of basis changes since last refactorization.
int dim() const
dimension of basis matrix.
void clear()
remove all elements.
SPxId buildBestPriceVectorEnterDim(Real &best, Real feastol)
build up vector of pricing values for later use
Real last
penalty, selected at last iteration.
SPxId selectEnterSparseCoDim(Real &best, Real feastol)
implementation of sparse pricing in the entering Simplex
int buildBestPriceVectorLeave(Real feastol)
build up vector of pricing values for later use
const R * get_const_ptr() const
Conversion to C-style pointer.
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
UpdateVector & coPvec() const
copricing vector.
void remove(int n, int m)
removes indices at position numbers n through m.
DataArray< IdxElement > prices
temporary array of precomputed pricing values
int selectLeaveSparse(Real feastol)
implementation of sparse pricing in the leaving Simplex
const R * values() const
Returns array values.
virtual void setType(SPxSolver::Type)
set entering/leaving algorithm
virtual void setRep(SPxSolver::Representation)
set row/column representation
int size() const
returns the number of used indices.
void setupWeights(SPxSolver::Type)
set entering/leaving algorithm
void append(const T &t)
append element t.
SPxId id(int i) const
id of i 'th vector.
UpdateVector & fVec() const
feasibility vector.
void addIdx(int i)
adds index i to the index set
const T * get_const_ptr() const
get a const C pointer to the data.
DVector coWeights
store dual norms
SPxSolver * thesolver
the solver
SPxId selectEnterHyperCoDim(Real &best, Real feastol)
implementation of hyper sparse pricing in the entering Simplex
bool sparsePricingEnter
true if sparsePricing is turned on in the entering Simplex for slack variables
const Vector & test() const
Violations of pVec.
DIdxSet bestPrices
set of best pricing candidates
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
Real epsilon() const
values are considered to be 0.
Debugging, floating point type and parameter definitions.
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
UpdateVector & pVec() const
pricing vector.
R length2() const
Squared euclidian norm.
int dim() const
Dimension of vector.
Everything should be within this namespace.
const IdxSet & idx() const
nonzero indices of update vector
int selectLeaveHyper(Real feastol)
implementation of hyper sparse pricing in the leaving Simplex
virtual int selectLeave()
bool refined
has a refinement step already been tried?
#define SPARSITY_TRADEOFF
int SPxQuicksortPart(T *keys, COMPARATOR &compare, int start, int end, int size, int start2=0, int end2=0, bool type=true)
Generic implementation of Partial QuickSort.
SPxId selectEnterHyperDim(Real &best, Real feastol)
implementation of hyper sparse pricing in the entering Simplex
Real theeps
violation bound
const Vector & coTest() const
violations of coPvec.
int selectLeaveX(Real feastol, int start=0, int incr=1)
internal implementation of SPxPricer::selectLeave()
bool isValid() const
returns TRUE iff the id is a valid column or row identifier.
virtual void entered4(SPxId id, int n)
int size() const
return nr. of elements.
Type type() const
return current Type.
DataArray< int > isInfeasibleCo
0: index not violated, 1: index violated, 2: index violated and among candidate list ...
int coDim() const
codimension.
bool hyperPricingEnter
true if hyper sparse pricing is turned on in the entering Simplex
virtual void addedCoVecs(int n)
n covectors have been added to loaded LP.
DVector weights
dual pricing norms
#define MSGinconsistent(name)
bool weightsAreSetup
are the dual norms already set up?
virtual void load(SPxSolver *base)
sets the solver
SSVector & delta()
update vector , writeable
void reMax(int newMax=1, int newSize=-1)
reset maximum number of elements.
SPxId selectEnterSparseDim(Real &best, Real feastol)
implementation of sparse pricing in the entering Simplex (slack variables)
int index(int n) const
access n 'th index.
SPxId selectEnterDenseDim(Real &best, Real feastol, int start=0, int incr=1)
SPxPricer::selectEnter() in dense case (slack variabels)
void setMax(int newmax=1)
sets the maximum number of indices.
const SPxBasis & basis() const
Return current basis.
DIdxSet infeasibilitiesCo
bool hyperPricingLeave
true if hyper sparse pricing is turned on in the leaving Simplex
const IdxElement * elements
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...
virtual void addedVecs(int n)
n vectors have been added to loaded LP.
SPxId selectEnterX(Real tol)
choose the best entering index among columns and rows but prefer sparsity