3 #ifndef OsiNullSolverInterface_H
4 #define OsiNullSolverInterface_H
188 if(colType[i] ==
'B' || colType[i] ==
'I')
385 virtual void setObjCoeff(
int elementIndex,
double elementValue ) {
391 virtual void setColLower(
int elementIndex,
double elementValue ) {
397 virtual void setColUpper(
int elementIndex,
double elementValue ) {
403 virtual void setRowLower(
int elementIndex,
double elementValue ) {
409 virtual void setRowUpper(
int elementIndex,
double elementValue ) {
414 virtual void setRowType(
int index,
char sense,
double rightHandSide,
493 const double collb,
const double colub,
504 virtual void deleteCols(
const int num,
const int * colIndices) {
510 const double rowlb,
const double rowub) {
516 const char rowsen,
const double rowrhs,
517 const double rowrng) {
526 virtual void deleteRows(
const int num,
const int * rowIndices) {
537 const double * collb,
538 const double * colub,
540 const double * rowlb,
541 const double * rowub,
542 const char * colType,
543 const double * primalSol,
544 const double infinity){
575 const double * collb,
576 const double * colub,
578 const double * rowlb,
579 const double * rowub){
595 double*& collb,
double*& colub,
double*& obj,
596 double*& rowlb,
double*& rowub) {
613 const double* collb,
const double* colub,
615 const char* rowsen,
const double* rowrhs,
616 const double* rowrng) {
630 double*& collb,
double*& colub,
double*& obj,
631 char*& rowsen,
double*& rowrhs,
641 const double* collb,
const double* colub,
643 const double* rowlb,
const double* rowub) {
652 const double* collb,
const double* colub,
654 const char* rowsen,
const double* rowrhs,
655 const double* rowrng) {
666 const char *extension =
"mps",
667 double objSense=0.0)
const {
722 template <
class T>
inline T
724 return value < lower ? lower : (value > upper ? upper : value);
int getNcol() const
Get ncol.
const char * getRowSense() const
Get rowSense.
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
virtual void setRowLower(const double *givenRowLower)
Set rowLower to point on a vector holding the lower bounds on the constraints.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by l...
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get pointer to array[getNumCols()] of primal variable values.
const char * getColType() const
Get colType.
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
virtual bool isAbandoned() const
Are there numerical difficulties?
T forceIntoRange(const T value, const T lower, const T upper) const
A quick inlined function to force a value to be between a minimum and a maximum value.
virtual void setNrow(const int givenNrow)
Set nrow to the number of rows.
const double * getObj() const
Get obj.
OsiNullSolverInterface & operator=(const OsiNullSolverInterface &rhs)
Assignment operator (disabled)
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
void loadDataAndSolution(const CoinPackedMatrix &rowMatrix, const CoinPackedMatrix &colMatrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const char *colType, const double *primalSol, const double infinity)
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound.
virtual void setObj(const double *givenObj)
Set obj to point on a vector holding the objective coefficient values.
const CoinPackedMatrix * getMatrixByRow() const
Get matrixByRow.
virtual void setColLower(const double *givenColLower)
Set colLower to point on a vector holding the lower bounds on the variables.
virtual void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)
Load in an problem by assuming ownership of the arguments (the constraints on the rows are given by s...
const double * getRowRhs() const
Set rowRhs to point on a vector holding the right hand side of the constraints (for a ranged constrai...
virtual void setInfinity(const double givenInfinity)
Set infinity.
This class allows for a more structured use of algorithmic tweaking to an OsiSolverInterface.
virtual int getNumRows() const
Get number of rows.
virtual const double * getRightHandSide() const
Get a pointer to an array[getNumRows()] of row right-hand sides.
virtual void setPrimalSol(const double *givenPrimalSol)
Set primal solution.
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
virtual double getInfinity() const
Get solver's value for infinity.
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
virtual bool isInteger(int colIndex) const
Return true if column is integer.
int getNumRows() const
Number of rows.
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound.
virtual CoinWarmStart * getWarmStart() const
Get warm start information.
void initializeOtherData()
initialize the non-const data
virtual std::vector< double * > getDualRays(int maxNumRays) const
Get as many dual rays as the solver can provide.
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust the bounds of one or more variables).
Sparse Matrix Base Class.
virtual int getIterationCount() const
Get the number of iterations it took to solve the problem (whatever ``iteration'' means to the solver...
#define CoinAssertHint(expression, hint)
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
virtual void initialSolve()
Solve initial LP relaxation.
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper...
Collections of row cuts and column cuts.
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
virtual bool isProvenOptimal() const
Is optimality proven?
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
virtual void setColUpper(const double *givenColUpper)
Set colUpper to point on a vector holding the upper bounds on the variables.
virtual bool isIterationLimitReached() const
Iteration limit reached?
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row.
Abstract base class for various sparse vectors.
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
const double * getColUpper() const
Get colUpper.
virtual OsiNullSolverInterface * clone(bool copyData=true) const
Clone.
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
const double * getColLower() const
Get colLower.
virtual void writeMps(const char *filename, const char *extension="mps", double objSense=0.0) const
Write the problem in MPS format to the specified file.
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal variable values.
virtual int getNumIntegers() const
Get number of integer variables.
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
virtual int getNumCols() const
Get number of columns.
Very simple class for containing data on set.
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warm start information.
const double * getRowLower() const
Get rowLower.
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
virtual void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Just like the other loadProblem() methods except that the matrix is given in a standard column major ...
virtual const double * getRowRange() const
Get number of columns.
OsiNullSolverInterface()
Default Constructor.
virtual void loadProblem(const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Just like the other loadProblem() methods except that the matrix is given in a standard column major ...
virtual void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Load in an problem by copying the arguments (the constraints on the rows are given by sense/rhs/range...
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
int getNumCols() const
Number of columns.
This is a first attempt at a message handler.
virtual bool isContinuous(int colIndex) const
Return true if variable is continuous.
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
Abstract Base Class for describing an interface to a solver.
virtual void setMatrixByCol(const CoinPackedMatrix *givenMatrixByCol)
Set matrixByCol to point on the coefficient matrix ordered by columns.
const double * getPrimalSol() const
Get primal solution.
virtual void resolve()
Resolve an LP relaxation after problem modification.
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
virtual void setMatrixByRow(const CoinPackedMatrix *givenMatrixByRow)
Set matrixByRow to point on the coefficient matrix ordered by rows.
Class collecting pointers on data for OsiEmpty.
const double COIN_DBL_MAX
int getNrow() const
Get nrow.
virtual void setColType(const char *givenColType)
Set colType to point on a vector holding the type of the variables ('B', 'I', or 'C' for Binary...
virtual void setRowPrice(const double *rowprice)
Set dual solution variable values.
virtual void setNcol(const int givenNcol)
Set ncol to the number of variables.
const CoinPackedMatrix * getMatrixByCol() const
Get matrixByCol.
Validate cuts against a known solution.
void copyParameters(OsiNullSolverInterface &rhs)
Solve initial LP relaxation.
Abstract base class for warm start information.
static const double OsiNullInfinity
double getInfinity() const
Get infinity.
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound.
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
virtual double getObjValue() const
Get objective function value.
In many cases it is natural to build a model by adding one row at a time.
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual variable values.
const double * getRowRange() const
Get rowRange.
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound.
virtual ~OsiNullSolverInterface()
Destructor.
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
Add a column (primal variable) to the problem.
virtual int getNumElements() const
Get number of nonzero elements.
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
virtual void setObjSense(double s)
Set the objective function sense.
const double * getRowUpper() const
Get rowUpper.
virtual void setRowUpper(const double *givenRowUpper)
Set rowUpper to point on a vector holding the upper bounds on the constraints.
virtual void setColType(const char *colType)
Set characters for columns types.
const double * getRowActivity() const
Set rowActivity to point on a vector holding the activity of the constraints (i.e.
virtual void setColSolution(const double *colsol)
Set an objective function coefficient.
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to the constraint matrix).