Osi  0.108.8
OsiXprSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This code is licensed under the terms of the Eclipse Public License (EPL).
4 
5 #ifndef OsiXprSolverInterface_H
6 #define OsiXprSolverInterface_H
7 
8 #include <string>
9 #include <cstdio>
10 
11 #include "OsiSolverInterface.hpp"
12 
13 typedef struct xo_prob_struct *XPRSprob;
14 
15 //#############################################################################
16 
21 class OsiXprSolverInterface : virtual public OsiSolverInterface {
22  friend void OsiXprSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
23 
24 public:
27  virtual void initialSolve();
29 
31  virtual void resolve();
32 
34  virtual void branchAndBound();
36 
52  // Set an integer parameter
53  bool setIntParam(OsiIntParam key, int value);
54  // Set an double parameter
55  bool setDblParam(OsiDblParam key, double value);
56  // Set a string parameter
57  bool setStrParam(OsiStrParam key, const std::string &value);
58  // Get an integer parameter
59  bool getIntParam(OsiIntParam key, int &value) const;
60  // Get an double parameter
61  bool getDblParam(OsiDblParam key, double &value) const;
62  // Get a string parameter
63  bool getStrParam(OsiStrParam key, std::string &value) const;
64  // Set mipstart option (pass column solution to XPRESS before MIP start)
65  void setMipStart(bool value) { domipstart = value; }
66  // Get mipstart option value
67  bool getMipStart() const { return domipstart; }
69 
70  //---------------------------------------------------------------------------
72 
73  virtual bool isAbandoned() const;
76  virtual bool isProvenOptimal() const;
78  virtual bool isProvenPrimalInfeasible() const;
80  virtual bool isProvenDualInfeasible() const;
82  virtual bool isPrimalObjectiveLimitReached() const;
84  virtual bool isDualObjectiveLimitReached() const;
86  virtual bool isIterationLimitReached() const;
88 
89  //---------------------------------------------------------------------------
92  CoinWarmStart *getEmptyWarmStart() const;
95  virtual CoinWarmStart *getWarmStart() const;
98  virtual bool setWarmStart(const CoinWarmStart *warmstart);
100 
101  //---------------------------------------------------------------------------
108  virtual void markHotStart();
111  virtual void solveFromHotStart();
113  virtual void unmarkHotStart();
115 
116  //---------------------------------------------------------------------------
131  virtual int getNumCols() const;
133 
135  virtual int getNumRows() const;
136 
138  virtual int getNumElements() const;
139 
141  virtual const double *getColLower() const;
142 
144  virtual const double *getColUpper() const;
145 
155  virtual const char *getRowSense() const;
156 
165  virtual const double *getRightHandSide() const;
166 
175  virtual const double *getRowRange() const;
176 
178  virtual const double *getRowLower() const;
179 
181  virtual const double *getRowUpper() const;
182 
184  virtual const double *getObjCoefficients() const;
185 
187  virtual double getObjSense() const;
188 
190  virtual bool isContinuous(int colIndex) const;
191 
192 #if 0
193  virtual bool isBinary(int colIndex) const;
195 
200  virtual bool isInteger(int colIndex) const;
201 
203  virtual bool isIntegerNonBinary(int colIndex) const;
204 
206  virtual bool isFreeBinary(int colIndex) const;
207 #endif
208  virtual const CoinPackedMatrix *getMatrixByRow() const;
210 
212  virtual const CoinPackedMatrix *getMatrixByCol() const;
213 
215  virtual double getInfinity() const;
217 
220  virtual const double *getColSolution() const;
222 
224  virtual const double *getRowPrice() const;
225 
227  virtual const double *getReducedCost() const;
228 
231  virtual const double *getRowActivity() const;
232 
234  virtual double getObjValue() const;
235 
238  virtual int getIterationCount() const;
239 
257  virtual std::vector< double * > getDualRays(int maxNumRays,
258  bool fullRay = false) const;
270  virtual std::vector< double * > getPrimalRays(int maxNumRays) const;
271 
272 #if 0
273 
275  virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
276  const;
277 #endif
278 
279 
280 
281  //---------------------------------------------------------------------------
282 
285  //-------------------------------------------------------------------------
289  virtual void setObjCoeff(int elementIndex, double elementValue);
290 
293  virtual void setColLower(int elementIndex, double elementValue);
294 
297  virtual void setColUpper(int elementIndex, double elementValue);
298 
302  virtual void setColBounds(int elementIndex,
303  double lower, double upper);
304 
313  virtual void setColSetBounds(const int *indexFirst,
314  const int *indexLast,
315  const double *boundList);
316 
319  virtual void setRowLower(int elementIndex, double elementValue);
320 
323  virtual void setRowUpper(int elementIndex, double elementValue);
324 
328  virtual void setRowBounds(int elementIndex,
329  double lower, double upper);
330 
332  virtual void setRowType(int index, char sense, double rightHandSide,
333  double range);
334 
343  virtual void setRowSetBounds(const int *indexFirst,
344  const int *indexLast,
345  const double *boundList);
346 
357  virtual void setRowSetTypes(const int *indexFirst,
358  const int *indexLast,
359  const char *senseList,
360  const double *rhsList,
361  const double *rangeList);
363 
364  //-------------------------------------------------------------------------
368  virtual void setContinuous(int index);
370  virtual void setInteger(int index);
373  virtual void setContinuous(const int *indices, int len);
376  virtual void setInteger(const int *indices, int len);
378 
379  //-------------------------------------------------------------------------
381  virtual void setObjSense(double s);
382 
393  virtual void setColSolution(const double *colsol);
394 
405  virtual void setRowPrice(const double *rowprice);
406 
407  //-------------------------------------------------------------------------
413  virtual void addCol(const CoinPackedVectorBase &vec,
414  const double collb, const double colub,
415  const double obj);
417  virtual void addCols(const int numcols,
418  const CoinPackedVectorBase *const *cols,
419  const double *collb, const double *colub,
420  const double *obj);
422  virtual void deleteCols(const int num, const int *colIndices);
423 
425  virtual void addRow(const CoinPackedVectorBase &vec,
426  const double rowlb, const double rowub);
428  virtual void addRow(const CoinPackedVectorBase &vec,
429  const char rowsen, const double rowrhs,
430  const double rowrng);
432  virtual void addRows(const int numrows,
433  const CoinPackedVectorBase *const *rows,
434  const double *rowlb, const double *rowub);
436  virtual void addRows(const int numrows,
437  const CoinPackedVectorBase *const *rows,
438  const char *rowsen, const double *rowrhs,
439  const double *rowrng);
441  virtual void deleteRows(const int num, const int *rowIndices);
442 #if 0
443  //-----------------------------------------------------------------------
465  virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
466  double effectivenessLb = 0.0);
468 
469 #endif
470  //---------------------------------------------------------------------------
471 
485  virtual void loadProblem(const CoinPackedMatrix &matrix,
486  const double *collb, const double *colub,
487  const double *obj,
488  const double *rowlb, const double *rowub);
489 
497  virtual void assignProblem(CoinPackedMatrix *&matrix,
498  double *&collb, double *&colub, double *&obj,
499  double *&rowlb, double *&rowub);
500 
513  virtual void loadProblem(const CoinPackedMatrix &matrix,
514  const double *collb, const double *colub,
515  const double *obj,
516  const char *rowsen, const double *rowrhs,
517  const double *rowrng);
518 
526  virtual void assignProblem(CoinPackedMatrix *&matrix,
527  double *&collb, double *&colub, double *&obj,
528  char *&rowsen, double *&rowrhs,
529  double *&rowrng);
530 
533  virtual void loadProblem(const int numcols, const int numrows,
534  const int *start, const int *index,
535  const double *value,
536  const double *collb, const double *colub,
537  const double *obj,
538  const double *rowlb, const double *rowub);
539 
542  virtual void loadProblem(const int numcols, const int numrows,
543  const int *start, const int *index,
544  const double *value,
545  const double *collb, const double *colub,
546  const double *obj,
547  const char *rowsen, const double *rowrhs,
548  const double *rowrng);
549 
551  virtual int readMps(const char *filename,
552  const char *extension = "mps");
553 
558  virtual void writeMps(const char *filename,
559  const char *extension = "mps",
560  double objSense = 0.0) const;
562 
570  void passInMessageHandler(CoinMessageHandler *handler);
572 
573  //---------------------------------------------------------------------------
574 
588  static void incrementInstanceCounter();
589 
598  static void decrementInstanceCounter();
599 
602  static unsigned int getNumInstances();
603 
605  XPRSprob getLpPtr() { return prob_; }
607 
609  static int version();
610 
613  static int iXprCallCount_;
614 
616  static FILE *getLogFilePtr();
619  static void setLogFileName(const char *filename);
621 
622 
625  OsiXprSolverInterface(int newrows = 50, int newnz = 100);
627 
629  virtual OsiSolverInterface *clone(bool copyData = true) const;
630 
633 
636 
638  virtual ~OsiXprSolverInterface();
640 
641  /***************************************************************************/
645 
649  virtual void getBasisStatus(int *cstat, int *rstat) const;
650 
651 protected:
654  virtual void applyRowCut(const OsiRowCut &rc);
656 
660  virtual void applyColCut(const OsiColCut &cc);
662 
663 private:
666  static const char *logFileName_;
668 
670  static FILE *logFilePtr_;
671 
673  static unsigned int numInstances_;
674 
676  static unsigned int osiSerial_;
677 
679 
682  void gutsOfCopy(const OsiXprSolverInterface &source);
684 
686  void gutsOfConstructor();
687 
689  void gutsOfDestructor();
690 
692  void freeSolution();
693 
696  void freeCachedResults();
697 
699  int getNumIntVars() const;
700 
703  void getVarTypes() const;
705 
709  void activateMe() const;
710 
715  bool isDataLoaded() const;
717 
718 
721 
724 
725  mutable XPRSprob prob_;
726 
728  mutable std::string xprProbname_;
730 
738  mutable CoinPackedMatrix *matrixByRow_;
739  mutable CoinPackedMatrix *matrixByCol_;
740 
742  mutable double *colupper_;
743 
745  mutable double *collower_;
746 
748  mutable double *rowupper_;
749 
751  mutable double *rowlower_;
752 
754  mutable char *rowsense_;
755 
757  mutable double *rhs_;
758 
762  mutable double *rowrange_;
763 
765  mutable double *objcoeffs_;
766 
768  mutable double objsense_;
769 
771  mutable double *colsol_;
772 
774  mutable double *rowsol_;
775 
777  mutable double *rowact_;
778 
780  mutable double *rowprice_;
781 
783  mutable double *colprice_;
784 
786  mutable int *ivarind_;
787 
796  mutable char *ivartype_;
797 
801  mutable char *vartype_;
802 
804  mutable bool lastsolvewasmip;
806 
807 
810 };
811 
812 //#############################################################################
814 void OsiXprSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
815 
816 #endif
817 
818 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
819 */
OsiXprSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
OsiXprSolverInterface::objcoeffs_
double * objcoeffs_
Pointer to dense vector of objective coefficients.
Definition: OsiXprSolverInterface.hpp:765
OsiXprSolverInterface::freeSolution
void freeSolution()
Destroy cached copy of solution data (whenever it changes)
OsiXprSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
OsiXprSolverInterface::rowlower_
double * rowlower_
Pointer to dense vector of slack variable lower bounds.
Definition: OsiXprSolverInterface.hpp:751
OsiXprSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
OsiXprSolverInterface::logFilePtr_
static FILE * logFilePtr_
The FILE* to the logfile.
Definition: OsiXprSolverInterface.hpp:670
OsiXprSolverInterface::xprProbname_
std::string xprProbname_
XPRESS problem name (should be unique for each saved problem)
Definition: OsiXprSolverInterface.hpp:728
OsiXprSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
OsiXprSolverInterface::isContinuous
virtual bool isContinuous(int colIndex) const
Return true if variable is continuous.
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiXprSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
OsiXprSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiXprSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
OsiXprSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
OsiXprSolverInterface::getInfinity
virtual double getInfinity() const
Get solver's value for infinity.
OsiXprSolverInterface::addCols
virtual void addCols(const int numcols, const CoinPackedVectorBase *const *cols, const double *collb, const double *colub, const double *obj)
Add a set of columns (primal variables) to the problem.
OsiXprSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
OsiXprSolverInterfaceUnitTest
void OsiXprSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiXprSolverInterface class.
OsiXprSolverInterface::setColBounds
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound The default implementation just invokes setColLower() and ...
OsiXprSolverInterface::prob_
XPRSprob prob_
Definition: OsiXprSolverInterface.hpp:725
OsiXprSolverInterface::rowact_
double * rowact_
Pointer to dense vector of primal slack variable values.
Definition: OsiXprSolverInterface.hpp:777
OsiXprSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiXprSolverInterface::getNumIntVars
int getNumIntVars() const
Number of integer variables in the problem.
OsiXprSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiXprSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiXprSolverInterface::passInMessageHandler
void passInMessageHandler(CoinMessageHandler *handler)
Pass in a message handler It is the client's responsibility to destroy a message handler installed by...
OsiXprSolverInterface::colprice_
double * colprice_
Pointer to dense vector of dual column variable values.
Definition: OsiXprSolverInterface.hpp:783
OsiXprSolverInterface::objsense_
double objsense_
Sense of objective (1 for min; -1 for max)
Definition: OsiXprSolverInterface.hpp:768
OsiXprSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiXprSolverInterface::OsiXprSolverInterfaceUnitTest
friend void OsiXprSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiXprSolverInterface class.
OsiXprSolverInterface::decrementInstanceCounter
static void decrementInstanceCounter()
XPRESS has a context that should be deleted after XPRESS calls.
OsiXprSolverInterface::collower_
double * collower_
Pointer to dense vector of structural variable lower bounds.
Definition: OsiXprSolverInterface.hpp:745
OsiXprSolverInterface::activateMe
void activateMe() const
Save the current problem in XPRESS (if necessary) and make this problem current (restore if necessary...
OsiXprSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiXprSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiXprSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiXprSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiXprSolverInterface::colupper_
double * colupper_
Pointer to dense vector of structural variable upper bounds.
Definition: OsiXprSolverInterface.hpp:742
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiXprSolverInterface::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...
OsiXprSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
OsiXprSolverInterface
XPRESS-MP Solver Interface.
Definition: OsiXprSolverInterface.hpp:21
OsiXprSolverInterface::addRows
virtual void addRows(const int numrows, const CoinPackedVectorBase *const *rows, const double *rowlb, const double *rowub)
Add a set of rows (constraints) to the problem.
OsiXprSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
OsiXprSolverInterface::domipstart
bool domipstart
Whether to pass a column solution to XPRESS before starting MIP solve (loadmipsol)
Definition: OsiXprSolverInterface.hpp:809
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiXprSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiXprSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiXprSolverInterface::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...
OsiXprSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
OsiXprSolverInterface::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()...
OsiXprSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiXprSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiXprSolverInterface::operator=
OsiXprSolverInterface & operator=(const OsiXprSolverInterface &rhs)
Assignment operator.
OsiXprSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
OsiXprSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiXprSolverInterface::osiSerial_
static unsigned int osiSerial_
Counts calls to incrementInstanceCounter()
Definition: OsiXprSolverInterface.hpp:676
OsiXprSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut. Return true if cut was applied.
OsiXprSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiXprSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiXprSolverInterface::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get empty warm start object.
OsiXprSolverInterface::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.
OsiXprSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiXprSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
OsiXprSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiXprSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
OsiXprSolverInterface::logFileName_
static const char * logFileName_
Name of the logfile.
Definition: OsiXprSolverInterface.hpp:667
OsiXprSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
OsiXprSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
OsiXprSolverInterface::incrementInstanceCounter
static void incrementInstanceCounter()
XPRESS has a context that must be created prior to all other XPRESS calls.
OsiXprSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiXprSolverInterface.hpp:757
OsiXprSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiXprSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
OsiXprSolverInterface::getVarTypes
void getVarTypes() const
Build cached copy of variable types.
OsiXprSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
OsiXprSolverInterface::getBasisStatus
virtual void getBasisStatus(int *cstat, int *rstat) const
Returns a basis status of the structural/artificial variables At present as warm start i....
OsiXprSolverInterface::matrixByCol_
CoinPackedMatrix * matrixByCol_
Definition: OsiXprSolverInterface.hpp:739
OsiXprSolverInterface::matrixByRow_
CoinPackedMatrix * matrixByRow_
Pointer to row-wise copy of problem matrix coefficients.
Definition: OsiXprSolverInterface.hpp:738
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:20
OsiXprSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
OsiXprSolverInterface::version
static int version()
Return XPRESS-MP Version number.
OsiXprSolverInterface::numInstances_
static unsigned int numInstances_
Number of live problem instances.
Definition: OsiXprSolverInterface.hpp:673
OsiXprSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiXprSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
OsiXprSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiXprSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiXprSolverInterface.hpp:754
XPRSprob
struct xo_prob_struct * XPRSprob
Definition: OsiXprSolverInterface.hpp:13
OsiXprSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiXprSolverInterface::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...
OsiXprSolverInterface::setLogFileName
static void setLogFileName(const char *filename)
Set logfile name.
OsiSolverInterface.hpp
OsiXprSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
OsiXprSolverInterface::OsiXprSolverInterface
OsiXprSolverInterface(int newrows=50, int newnz=100)
Default Constructor.
OsiXprSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
OsiXprSolverInterface::setMipStart
void setMipStart(bool value)
Definition: OsiXprSolverInterface.hpp:65
OsiXprSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiXprSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiXprSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiXprSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiXprSolverInterface::gutsOfCopy
void gutsOfCopy(const OsiXprSolverInterface &source)
The real work of a copy constructor (used by copy and assignment)
OsiXprSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiXprSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiXprSolverInterface::ivarind_
int * ivarind_
Pointer to list of indices of XPRESS "global" variables.
Definition: OsiXprSolverInterface.hpp:786
OsiXprSolverInterface::getNumInstances
static unsigned int getNumInstances()
Return the number of instances of instantiated objects using XPRESS services.
OsiXprSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiXprSolverInterface::rowprice_
double * rowprice_
Pointer to dense vector of dual row variable values.
Definition: OsiXprSolverInterface.hpp:780
OsiXprSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiXprSolverInterface::getMipStart
bool getMipStart() const
Definition: OsiXprSolverInterface.hpp:67
OsiXprSolverInterface::getLpPtr
XPRSprob getLpPtr()
Return a pointer to the XPRESS problem.
Definition: OsiXprSolverInterface.hpp:605
OsiXprSolverInterface::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...
OsiXprSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
OsiXprSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver's built-in enumeration algorithm.
OsiXprSolverInterface::setRowBounds
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound The default implementation just invokes setRowLower() and set...
OsiXprSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (bound adjustment).
OsiXprSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiXprSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiSolverInterface::getFractionalIndices
virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05) const
Get vector of indices of primal variables which are integer variables but have fractional values in t...
OsiXprSolverInterface::vartype_
char * vartype_
Pointer to dense vector of variable types (as above, or 'C' for continuous)
Definition: OsiXprSolverInterface.hpp:801
OsiXprSolverInterface::colsol_
double * colsol_
Pointer to dense vector of primal structural variable values.
Definition: OsiXprSolverInterface.hpp:771
OsiXprSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiXprSolverInterface::iXprCallCount_
static int iXprCallCount_
Definition: OsiXprSolverInterface.hpp:613
OsiXprSolverInterface::ivartype_
char * ivartype_
Pointer to list of global variable types:
Definition: OsiXprSolverInterface.hpp:796
OsiXprSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)
Definition: OsiXprSolverInterface.hpp:762
OsiXprSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever "iteration" mean to the solver.
OsiXprSolverInterface::freeCachedResults
void freeCachedResults()
Destroy cached copies of problem and solution data (whenever they change)
OsiXprSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
OsiXprSolverInterface::lastsolvewasmip
bool lastsolvewasmip
Indicates whether the last solve was for a MIP or an LP.
Definition: OsiXprSolverInterface.hpp:804
OsiXprSolverInterface::isDataLoaded
bool isDataLoaded() const
Save and restore are necessary if there is data associated with this problem.
OsiXprSolverInterface::gutsOfDestructor
void gutsOfDestructor()
The real work of a destructor (used by copy and assignment)
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
OsiXprSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiXprSolverInterface::~OsiXprSolverInterface
virtual ~OsiXprSolverInterface()
Destructor.
OsiXprSolverInterface::gutsOfConstructor
void gutsOfConstructor()
The real work of a constructor (used by construct and assignment)
OsiXprSolverInterface::rowsol_
double * rowsol_
Pointer to dense vector of primal slack variable values.
Definition: OsiXprSolverInterface.hpp:774
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:87
OsiXprSolverInterface::rowupper_
double * rowupper_
Pointer to dense vector of slack variable upper bounds.
Definition: OsiXprSolverInterface.hpp:748
OsiXprSolverInterface::getLogFilePtr
static FILE * getLogFilePtr()
Get logfile FILE *.