Loading...
Searching...
No Matches
OsiClpSolverInterface.hpp
Go to the documentation of this file.
// $Id$
// Copyright (C) 2000, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef OsiClpSolverInterface_H
#define OsiClpSolverInterface_H
#include <string>
#include <cfloat>
#include <map>
#include "ClpSimplex.hpp"
#include "ClpLinearObjective.hpp"
#include "CoinPackedMatrix.hpp"
#include "OsiSolverInterface.hpp"
#include "CoinWarmStartBasis.hpp"
#include "ClpEventHandler.hpp"
#include "ClpNode.hpp"
#include "CoinIndexedVector.hpp"
#include "CoinFinite.hpp"
class OsiRowCut;
class OsiClpUserSolver;
class OsiClpDisasterHandler;
class CoinSet;
static const double OsiClpInfinity = COIN_DBL_MAX;
//#############################################################################
class OsiClpSolverInterface : virtual public OsiSolverInterface {
friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
public:
//---------------------------------------------------------------------------
virtual void initialSolve();
virtual void resolve();
virtual void resolveGub(int needed);
virtual void branchAndBound();
void crossover(int options, int basis);
virtual int canDoSimplexInterface() const;
virtual void enableFactorization() const;
virtual void disableFactorization() const;
virtual bool basisIsAvailable() const;
virtual void getBasisStatus(int *cstat, int *rstat) const;
virtual int setBasisStatus(const int *cstat, const int *rstat);
virtual void getReducedGradient(double *columnReducedCosts,
double *duals,
const double *c) const;
virtual void getBInvARow(int row, double *z, double *slack = NULL) const;
virtual void getBInvARow(int row, CoinIndexedVector *z, CoinIndexedVector *slack = NULL,
bool keepScaled = false) const;
virtual void getBInvRow(int row, double *z) const;
virtual void getBInvACol(int col, double *vec) const;
virtual void getBInvACol(int col, CoinIndexedVector *vec) const;
virtual void getBInvACol(CoinIndexedVector *vec) const;
virtual void getBInvCol(int col, double *vec) const;
virtual void getBasics(int *index) const;
virtual void enableSimplexInterface(bool doingPrimal);
virtual void disableSimplexInterface();
virtual int pivot(int colIn, int colOut, int outStatus);
virtual int primalPivotResult(int colIn, int sign,
int &colOut, int &outStatus,
double &t, CoinPackedVector *dx);
virtual int dualPivotResult(int &colIn, int &sign,
int colOut, int outStatus,
double &t, CoinPackedVector *dx);
//---------------------------------------------------------------------------
// Set an integer parameter
bool setIntParam(OsiIntParam key, int value);
// Set an double parameter
bool setDblParam(OsiDblParam key, double value);
// Set a string parameter
bool setStrParam(OsiStrParam key, const std::string &value);
// Get an integer parameter
bool getIntParam(OsiIntParam key, int &value) const;
// Get an double parameter
bool getDblParam(OsiDblParam key, double &value) const;
// Get a string parameter
bool getStrParam(OsiStrParam key, std::string &value) const;
// Set a hint parameter - overrides OsiSolverInterface
virtual bool setHintParam(OsiHintParam key, bool yesNo = true,
OsiHintStrength strength = OsiHintTry,
void *otherInformation = NULL);
//---------------------------------------------------------------------------
virtual bool isAbandoned() const;
virtual bool isProvenOptimal() const;
virtual bool isProvenPrimalInfeasible() const;
virtual bool isProvenDualInfeasible() const;
virtual bool isPrimalObjectiveLimitReached() const;
virtual bool isDualObjectiveLimitReached() const;
virtual bool isIterationLimitReached() const;
//---------------------------------------------------------------------------
virtual CoinWarmStart *getEmptyWarmStart() const;
virtual CoinWarmStart *getWarmStart() const;
inline CoinWarmStartBasis *getPointerToWarmStart()
{
return &basis_;
}
inline const CoinWarmStartBasis *getConstPointerToWarmStart() const
{
return &basis_;
}
virtual bool setWarmStart(const CoinWarmStart *warmstart);
virtual CoinWarmStart *getPointerToWarmStart(bool &mustDelete);
void setColumnStatus(int iColumn, ClpSimplex::Status status);
//---------------------------------------------------------------------------
virtual void markHotStart();
virtual void solveFromHotStart();
virtual void unmarkHotStart();
int startFastDual(int options);
void stopFastDual();
void setStuff(double tolerance, double increment);
OsiRowCut *smallModelCut(const double *originalLower, const double *originalUpper,
int numberRowsAtContinuous, const int *whichGenerator,
int typeCut = 0);
OsiRowCut *modelCut(const double *originalLower, const double *originalUpper,
int numberRowsAtContinuous, const int *whichGenerator,
int typeCut = 0);
//---------------------------------------------------------------------------
virtual int getNumCols() const
{
return modelPtr_->numberColumns();
}
virtual int getNumRows() const
{
return modelPtr_->numberRows();
}
virtual CoinBigIndex getNumElements() const
{
CoinBigIndex retVal = 0;
const CoinPackedMatrix *matrix = modelPtr_->matrix();
if (matrix != NULL)
retVal = matrix->getNumElements();
return retVal;
}
virtual std::string getRowName(int rowIndex,
unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
virtual std::string getColName(int colIndex,
unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
virtual const double *getColLower() const { return modelPtr_->columnLower(); }
virtual const double *getColUpper() const { return modelPtr_->columnUpper(); }
virtual const char *getRowSense() const;
virtual const double *getRightHandSide() const;
virtual const double *getRowRange() const;
virtual const double *getRowLower() const { return modelPtr_->rowLower(); }
virtual const double *getRowUpper() const { return modelPtr_->rowUpper(); }
virtual const double *getObjCoefficients() const
{
if (fakeMinInSimplex_)
return linearObjective_;
else
return modelPtr_->objective();
}
virtual double getObjSense() const
{
return ((fakeMinInSimplex_) ? -modelPtr_->optimizationDirection() : modelPtr_->optimizationDirection());
}
virtual bool isContinuous(int colNumber) const;
virtual bool isBinary(int colIndex) const;
virtual bool isInteger(int colIndex) const;
virtual bool isIntegerNonBinary(int colIndex) const;
virtual bool isFreeBinary(int colIndex) const;
virtual const char *getColType(bool refresh = false) const;
bool isOptionalInteger(int colIndex) const;
void setOptionalInteger(int index);
inline bool isHeuristicInteger(int colIndex) const
{
return (integerInformation_ && integerInformation_[colIndex] == 1);
}
inline int integerType(int colIndex) const
{
return integerInformation_ ? integerInformation_[colIndex] : 0;
}
inline void setIntegerType(int colIndex, int value)
{
integerInformation_[colIndex] = static_cast< char >(value);
}
virtual const CoinPackedMatrix *getMatrixByRow() const;
virtual const CoinPackedMatrix *getMatrixByCol() const;
virtual CoinPackedMatrix *getMutableMatrixByCol() const;
virtual double getInfinity() const { return OsiClpInfinity; }
virtual const double *getColSolution() const;
virtual const double *getRowPrice() const;
virtual const double *getReducedCost() const;
virtual const double *getRowActivity() const;
virtual double getObjValue() const;
virtual int getIterationCount() const
{
return modelPtr_->numberIterations();
}
virtual std::vector< double * > getDualRays(int maxNumRays,
bool fullRay = false) const;
virtual std::vector< double * > getPrimalRays(int maxNumRays) const;
//---------------------------------------------------------------------------
//-------------------------------------------------------------------------
virtual void setObjCoeff(int elementIndex, double elementValue);
virtual void setColLower(int elementIndex, double elementValue);
virtual void setColUpper(int elementIndex, double elementValue);
virtual void setColBounds(int elementIndex,
double lower, double upper);
virtual void setColSetBounds(const int *indexFirst,
const int *indexLast,
const double *boundList);
virtual void setRowLower(int elementIndex, double elementValue);
virtual void setRowUpper(int elementIndex, double elementValue);
virtual void setRowBounds(int elementIndex,
double lower, double upper);
virtual void setRowType(int index, char sense, double rightHandSide,
double range);
virtual void setRowSetBounds(const int *indexFirst,
const int *indexLast,
const double *boundList);
virtual void setRowSetTypes(const int *indexFirst,
const int *indexLast,
const char *senseList,
const double *rhsList,
const double *rangeList);
virtual void setObjective(const double *array);
virtual void setColLower(const double *array);
virtual void setColUpper(const double *array);
// using OsiSolverInterface::setRowName ;
// virtual void setRowName(int rowIndex, std::string & name) ;
virtual void setRowName(int rowIndex, std::string name);
// using OsiSolverInterface::setColName ;
// virtual void setColName(int colIndex, std::string & name) ;
virtual void setColName(int colIndex, std::string name);
//-------------------------------------------------------------------------
virtual void setContinuous(int index);
virtual void setInteger(int index);
virtual void setContinuous(const int *indices, int len);
virtual void setInteger(const int *indices, int len);
inline int numberSOS() const
{
return numberSOS_;
}
inline const CoinSet *setInfo() const
{
return setInfo_;
}
void replaceSetInfo(int numberSOS, CoinSet *setInfo);
virtual int findIntegersAndSOS(bool justCount);
//-------------------------------------------------------------------------
virtual void setObjSense(double s)
{
modelPtr_->setOptimizationDirection(s < 0 ? -1 : 1);
}
virtual void setColSolution(const double *colsol);
virtual void setRowPrice(const double *rowprice);
//-------------------------------------------------------------------------
//using OsiSolverInterface::addCol ;
virtual void addCol(const CoinPackedVectorBase &vec,
const double collb, const double colub,
const double obj);
virtual void addCol(const CoinPackedVectorBase &vec,
const double collb, const double colub,
const double obj, std::string name);
virtual void addCol(int numberElements, const int *rows, const double *elements,
const double collb, const double colub,
const double obj);
virtual void addCol(int numberElements,
const int *rows, const double *elements,
const double collb, const double colub,
const double obj, std::string name);
virtual void addCols(const int numcols,
const CoinPackedVectorBase *const *cols,
const double *collb, const double *colub,
const double *obj);
virtual void addCols(const int numcols,
const CoinBigIndex *columnStarts, const int *rows, const double *elements,
const double *collb, const double *colub,
const double *obj);
virtual void deleteCols(const int num, const int *colIndices);
virtual void addRow(const CoinPackedVectorBase &vec,
const double rowlb, const double rowub);
virtual void addRow(const CoinPackedVectorBase &vec,
const double rowlb, const double rowub,
std::string name);
virtual void addRow(const CoinPackedVectorBase &vec,
const char rowsen, const double rowrhs,
const double rowrng);
virtual void addRow(int numberElements, const int *columns, const double *element,
const double rowlb, const double rowub);
virtual void addRow(const CoinPackedVectorBase &vec,
const char rowsen, const double rowrhs,
const double rowrng, std::string name);
virtual void addRows(const int numrows,
const CoinPackedVectorBase *const *rows,
const double *rowlb, const double *rowub);
virtual void addRows(const int numrows,
const CoinPackedVectorBase *const *rows,
const char *rowsen, const double *rowrhs,
const double *rowrng);
virtual void addRows(const int numrows,
const CoinBigIndex *rowStarts, const int *columns, const double *element,
const double *rowlb, const double *rowub);
void modifyCoefficient(int row, int column, double newElement,
bool keepZero = false)
{
modelPtr_->modifyCoefficient(row, column, newElement, keepZero);
}
virtual void deleteRows(const int num, const int *rowIndices);
virtual void saveBaseModel();
virtual void restoreBaseModel(int numberRows);
//-----------------------------------------------------------------------
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts);
virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts);
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs,
double effectivenessLb = 0.0);
//---------------------------------------------------------------------------
public:
virtual void loadProblem(const CoinPackedMatrix &matrix,
const double *collb, const double *colub,
const double *obj,
const double *rowlb, const double *rowub);
virtual void assignProblem(CoinPackedMatrix *&matrix,
double *&collb, double *&colub, double *&obj,
double *&rowlb, double *&rowub);
virtual void loadProblem(const CoinPackedMatrix &matrix,
const double *collb, const double *colub,
const double *obj,
const char *rowsen, const double *rowrhs,
const double *rowrng);
virtual void assignProblem(CoinPackedMatrix *&matrix,
double *&collb, double *&colub, double *&obj,
char *&rowsen, double *&rowrhs,
double *&rowrng);
virtual void loadProblem(const ClpMatrixBase &matrix,
const double *collb, const double *colub,
const double *obj,
const double *rowlb, const double *rowub);
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);
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);
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution = false);
virtual int readMps(const char *filename,
const char *extension = "mps");
int readMps(const char *filename, bool keepNames, bool allowErrors);
virtual int readMps(const char *filename, const char *extension,
int &numberSets, CoinSet **&sets);
virtual void writeMps(const char *filename,
const char *extension = "mps",
double objSense = 0.0) const;
virtual int writeMpsNative(const char *filename,
const char **rowNames, const char **columnNames,
int formatType = 0, int numberAcross = 2,
double objSense = 0.0) const;
virtual int readLp(const char *filename, const double epsilon = 1e-5);
virtual void writeLp(const char *filename,
const char *extension = "lp",
double epsilon = 1e-5,
int numberAcross = 10,
int decimals = 5,
double objSense = 0.0,
bool useRowNames = true) const;
virtual void writeLp(FILE *fp,
double epsilon = 1e-5,
int numberAcross = 10,
int decimals = 5,
double objSense = 0.0,
bool useRowNames = true) const;
virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix);
virtual void replaceMatrix(const CoinPackedMatrix &matrix);
virtual void passInMessageHandler(CoinMessageHandler *handler);
void newLanguage(CoinMessages::Language language);
void setLanguage(CoinMessages::Language language)
{
newLanguage(language);
}
void setLogLevel(int value);
void generateCpp(FILE *fp);
//---------------------------------------------------------------------------
ClpSimplex *getModelPtr() const;
inline ClpSimplex *swapModelPtr(ClpSimplex *newModel)
{
ClpSimplex *model = modelPtr_;
modelPtr_ = newModel;
return model;
}
inline unsigned int specialOptions() const
{
return specialOptions_;
}
void setSpecialOptions(unsigned int value);
inline int lastAlgorithm() const
{
return lastAlgorithm_;
}
inline void setLastAlgorithm(int value)
{
lastAlgorithm_ = value;
}
inline int cleanupScaling() const
{
return cleanupScaling_;
}
inline void setCleanupScaling(int value)
{
cleanupScaling_ = value;
}
inline double smallestElementInCut() const
{
return smallestElementInCut_;
}
inline void setSmallestElementInCut(double value)
{
smallestElementInCut_ = value;
}
inline double smallestChangeInCut() const
{
return smallestChangeInCut_;
}
inline void setSmallestChangeInCut(double value)
{
smallestChangeInCut_ = value;
}
inline void setSolveOptions(const ClpSolve &options)
{
solveOptions_ = options;
}
virtual int tightenBounds(int lightweight = 0);
int infeasibleOtherWay(char *whichWay);
virtual CoinBigIndex getSizeL() const;
virtual CoinBigIndex getSizeU() const;
const OsiClpDisasterHandler *disasterHandler() const
{
return disasterHandler_;
}
void passInDisasterHandler(OsiClpDisasterHandler *handler);
ClpLinearObjective *fakeObjective() const
{
return fakeObjective_;
}
void setFakeObjective(ClpLinearObjective *fakeObjective);
void setFakeObjective(double *fakeObjective);
void setupForRepeatedUse(int senseOfAdventure = 0, int printOut = 0);
virtual void synchronizeModel();
void setSpecialOptionsMutable(unsigned int value) const;
//---------------------------------------------------------------------------
OsiClpSolverInterface();
virtual OsiSolverInterface *clone(bool copyData = true) const;
OsiClpSolverInterface(const OsiClpSolverInterface &);
OsiClpSolverInterface(ClpSimplex *rhs, bool reallyOwn = false);
void releaseClp();
OsiClpSolverInterface &operator=(const OsiClpSolverInterface &rhs);
virtual ~OsiClpSolverInterface();
virtual void reset();
//---------------------------------------------------------------------------
protected:
virtual void applyRowCut(const OsiRowCut &rc);
virtual void applyColCut(const OsiColCut &cc);
//---------------------------------------------------------------------------
protected:
void gutsOfDestructor();
void freeCachedResults() const;
void freeCachedResults0() const;
void freeCachedResults1() const;
void extractSenseRhsRange() const;
void fillParamMaps();
CoinWarmStartBasis getBasis(ClpSimplex *model) const;
void setBasis(const CoinWarmStartBasis &basis, ClpSimplex *model);
void crunch();
void redoScaleFactors(int numberRows, const CoinBigIndex *starts,
const int *indices, const double *elements);
public:
void setBasis(const CoinWarmStartBasis &basis);
inline void setBasis()
{
setBasis(basis_, modelPtr_);
}
CoinWarmStartDiff *getBasisDiff(const unsigned char *statusArray) const;
CoinWarmStartBasis *getBasis(const unsigned char *statusArray) const;
void deleteScaleFactors();
inline const double *upRange() const
{
return rowActivity_;
}
inline const double *downRange() const
{
return columnActivity_;
}
inline void passInRanges(int *array)
{
whichRange_ = array;
}
void setSOSData(int numberSOS, const char *type,
const int *start, const int *indices, const double *weights = NULL);
void computeLargestAway();
inline double largestAway() const
{
return largestAway_;
}
inline void setLargestAway(double value)
{
largestAway_ = value;
}
void lexSolve();
inline ClpSimplex *getContinuousModel() const
{
return continuousModel_;
}
inline void setContinuousModel(ClpSimplex *model)
{
continuousModel_ = model;
}
protected:
mutable ClpSimplex *modelPtr_;
mutable char *rowsense_;
mutable double *rhs_;
mutable double *rowrange_;
mutable CoinWarmStartBasis *ws_;
mutable double *rowActivity_;
mutable double *columnActivity_;
ClpNodeStuff stuff_;
int numberSOS_;
CoinSet *setInfo_;
ClpSimplex *smallModel_;
ClpFactorization *factorization_;
double smallestElementInCut_;
double smallestChangeInCut_;
double largestAway_;
char *spareArrays_;
CoinWarmStartBasis basis_;
int itlimOrig_;
mutable int lastAlgorithm_;
bool notOwned_;
mutable CoinPackedMatrix *matrixByRow_;
CoinPackedMatrix *matrixByRowAtContinuous_;
char *integerInformation_;
int *whichRange_;
//std::map<OsiIntParam, ClpIntParam> intParamMap_;
//std::map<OsiDblParam, ClpDblParam> dblParamMap_;
//std::map<OsiStrParam, ClpStrParam> strParamMap_;
mutable bool fakeMinInSimplex_;
mutable double *linearObjective_;
mutable ClpDataSave saveData_;
ClpSolve solveOptions_;
int cleanupScaling_;
mutable unsigned int specialOptions_;
ClpSimplex *baseModel_;
int lastNumberRows_;
ClpSimplex *continuousModel_;
OsiClpDisasterHandler *disasterHandler_;
ClpLinearObjective *fakeObjective_;
CoinDoubleArrayWithLength rowScale_;
CoinDoubleArrayWithLength columnScale_;
};
class OsiClpDisasterHandler : public ClpDisasterHandler {
public:
virtual void intoSimplex();
virtual bool check() const;
virtual void saveInfo();
virtual int typeOfDisaster();
OsiClpDisasterHandler(OsiClpSolverInterface *model = NULL);
virtual ~OsiClpDisasterHandler();
// Copy
OsiClpDisasterHandler(const OsiClpDisasterHandler &);
// Assignment
OsiClpDisasterHandler &operator=(const OsiClpDisasterHandler &);
virtual ClpDisasterHandler *clone() const;
void setOsiModel(OsiClpSolverInterface *model);
inline OsiClpSolverInterface *osiModel() const
{
return osiModel_;
}
inline void setWhereFrom(int value)
{
whereFrom_ = value;
}
inline int whereFrom() const
{
return whereFrom_;
}
inline void setPhase(int value)
{
phase_ = value;
}
inline int phase() const
{
return phase_;
}
bool inTrouble() const;
protected:
OsiClpSolverInterface *osiModel_;
int whereFrom_;
int phase_;
bool inTrouble_;
};
// So unit test can find out if NDEBUG set
bool OsiClpHasNDEBUG();
//#############################################################################
void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
type
CbcOrClpParameterType type() const
type
Definition CbcOrClpParam.hpp:462
name
std::string name() const
Returns name.
Definition CbcOrClpParam.hpp:332
ClpEventHandler.hpp
ClpLinearObjective.hpp
ClpNode.hpp
ClpSimplex.hpp
OsiSolverInterface
#define OsiSolverInterface
Definition Idiot.hpp:14
OsiClpInfinity
static const double OsiClpInfinity
Definition OsiClpSolverInterface.hpp:27
OsiClpSolverInterfaceUnitTest
void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
OsiClpHasNDEBUG
bool OsiClpHasNDEBUG()
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition ClpModel.hpp:1402
ClpDisasterHandler::ClpDisasterHandler
ClpDisasterHandler(ClpSimplex *model=NULL)
Default constructor.
ClpFactorization
This just implements CoinFactorization when an ClpMatrixBase object is passed.
Definition ClpFactorization.hpp:38
ClpLinearObjective
Linear Objective Class.
Definition ClpLinearObjective.hpp:17
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition ClpMatrixBase.hpp:38
ClpNodeStuff
Definition ClpNode.hpp:188
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106
ClpSimplex::Status
Status
enums for status of various sorts.
Definition ClpSimplex.hpp:114
ClpSolve
This is a very simple class to guide algorithms.
Definition ClpSolve.hpp:20
OsiClpDisasterHandler
Definition OsiClpSolverInterface.hpp:1504
OsiClpDisasterHandler::setWhereFrom
void setWhereFrom(int value)
Set where from.
Definition OsiClpSolverInterface.hpp:1546
OsiClpDisasterHandler::whereFrom
int whereFrom() const
Get where from.
Definition OsiClpSolverInterface.hpp:1551
OsiClpDisasterHandler::~OsiClpDisasterHandler
virtual ~OsiClpDisasterHandler()
Destructor.
OsiClpDisasterHandler::inTrouble_
bool inTrouble_
Are we in trouble.
Definition OsiClpSolverInterface.hpp:1593
OsiClpDisasterHandler::inTrouble
bool inTrouble() const
are we in trouble
OsiClpDisasterHandler::OsiClpDisasterHandler
OsiClpDisasterHandler(const OsiClpDisasterHandler &)
OsiClpDisasterHandler::intoSimplex
virtual void intoSimplex()
Into simplex.
OsiClpDisasterHandler::saveInfo
virtual void saveInfo()
saves information for next attempt
OsiClpDisasterHandler::osiModel_
OsiClpSolverInterface * osiModel_
Pointer to model.
Definition OsiClpSolverInterface.hpp:1575
OsiClpDisasterHandler::phase_
int phase_
phase 0 initial 1 trying continuing with back in and maybe different perturb 2 trying continuing with...
Definition OsiClpSolverInterface.hpp:1591
OsiClpDisasterHandler::osiModel
OsiClpSolverInterface * osiModel() const
Get model.
Definition OsiClpSolverInterface.hpp:1541
OsiClpDisasterHandler::whereFrom_
int whereFrom_
Where from 0 dual (resolve) 1 crunch 2 primal (resolve) 4 dual (initialSolve) 6 primal (initialSolve)...
Definition OsiClpSolverInterface.hpp:1583
OsiClpDisasterHandler::phase
int phase() const
Get phase.
Definition OsiClpSolverInterface.hpp:1561
OsiClpDisasterHandler::operator=
OsiClpDisasterHandler & operator=(const OsiClpDisasterHandler &)
OsiClpDisasterHandler::check
virtual bool check() const
Checks if disaster.
OsiClpDisasterHandler::OsiClpDisasterHandler
OsiClpDisasterHandler(OsiClpSolverInterface *model=NULL)
Default constructor.
OsiClpDisasterHandler::setOsiModel
void setOsiModel(OsiClpSolverInterface *model)
set model.
OsiClpDisasterHandler::typeOfDisaster
virtual int typeOfDisaster()
Type of disaster 0 can fix, 1 abort.
OsiClpDisasterHandler::clone
virtual ClpDisasterHandler * clone() const
Clone.
OsiClpDisasterHandler::setPhase
void setPhase(int value)
Set phase.
Definition OsiClpSolverInterface.hpp:1556
OsiClpSolverInterface
Clp Solver Interface.
Definition OsiClpSolverInterface.hpp:37
OsiClpSolverInterface::linearObjective_
double * linearObjective_
Linear objective.
Definition OsiClpSolverInterface.hpp:1439
OsiClpSolverInterface::setFakeObjective
void setFakeObjective(ClpLinearObjective *fakeObjective)
Set fake objective (and take ownership).
OsiClpSolverInterface::swapModelPtr
ClpSimplex * swapModelPtr(ClpSimplex *newModel)
Set pointer to Clp model and return old.
Definition OsiClpSolverInterface.hpp:1064
OsiClpSolverInterface::lexSolve
void lexSolve()
Sort of lexicographic resolve.
OsiClpSolverInterface::crunch
void crunch()
Crunch down problem a bit.
OsiClpSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const char *rowsen, const double *rowrhs, const double *rowrng)
OsiClpSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiClpSolverInterface::infeasibleOtherWay
int infeasibleOtherWay(char *whichWay)
See if any integer variables make infeasible other way.
OsiClpSolverInterface::rowScale_
CoinDoubleArrayWithLength rowScale_
Row scale factors (has inverse at end).
Definition OsiClpSolverInterface.hpp:1498
OsiClpSolverInterface::getSizeL
virtual CoinBigIndex getSizeL() const
Return number of entries in L part of current factorization.
OsiClpSolverInterface::tightenBounds
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers,...
OsiClpSolverInterface::spareArrays_
char * spareArrays_
Arrays for hot starts.
Definition OsiClpSolverInterface.hpp:1391
OsiClpSolverInterface::setFakeObjective
void setFakeObjective(double *fakeObjective)
Set fake objective.
OsiClpSolverInterface::getBInvRow
virtual void getBInvRow(int row, double *z) const
Get a row of the basis inverse.
OsiClpSolverInterface::lastAlgorithm_
int lastAlgorithm_
Last algorithm used.
Definition OsiClpSolverInterface.hpp:1407
OsiClpSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiClpSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
OsiClpSolverInterface::getColType
virtual const char * getColType(bool refresh=false) const
Return array of column length 0 - continuous 1 - binary (may get fixed later) 2 - general integer (ma...
OsiClpSolverInterface::getSizeU
virtual CoinBigIndex getSizeU() const
Return number of entries in U part of current factorization.
OsiClpSolverInterface::replaceMatrixOptional
virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix)
I (JJF) am getting annoyed because I can't just replace a matrix.
OsiClpSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng, std::string name)
Add a named row (constraint) to the problem.
OsiClpSolverInterface::enableFactorization
virtual void enableFactorization() const
Enables simplex mode 1 (tableau access).
OsiClpSolverInterface::getContinuousModel
ClpSimplex * getContinuousModel() const
Get continuous model.
Definition OsiClpSolverInterface.hpp:1334
OsiClpSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiClpSolverInterface::redoScaleFactors
void redoScaleFactors(int numberRows, const CoinBigIndex *starts, const int *indices, const double *elements)
Extend scale factors.
OsiClpSolverInterface::~OsiClpSolverInterface
virtual ~OsiClpSolverInterface()
Destructor.
OsiClpSolverInterface::replaceMatrix
virtual void replaceMatrix(const CoinPackedMatrix &matrix)
And if it does matter (not used at present).
OsiClpSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if variable is binary and not fixed at either bound.
OsiClpSolverInterface::getModelPtr
ClpSimplex * getModelPtr() const
Get pointer to Clp model.
OsiClpSolverInterface::releaseClp
void releaseClp()
Releases so won't error.
OsiClpSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub, std::string name)
Add a named row (constraint) to the problem.
OsiClpSolverInterface::fakeObjective_
ClpLinearObjective * fakeObjective_
Fake objective.
Definition OsiClpSolverInterface.hpp:1496
OsiClpSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiClpSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
Read an mps file.
OsiClpSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
OsiClpSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiClpSolverInterface::addRows
virtual void addRows(const int numrows, const CoinBigIndex *rowStarts, const int *columns, const double *element, const double *rowlb, const double *rowub)
OsiClpSolverInterface::getEmptyWarmStart
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
OsiClpSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows).
Definition OsiClpSolverInterface.hpp:1362
OsiClpSolverInterface::getBasics
virtual void getBasics(int *index) const
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBI...
OsiClpSolverInterface::setBasis
void setBasis(const CoinWarmStartBasis &basis)
Sets up working basis as a copy of input and puts in as basis.
OsiClpSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
Definition OsiClpSolverInterface.hpp:436
OsiClpSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiClpSolverInterface::loadProblem
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...
OsiClpSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
OsiClpSolverInterface::findIntegersAndSOS
virtual int findIntegersAndSOS(bool justCount)
Identify integer variables and SOS and create corresponding objects.
OsiClpSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiClpSolverInterface::getBInvARow
virtual void getBInvARow(int row, CoinIndexedVector *z, CoinIndexedVector *slack=NULL, bool keepScaled=false) const
Get a row of the tableau (slack part in slack if not NULL) If keepScaled is true then scale factors n...
OsiClpSolverInterface::rowActivity_
double * rowActivity_
also save row and column information for hot starts only used in hotstarts so can be casual
Definition OsiClpSolverInterface.hpp:1369
OsiClpSolverInterface::saveBaseModel
virtual void saveBaseModel()
If solver wants it can save a copy of "base" (continuous) model here.
OsiClpSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiClpSolverInterface::setLogLevel
void setLogLevel(int value)
Set log level (will also set underlying solver's log level).
OsiClpSolverInterface::passInDisasterHandler
void passInDisasterHandler(OsiClpDisasterHandler *handler)
Pass in disaster handler.
OsiClpSolverInterface::getBInvACol
virtual void getBInvACol(int col, double *vec) const
Get a column of the tableau.
OsiClpSolverInterface::disableSimplexInterface
virtual void disableSimplexInterface()
Undo setting changes made by enableSimplexInterface.
OsiClpSolverInterface::setContinuous
virtual void setContinuous(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be continuous variables.
OsiClpSolverInterface::OsiClpSolverInterface
OsiClpSolverInterface(const OsiClpSolverInterface &)
Copy constructor.
OsiClpSolverInterface::setInfo
const CoinSet * setInfo() const
SOS set info.
Definition OsiClpSolverInterface.hpp:701
OsiClpSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
OsiClpSolverInterface::pivot
virtual int pivot(int colIn, int colOut, int outStatus)
Perform a pivot by substituting a colIn for colOut in the basis.
OsiClpSolverInterface::freeCachedResults
void freeCachedResults() const
Deletes all mutable stuff.
OsiClpSolverInterface::largestAway_
double largestAway_
Largest amount continuous away from bound.
Definition OsiClpSolverInterface.hpp:1389
OsiClpSolverInterface::operator=
OsiClpSolverInterface & operator=(const OsiClpSolverInterface &rhs)
Assignment operator.
OsiClpSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust one or more bounds).
OsiClpSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
OsiClpSolverInterface::disableFactorization
virtual void disableFactorization() const
Undo any setting changes made by enableFactorization.
OsiClpSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
OsiClpSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
Definition OsiClpSolverInterface.hpp:367
OsiClpSolverInterface::setContinuousModel
void setContinuousModel(ClpSimplex *model)
Set continuous model.
Definition OsiClpSolverInterface.hpp:1339
OsiClpSolverInterface::resolveGub
virtual void resolveGub(int needed)
Resolve an LP relaxation after problem modification (try GUB).
OsiClpSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiClpSolverInterface::setRowName
virtual void setRowName(int rowIndex, std::string name)
Set name of row.
OsiClpSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiClpSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max).
Definition OsiClpSolverInterface.hpp:451
OsiClpSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
Definition OsiClpSolverInterface.hpp:439
OsiClpSolverInterface::setLargestAway
void setLargestAway(double value)
Set largest amount continuous away from bound.
Definition OsiClpSolverInterface.hpp:1327
OsiClpSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiClpSolverInterface::factorization_
ClpFactorization * factorization_
factorization for hot starts
Definition OsiClpSolverInterface.hpp:1380
OsiClpSolverInterface::canDoSimplexInterface
virtual int canDoSimplexInterface() const
Simplex API capability.
OsiClpSolverInterface::getBInvACol
virtual void getBInvACol(int col, CoinIndexedVector *vec) const
Get a column of the tableau.
OsiClpSolverInterface::baseModel_
ClpSimplex * baseModel_
Copy of model when option 131072 set.
Definition OsiClpSolverInterface.hpp:1488
OsiClpSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiClpSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiClpSolverInterface::setSpecialOptionsMutable
void setSpecialOptionsMutable(unsigned int value) const
Set special options in underlying clp solver.
OsiClpSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
Definition OsiClpSolverInterface.hpp:399
OsiClpSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
OsiClpSolverInterface::extractSenseRhsRange
void extractSenseRhsRange() const
A method that fills up the rowsense_, rhs_ and rowrange_ arrays.
OsiClpSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
OsiClpSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiClpSolverInterface::itlimOrig_
int itlimOrig_
The original iteration limit before hotstarts started.
Definition OsiClpSolverInterface.hpp:1395
OsiClpSolverInterface::setBasisStatus
virtual int setBasisStatus(const int *cstat, const int *rstat)
Set the status of structural/artificial variables and factorize, update solution etc.
OsiClpSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiClpSolverInterface::smallestChangeInCut
double smallestChangeInCut() const
Get smallest change in cut.
Definition OsiClpSolverInterface.hpp:1125
OsiClpSolverInterface::fakeObjective
ClpLinearObjective * fakeObjective() const
Get fake objective.
Definition OsiClpSolverInterface.hpp:1162
OsiClpSolverInterface::setInteger
virtual void setInteger(const int *indices, int len)
Set the variables listed in indices (which is of length len) to be integer variables.
OsiClpSolverInterface::getInfinity
virtual double getInfinity() const
Get solver's value for infinity.
Definition OsiClpSolverInterface.hpp:512
OsiClpSolverInterface::modifyCoefficient
void modifyCoefficient(int row, int column, double newElement, bool keepZero=false)
Definition OsiClpSolverInterface.hpp:827
OsiClpSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiClpSolverInterface::freeCachedResults0
void freeCachedResults0() const
Deletes all mutable stuff for row ranges etc.
OsiClpSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiClpSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,).
Definition OsiClpSolverInterface.hpp:721
OsiClpSolverInterface::applyRowCuts
virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts)
Apply a collection of row cuts which are all effective.
OsiClpSolverInterface::replaceSetInfo
void replaceSetInfo(int numberSOS, CoinSet *setInfo)
Replace setInfo (takes over ownership).
OsiClpSolverInterface::stuff_
ClpNodeStuff stuff_
Stuff for fast dual.
Definition OsiClpSolverInterface.hpp:1372
OsiClpSolverInterface::OsiClpSolverInterface
OsiClpSolverInterface()
Default Constructor.
OsiClpSolverInterface::applyRowCuts
virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts)
Apply a collection of row cuts which are all effective.
OsiClpSolverInterface::addRow
virtual void addRow(int numberElements, const int *columns, const double *element, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiClpSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row .
OsiClpSolverInterface::setRowSetBounds
virtual void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously The default implementation just invokes setRowLowe...
OsiClpSolverInterface::setColName
virtual void setColName(int colIndex, std::string name)
Set name of column.
OsiClpSolverInterface::generateCpp
void generateCpp(FILE *fp)
Create C++ lines to get to current state.
OsiClpSolverInterface::notOwned_
bool notOwned_
To say if destructor should delete underlying model.
Definition OsiClpSolverInterface.hpp:1410
OsiClpSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition OsiClpSolverInterface.hpp:1357
OsiClpSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
Definition OsiClpSolverInterface.hpp:535
OsiClpSolverInterface::enableSimplexInterface
virtual void enableSimplexInterface(bool doingPrimal)
Enables simplex mode 2 (individual pivot control).
OsiClpSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiClpSolverInterface::stopFastDual
void stopFastDual()
Stop fast dual.
OsiClpSolverInterface::setInfo_
CoinSet * setInfo_
SOS set info.
Definition OsiClpSolverInterface.hpp:1376
OsiClpSolverInterface::setObjective
virtual void setObjective(const double *array)
Set the objective coefficients for all columns array [getNumCols()] is an array of values for the obj...
OsiClpSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename (defaults to Osi reader) - returns number of errors (see Osi...
OsiClpSolverInterface::synchronizeModel
virtual void synchronizeModel()
Synchronize model (really if no cuts in tree).
OsiClpSolverInterface::setRowSetTypes
virtual void setRowSetTypes(const int *indexFirst, const int *indexLast, const char *senseList, const double *rhsList, const double *rangeList)
Set the type of a number of rows simultaneously The default implementation just invokes setRowType()...
OsiClpSolverInterface::loadProblem
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 ...
OsiClpSolverInterface::setColLower
virtual void setColLower(const double *array)
Set the lower bounds for all columns array [getNumCols()] is an array of values for the objective.
OsiClpSolverInterface::solveOptions_
ClpSolve solveOptions_
Options for initialSolve.
Definition OsiClpSolverInterface.hpp:1444
OsiClpSolverInterface::disasterHandler_
OsiClpDisasterHandler * disasterHandler_
Possible disaster handler.
Definition OsiClpSolverInterface.hpp:1494
OsiClpSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiClpSolverInterface::OsiClpSolverInterfaceUnitTest
friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiClpSolverInterface class.
OsiClpSolverInterface::setHintParam
virtual bool setHintParam(OsiHintParam key, bool yesNo=true, OsiHintStrength strength=OsiHintTry, void *otherInformation=NULL)
OsiClpSolverInterface::crossover
void crossover(int options, int basis)
Solve when primal column and dual row solutions are near-optimal options - 0 no presolve (use primal ...
OsiClpSolverInterface::integerType
int integerType(int colIndex) const
Return integer type (0,1,2=optional,3=sc,4=scint).
Definition OsiClpSolverInterface.hpp:493
OsiClpSolverInterface::newLanguage
void newLanguage(CoinMessages::Language language)
Set language.
OsiClpSolverInterface::setColUpper
virtual void setColUpper(const double *array)
Set the upper bounds for all columns array [getNumCols()] is an array of values for the objective.
OsiClpSolverInterface::getConstPointerToWarmStart
const CoinWarmStartBasis * getConstPointerToWarmStart() const
Get warmstarting information.
Definition OsiClpSolverInterface.hpp:290
OsiClpSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiClpSolverInterface::specialOptions
unsigned int specialOptions() const
Get special options.
Definition OsiClpSolverInterface.hpp:1071
OsiClpSolverInterface::loadProblem
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...
OsiClpSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
Definition OsiClpSolverInterface.hpp:442
OsiClpSolverInterface::loadProblem
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 ...
OsiClpSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiClpSolverInterface::specialOptions_
unsigned int specialOptions_
Special options 0x80000000 off 0 simple stuff for branch and bound 1 try and keep work regions as muc...
Definition OsiClpSolverInterface.hpp:1486
OsiClpSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiClpSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if variable is general integer.
OsiClpSolverInterface::freeCachedResults1
void freeCachedResults1() const
Deletes all mutable stuff for matrix etc.
OsiClpSolverInterface::getPointerToWarmStart
virtual CoinWarmStart * getPointerToWarmStart(bool &mustDelete)
Get warm start information.
OsiClpSolverInterface::assignProblem
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...
OsiClpSolverInterface::disasterHandler
const OsiClpDisasterHandler * disasterHandler() const
Get disaster handler.
Definition OsiClpSolverInterface.hpp:1155
OsiClpSolverInterface::deleteScaleFactors
void deleteScaleFactors()
Delete all scale factor stuff and reset option.
OsiClpSolverInterface::computeLargestAway
void computeLargestAway()
Compute largest amount any at continuous away from bound.
OsiClpSolverInterface::lastNumberRows_
int lastNumberRows_
Number of rows when last "scaled".
Definition OsiClpSolverInterface.hpp:1490
OsiClpSolverInterface::setLastAlgorithm
void setLastAlgorithm(int value)
Set last algorithm used , 1 = primal, 2 = dual other unknown.
Definition OsiClpSolverInterface.hpp:1082
OsiClpSolverInterface::dualPivotResult
virtual int dualPivotResult(int &colIn, int &sign, int colOut, int outStatus, double &t, CoinPackedVector *dx)
Obtain a result of the dual pivot (similar to the previous method) Differences: entering variable and...
OsiClpSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
Definition OsiClpSolverInterface.hpp:373
OsiClpSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
OsiClpSolverInterface::getPointerToWarmStart
CoinWarmStartBasis * getPointerToWarmStart()
Get warmstarting information.
Definition OsiClpSolverInterface.hpp:285
OsiClpSolverInterface::fillParamMaps
void fillParamMaps()
OsiClpSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiClpSolverInterface::cleanupScaling
int cleanupScaling() const
Get scaling action option.
Definition OsiClpSolverInterface.hpp:1087
OsiClpSolverInterface::addCols
virtual void addCols(const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj)
OsiClpSolverInterface::columnScale_
CoinDoubleArrayWithLength columnScale_
Column scale factors (has inverse at end).
Definition OsiClpSolverInterface.hpp:1500
OsiClpSolverInterface::loadProblem
virtual void loadProblem(const ClpMatrixBase &matrix, 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 as a ClpMatrixBase.
OsiClpSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
Definition OsiClpSolverInterface.hpp:402
OsiClpSolverInterface::continuousModel_
ClpSimplex * continuousModel_
Continuous model.
Definition OsiClpSolverInterface.hpp:1492
OsiClpSolverInterface::setSpecialOptions
void setSpecialOptions(unsigned int value)
OsiClpSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiClpSolverInterface::setSmallestElementInCut
void setSmallestElementInCut(double value)
Set smallest allowed element in cut.
Definition OsiClpSolverInterface.hpp:1115
OsiClpSolverInterface::fakeMinInSimplex_
bool fakeMinInSimplex_
Faking min to get proper dual solution signs in simplex API.
Definition OsiClpSolverInterface.hpp:1432
OsiClpSolverInterface::startFastDual
int startFastDual(int options)
Start faster dual - returns negative if problems 1 if infeasible, Options to pass to solver 1 - creat...
OsiClpSolverInterface::largestAway
double largestAway() const
Get largest amount continuous away from bound.
Definition OsiClpSolverInterface.hpp:1322
OsiClpSolverInterface::whichRange_
int * whichRange_
Pointer to variables for which we want range information The number is in [0] memory is not owned by ...
Definition OsiClpSolverInterface.hpp:1425
OsiClpSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
OsiClpSolverInterface::OsiClpSolverInterface
OsiClpSolverInterface(ClpSimplex *rhs, bool reallyOwn=false)
Borrow constructor - only delete one copy.
OsiClpSolverInterface::passInRanges
void passInRanges(int *array)
Pass in range array.
Definition OsiClpSolverInterface.hpp:1312
OsiClpSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
OsiClpSolverInterface::setStuff
void setStuff(double tolerance, double increment)
Sets integer tolerance and increment.
OsiClpSolverInterface::setColSetBounds
virtual void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously The default implementation just invokes setColL...
OsiClpSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiClpSolverInterface::getNumElements
virtual CoinBigIndex getNumElements() const
Get number of nonzero elements.
Definition OsiClpSolverInterface.hpp:379
OsiClpSolverInterface::smallestElementInCut
double smallestElementInCut() const
Get smallest allowed element in cut.
Definition OsiClpSolverInterface.hpp:1109
OsiClpSolverInterface::smallestElementInCut_
double smallestElementInCut_
Smallest allowed element in cut.
Definition OsiClpSolverInterface.hpp:1383
OsiClpSolverInterface::ws_
CoinWarmStartBasis * ws_
A pointer to the warmstart information to be used in the hotstarts.
Definition OsiClpSolverInterface.hpp:1366
OsiClpSolverInterface::getRowName
virtual std::string getRowName(int rowIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return name of row if one exists or Rnnnnnnn maxLen is currently ignored and only there to match the ...
OsiClpSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if variable is binary.
OsiClpSolverInterface::setSmallestChangeInCut
void setSmallestChangeInCut(double value)
Set smallest change in cut.
Definition OsiClpSolverInterface.hpp:1135
OsiClpSolverInterface::modelPtr_
ClpSimplex * modelPtr_
Clp model represented by this class instance.
Definition OsiClpSolverInterface.hpp:1349
OsiClpSolverInterface::matrixByRowAtContinuous_
CoinPackedMatrix * matrixByRowAtContinuous_
Pointer to row-wise copy of continuous problem matrix coefficients.
Definition OsiClpSolverInterface.hpp:1416
OsiClpSolverInterface::smallestChangeInCut_
double smallestChangeInCut_
Smallest change in cut.
Definition OsiClpSolverInterface.hpp:1387
OsiClpSolverInterface::reset
virtual void reset()
Resets as if default constructor.
OsiClpSolverInterface::setBasis
void setBasis(const CoinWarmStartBasis &basis, ClpSimplex *model)
Sets up working basis as a copy of input.
OsiClpSolverInterface::setLanguage
void setLanguage(CoinMessages::Language language)
Definition OsiClpSolverInterface.hpp:1048
OsiClpSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiClpSolverInterface::primalPivotResult
virtual int primalPivotResult(int colIn, int sign, int &colOut, int &outStatus, double &t, CoinPackedVector *dx)
Obtain a result of the primal pivot Outputs: colOut – leaving column, outStatus – its status,...
OsiClpSolverInterface::smallModel_
ClpSimplex * smallModel_
Alternate model (hot starts) - but also could be permanent and used for crunch.
Definition OsiClpSolverInterface.hpp:1378
OsiClpSolverInterface::addCol
virtual void addCol(int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj, std::string name)
Add a named column (primal variable) to the problem.
OsiClpSolverInterface::setBasis
void setBasis()
Just puts current basis_ into ClpSimplex model.
Definition OsiClpSolverInterface.hpp:1292
OsiClpSolverInterface::lastAlgorithm
int lastAlgorithm() const
Last algorithm used , 1 = primal, 2 = dual other unknown.
Definition OsiClpSolverInterface.hpp:1077
OsiClpSolverInterface::getBInvARow
virtual void getBInvARow(int row, double *z, double *slack=NULL) const
Get a row of the tableau (slack part in slack if not NULL).
OsiClpSolverInterface::getBasisDiff
CoinWarmStartDiff * getBasisDiff(const unsigned char *statusArray) const
Warm start difference from basis_ to statusArray.
OsiClpSolverInterface::getMutableMatrixByCol
virtual CoinPackedMatrix * getMutableMatrixByCol() const
Get pointer to mutable column-wise copy of matrix.
OsiClpSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiClpSolverInterface::downRange
const double * downRange() const
Definition OsiClpSolverInterface.hpp:1307
OsiClpSolverInterface::isOptionalInteger
bool isOptionalInteger(int colIndex) const
Return true if column is integer but does not have to be declared as such.
OsiClpSolverInterface::setColumnStatus
void setColumnStatus(int iColumn, ClpSimplex::Status status)
Set column status in ClpSimplex and warmStart.
OsiClpSolverInterface::getReducedGradient
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Get the reduced gradient for the cost vector c.
OsiClpSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiClpSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
OsiClpSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition OsiClpSolverInterface.hpp:1354
OsiClpSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if column is integer.
OsiClpSolverInterface::saveData_
ClpDataSave saveData_
To save data in OsiSimplex stuff.
Definition OsiClpSolverInterface.hpp:1442
OsiClpSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiClpSolverInterface::loadFromCoinModel
virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution=false)
This loads a model from a coinModel object - returns number of errors.
OsiClpSolverInterface::readLp
virtual int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format (with names).
OsiClpSolverInterface::getBasis
CoinWarmStartBasis getBasis(ClpSimplex *model) const
Warm start.
OsiClpSolverInterface::setOptionalInteger
void setOptionalInteger(int index)
Set the index-th variable to be an optional integer variable.
OsiClpSolverInterface::writeLp
virtual void writeLp(const char *filename, const char *extension="lp", double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
Write the problem into an Lp file of the given filename.
OsiClpSolverInterface::passInMessageHandler
virtual void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler.
OsiClpSolverInterface::writeMpsNative
virtual int writeMpsNative(const char *filename, const char **rowNames, const char **columnNames, int formatType=0, int numberAcross=2, double objSense=0.0) const
Write the problem into an mps file of the given filename, names may be null.
OsiClpSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiClpSolverInterface::setupForRepeatedUse
void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0)
Set up solver for repeated use by Osi interface.
OsiClpSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment).
OsiClpSolverInterface::setSOSData
void setSOSData(int numberSOS, const char *type, const int *start, const int *indices, const double *weights=NULL)
Pass in sos stuff from AMPl.
OsiClpSolverInterface::integerInformation_
char * integerInformation_
Pointer to integer information.
Definition OsiClpSolverInterface.hpp:1419
OsiClpSolverInterface::setColBounds
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
OsiClpSolverInterface::basis_
CoinWarmStartBasis basis_
Warmstart information to be used in resolves.
Definition OsiClpSolverInterface.hpp:1393
OsiClpSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
OsiClpSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
OsiClpSolverInterface::setCleanupScaling
void setCleanupScaling(int value)
Set Scaling option When scaling is on it is possible that the scaled problem is feasible but the unsc...
Definition OsiClpSolverInterface.hpp:1103
OsiClpSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
OsiClpSolverInterface::setIntegerType
void setIntegerType(int colIndex, int value)
Set integer type (0,1,2=optional,3=sc,4=scint).
Definition OsiClpSolverInterface.hpp:498
OsiClpSolverInterface::addCol
virtual void addCol(int numberElements, const int *rows, const double *elements, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiClpSolverInterface::writeMps
virtual void writeMps(const char *filename, const char *extension="mps", double objSense=0.0) const
Write the problem into an mps file of the given filename.
OsiClpSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiClpSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const char rowsen, const double rowrhs, const double rowrng)
OsiClpSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
OsiClpSolverInterface::setSolveOptions
void setSolveOptions(const ClpSolve &options)
Pass in initial solve options.
Definition OsiClpSolverInterface.hpp:1140
OsiClpSolverInterface::assignProblem
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...
OsiClpSolverInterface::setRowBounds
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
OsiClpSolverInterface::getBasis
CoinWarmStartBasis * getBasis(const unsigned char *statusArray) const
Warm start from statusArray.
OsiClpSolverInterface::getColName
virtual std::string getColName(int colIndex, unsigned maxLen=static_cast< unsigned >(std::string::npos)) const
Return name of column if one exists or Cnnnnnnn maxLen is currently ignored and only there to match t...
OsiClpSolverInterface::readMps
int readMps(const char *filename, bool keepNames, bool allowErrors)
Read an mps file from the given filename returns number of errors (see OsiMpsReader class).
OsiClpSolverInterface::isHeuristicInteger
bool isHeuristicInteger(int colIndex) const
Return true only if integer and not optional.
Definition OsiClpSolverInterface.hpp:488
OsiClpSolverInterface::numberSOS_
int numberSOS_
Number of SOS sets.
Definition OsiClpSolverInterface.hpp:1374
OsiClpSolverInterface::numberSOS
int numberSOS() const
Number of SOS sets.
Definition OsiClpSolverInterface.hpp:696
OsiClpSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiClpSolverInterface::getBInvACol
virtual void getBInvACol(CoinIndexedVector *vec) const
Update (i.e.
OsiClpSolverInterface::addCols
virtual void addCols(const int numcols, const CoinBigIndex *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj)
OsiClpSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to constraint matrix).
OsiClpSolverInterface::columnActivity_
double * columnActivity_
Definition OsiClpSolverInterface.hpp:1370
OsiClpSolverInterface::basisIsAvailable
virtual bool basisIsAvailable() const
Returns true if a basis is available AND problem is optimal.
OsiClpSolverInterface::writeLp
virtual void writeLp(FILE *fp, double epsilon=1e-5, int numberAcross=10, int decimals=5, double objSense=0.0, bool useRowNames=true) const
Write the problem into the file pointed to by the parameter fp.
OsiClpSolverInterface::cleanupScaling_
int cleanupScaling_
Scaling option When scaling is on it is possible that the scaled problem is feasible but the unscaled...
Definition OsiClpSolverInterface.hpp:1457
OsiClpSolverInterface::upRange
const double * upRange() const
If doing fast hot start then ranges are computed.
Definition OsiClpSolverInterface.hpp:1303
OsiClpSolverInterface::getBasisStatus
virtual void getBasisStatus(int *cstat, int *rstat) const
The following two methods may be replaced by the methods of OsiSolverInterface using OsiWarmStartBasi...
OsiClpSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiClpSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
OsiClpSolverInterface::getBInvCol
virtual void getBInvCol(int col, double *vec) const
Get a column of the basis inverse.
OsiClpSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
OsiClpSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition OsiClpSolverInterface.hpp:1413
OsiClpSolverInterface::smallModelCut
OsiRowCut * smallModelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from small model.
OsiClpSolverInterface::modelCut
OsiRowCut * modelCut(const double *originalLower, const double *originalUpper, int numberRowsAtContinuous, const int *whichGenerator, int typeCut=0)
Return a conflict analysis cut from model If type is 0 then genuine cut, if 1 then only partially pro...
OsiClpSolverInterface::restoreBaseModel
virtual void restoreBaseModel(int numberRows)
Strip off rows to get to this number of rows.