19 #define DEVEX_REFINETOL 2.0 33 #ifdef ENABLE_CONSISTENCY_CHECKS 105 return viol * viol / tol;
107 return viol * viol / weight;
129 if (fTesti < -feastol)
143 for(
int i = 0; i < nsorted; ++i )
181 assert(retid < thesolver->dim());
196 for (; start < end; start += incr)
198 if (fTest[start] < -feastol)
297 assert(x < -feastol);
324 Real rhov_1 = 1 / rhoVec[n];
331 << rhoVec[n] <<
" with smaller absolute value than theeps = " <<
theeps << std::endl; )
338 for (i = len - 1; i >= 0; --i)
341 x = rhoVec[j] * rhoVec[j] * beta_q;
385 for(
int i = 0; i < nsorted; ++i )
435 for(
int i = 0; i < nsorted; ++i )
745 for (; start < end; start += incr)
776 for (; start < end; start += incr)
779 if (test[start] < -feastol)
804 if (n >= 0 && n < thesolver->dim())
816 xi_p = xi_p * xi_p *
last;
818 for (j = coPidx.
size() - 1; j >= 0; --j)
821 coWeights[i] += xi_p * coPvec[i] * coPvec[i];
829 for (j = pIdx.
size() - 1; j >= 0; --j)
832 weights[i] += xi_p * pVec[i] * pVec[i];
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)
DVector weights
vector to store pricing weights or norms
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.
void init(SPxSolver::Type)
set entering/leaving algorithm
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
bool weightsAreSetup
are the weights already set up?
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 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.
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.
#define MSGinconsistent(name)
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