24 : m_solver(p_type, p_rep)
28 , m_freePreScaler(false)
29 , m_freePostScaler(false)
30 , m_freeSimplifier(false)
405 for (i =
nCols() - 1; i >= 0; --i)
409 for (i =
nRows() - 1; i >= 0; --i)
433 MSG_ERROR( std::cerr <<
"ESOLVR02 Primal ray with presolving not yet implemented" << std::endl; )
449 MSG_ERROR( std::cerr <<
"ESOLVR02 Dual farkas with presolving not yet implemented" << std::endl; )
472 for(
int row = 0; row <
nRows(); ++row )
478 for(
int col = 0; col < rowvec.
size(); ++col )
479 val += rowvec.
value( col ) * solu[rowvec.
index( col )];
483 assert(
lhs( row ) <=
rhs( row ));
485 if (val <
lhs( row ))
488 if (val >
rhs( row ))
509 for(
int col = 0; col <
nCols(); ++col )
515 if (solu[col] <
lower( col ))
518 if (solu[col] >
upper( col ))
529 const char* filename,
540 const char* filename,
550 std::ofstream file(filename);
551 std::ostream& os = file;
553 os.setf(std::ios::left);
554 os <<
"NAME soplex.bas\n";
559 os <<
"ENDATA" << std::endl;
566 for(
int col = 0; col <
nCols(); col++ )
571 for( ; row <
nRows(); row++ )
577 assert(row !=
nRows());
580 << std::setw(8) <<
getColName(col, colNames, buf);
602 for( ; row <
nRows(); row++ )
607 assert(row ==
nRows());
610 os <<
"ENDATA" << std::endl;
615 const char* filename,
617 const NameSet* colNames )
const const VectorBase< R > & rhs() const
Returns right hand side vector.
Rational spxAbs(const Rational &r)
Absolute.
SPxSolver::Status getBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[]) const
get current basis, and return solver status.
virtual const Vector & unsimplifiedSlacks()=0
returns a reference to the unsimplified slack values.
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implemen...
virtual void unscalePrimal(const SPxLPBase< Real > &lp, Vector &x) const
unscale dense primal solution vector given in x.
SPxBasis::SPxStatus getBasisStatus() const
gets basis status
const VectorBase< R > & upper() const
Returns upper bound vector.
virtual SPxSolver::VarStatus getBasisColStatus(int) const =0
gets basis status for a single column.
virtual Status getPrimal(Vector &vector) const
get solution vector for primal variables.
void setOutstream(SPxOut &newOutstream)
const SPxRatioTester * ratiotester() const
return loaded SPxRatioTester.
the problem was so much simplified that it vanished
void setBasis(const VarStatus rows[], const VarStatus cols[])
set the lp solver's basis.
virtual Result simplify(SPxLP &lp, Real eps, Real delta)=0
simplify SPxLP lp with identical primal and dual feasibility tolerance.
int size() const
Number of used indices.
Status getBasis(VarStatus rows[], VarStatus cols[], const int rowsSize=-1, const int colsSize=-1) const
get current basis, and return solver status.
virtual void setStarter(SPxStarter *starter, const bool destroy=false)
setup starting basis generator to use. If destroy is true, starter will be freed in destructor...
Real feastol() const
allowed primal feasibility tolerance.
virtual void setBasisSolver(SLinSolver *slu, const bool destroy=false)
setup linear solver to use. If destroy is true, slusolver will be freed in destructor.
Exception classes for SoPlex.
virtual bool isDescValid(const Desc &ds)
checks if a Descriptor is valid for the current LP w.r.t. its bounds
Representation
LP basis representation.
SPxSolver::VarStatus getBasisRowStatus(int row) const
gets basis status for a single row.
SPxSimplifier * m_simplifier
simplifier
No Problem has been loaded.
virtual void unscaleRedCost(const SPxLPBase< Real > &lp, Vector &r) const
unscale dense reduced cost vector given in r.
virtual void unscaleDual(const SPxLPBase< Real > &lp, Vector &pi) const
unscale dense dual solution vector given in pi.
SPxLPBase< Real > & operator=(const SPxLPBase< Real > &old)
Assignment operator.
virtual SPxSolver::Status getPrimal(Vector &vector) const
bool m_vanished
did the presolver solve the problem ?
void clear()
remove all elements.
LP has been proven to be primal infeasible.
R & value(int n)
Reference to value of n 'th nonzero.
virtual bool readBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
virtual SPxSolver::VarStatus getBasisRowStatus(int) const =0
gets basis status for a single row.
SPxSolver::Representation rep() const
return current basis representation.
int nRows() const
Returns number of rows in LP.
Exception class for out of memory exceptions.This class is derived from the SoPlex exception base cla...
void spx_alloc(T &p, int n=1)
Allocate memory.
simplification could be done
virtual SPxSimplifier * clone() const =0
clone function for polymorphism
virtual Status getDualfarkas(Vector &vector) const
get dual farkas proof of infeasibility.
virtual void setOutstream(SPxOut &newOutstream)
set message handler
nothing known about basis status (possibly due to a singular basis in transformed problem) ...
SPxStatus status() const
returns current SPxStatus.
bool has_simplifier() const
has a simplifier been set?
virtual SPxScaler * clone() const =0
clone function for polymorphism
virtual void setPostScaler(SPxScaler *scaler, const bool destroy=false)
setup postscaler to use. If destroy is true, scaler will be freed in destructor.
SoPlexLegacy(SPxOut &outstream, SPxSolver::Type type=SPxSolver::LEAVE, SPxSolver::Representation rep=SPxSolver::COLUMN)
default construtor.
SoPlexLegacy & operator=(const SoPlexLegacy &rhs)
assignment operator.
Status status() const
Status of solution process.
const char * getColName(int idx, const NameSet *cnames, char *buf)
SPxSense spxSense() const
Returns the optimization sense.
int & index(int n)
Reference to index of n 'th nonzero.
LP simplification abstract base class.Instances of classes derived from SPxSimplifier may be loaded t...
LP has been solved to optimality.
virtual bool writeState(const char *filename, const NameSet *rowNames=NULL, const NameSet *colNames=NULL) const
virtual void setPricer(SPxPricer *pricer, const bool destroy=false)
setup pricer to use. If destroy is true, pricer will be freed in destructor.
#define MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
preconfigured SoPlexLegacy LP-solver.
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
virtual SPxSolver::Status getPrimalray(Vector &vector) const
const T * get_const_ptr() const
get a const C pointer to the data.
virtual bool writeState(const char *filename, const NameSet *rowNames=NULL, const NameSet *colNames=NULL, const bool cpxFormat=false) const
const VectorBase< R > & lhs() const
Returns left hand side vector.
virtual bool writeBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
virtual void getBasis(SPxSolver::VarStatus[], SPxSolver::VarStatus[], const int rowsSize=-1, const int colsSize=-1) const =0
get optimal basis.
variable set to its upper bound.
virtual bool readBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
virtual SPxSolver::Status getSlacks(Vector &vector) const
primal infeasibility was detected
const char * getRowName(int idx, const NameSet *rnames, char *buf)
bool m_freePostScaler
true iff m_postScaler should be freed inside of this object
virtual SPxSolver::Status status() const
returns the current status
virtual const Vector & unsimplifiedPrimal()=0
returns a reference to the unsimplified primal solution.
SPxSolver::VarStatus getBasisColStatus(int col) const
gets basis status for a single column.
virtual void loadLP(const SPxLP &LP, bool initSlackBasis=true)
copy LP.
virtual const char * getName() const
get name of ratio tester.
Preconfigured SoPlexLegacy LP-solver.
Real epsilon() const
values are considered to be 0.
virtual void loadBasis(const SPxBasis::Desc &)
set a start basis.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
virtual void scale(SPxLPBase< Real > &lp, bool persistent=true)=0
scale SPxLP.
Everything should be within this namespace.
bool isBasisValid(DataArray< VarStatus > rows, DataArray< VarStatus > cols)
check a given basis for validity.
virtual void setTester(SPxRatioTester *tester, const bool destroy=false)
setup ratio-tester to use. If destroy is true, tester will be freed in destructor.
virtual Real objValue() const
primal unboundedness was detected
DataArray< SPxSolver::VarStatus > m_rowsbasisstatus
virtual void unsimplify(const Vector &, const Vector &, const Vector &, const Vector &, const SPxSolver::VarStatus[], const SPxSolver::VarStatus[], bool isOptimal=true)=0
reconstructs an optimal solution for the unsimplified LP.
const VectorBase< R > & maxObj() const
Returns objective vector for maximization problem.
SPxScaler * m_postScaler
post-scaler
VarStatus getBasisRowStatus(int row) const
gets basis status for a single row
const SVectorBase< R > & rowVector(int i) const
Gets row vector of row i.
VarStatus getBasisColStatus(int col) const
gets basis status for a single column
virtual bool isUnsimplified() const
specifies whether an optimal solution has already been unsimplified.
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
void unsimplify() const
undoes preprocessing such that the unsimplified solution values and basis is available ...
virtual const Vector & unsimplifiedDual()=0
returns a reference to the unsimplified dual solution.
virtual SPxSolver::Status getDual(Vector &vector) const
virtual SPxSolver::Status getDualfarkas(Vector &vector) const
int size() const
return nr. of elements.
SLUFactor m_slu
LU Factorisation.
virtual SPxSolver::Status getRedCost(Vector &vector) const
virtual Status getRedCost(Vector &vector) const
get vector of reduced costs.
bool m_freeSimplifier
true iff m_simplifier should be freed inside of this object
DataArray< SPxSolver::VarStatus > m_colsbasisstatus
bool isConsistent() const
Consistency check.
int nCols() const
Returns number of columns in LP.
Exception class for status exceptions during the computationsThis class is derived from the SoPlex ex...
virtual const Vector & unsimplifiedRedCost()=0
returns a reference to the unsimplified reduced costs.
Real opttol() const
allowed optimality, i.e., dual feasibility tolerance.
virtual void unscaleSlacks(const SPxLPBase< Real > &lp, Vector &s) const
unscale dense slack vector given in s.
void setOutstream(SPxOut &newOutstream)
virtual void qualBoundViolation(Real &maxviol, Real &sumviol) const
get violations of bounds.
const SPxBasis & basis() const
Return current basis.
virtual SPxSolver::Status solve()
virtual Status solve()
solve loaded LP.
LP has been proven to be primal unbounded.
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
const Desc & desc() const
columnwise representation.
void spx_free(T &p)
Release memory.
virtual void qualConstraintViolation(Real &maxviol, Real &sumviol) const
get violation of constraints.
virtual void setSimplifier(SPxSimplifier *simpli, const bool destroy=false)
setup simplifier to use. If destroy is true, simpli will be freed in destructor.
virtual Status getDual(Vector &vector) const
get current solution vector for dual variables.
virtual Status getPrimalray(Vector &vector) const
get primal ray in case of unboundedness.
Steepest edge pricer.Class SPxSteepPR implements a steepest edge pricer to be used with SoPlex...
LP has a usable Basis (maybe LP is changed).
virtual Status getSlacks(Vector &vector) const
get vector of slack variables.
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver's basis status.
LP has been proven to be primal unbounded.
LP has been proven to be primal infeasible.
No Problem has been loaded to the basis.