Osi 0.107.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OsiTestSolverInterface.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This file is licensed under the terms of Eclipse Public License (EPL).
4
5 // this is a copy of OsiVolSolverInterface (trunk rev. 1466) renamed to OsiTestSolverInterface
6
7 #ifndef OsiTestSolverInterface_H
8 #define OsiTestSolverInterface_H
9
10 #include <string>
11
12 #include "OsiTestSolver.hpp"
13
14 #include "CoinPackedMatrix.hpp"
15
16 #include "OsiSolverInterface.hpp"
17
18 static const double OsiTestInfinity = 1.0e31;
19
20 //#############################################################################
21
27 class OsiTestSolverInterface :
28 virtual public OsiSolverInterface, public VOL_user_hooks {
29 friend void OsiTestSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
30
31 private:
32 class OsiVolMatrixOneMinusOne_ {
33 int majorDim_;
34 int minorDim_;
35
36 int plusSize_;
37 int * plusInd_;
38 int * plusStart_;
39 int * plusLength_;
40
41 int minusSize_;
42 int * minusInd_;
43 int * minusStart_;
44 int * minusLength_;
45
46 public:
47 OsiVolMatrixOneMinusOne_(const CoinPackedMatrix& m);
48 ~OsiVolMatrixOneMinusOne_();
49 void timesMajor(const double* x, double* y) const;
50 };
51
52 public:
53 //---------------------------------------------------------------------------
56 virtual void initialSolve();
58
60 virtual void resolve();
61
63 virtual void branchAndBound() {
64 throw CoinError("Sorry, the Volume Algorithm doesn't implement B&B",
65 "branchAndBound", "OsiTestSolverInterface");
66 }
68
69 //---------------------------------------------------------------------------
85 // Set an integer parameter
86 bool setIntParam(OsiIntParam key, int value);
87 // Set an double parameter
88 bool setDblParam(OsiDblParam key, double value);
89 // Set a string parameter
90 bool setStrParam(OsiStrParam key, const std::string & value);
91 // Get an integer parameter
92 bool getIntParam(OsiIntParam key, int& value) const;
93 // Get an double parameter
94 bool getDblParam(OsiDblParam key, double& value) const;
95 // Get a string parameter
96 bool getStrParam(OsiStrParam key, std::string& value) const;
98
99 //---------------------------------------------------------------------------
101
102 virtual bool isAbandoned() const;
105 virtual bool isProvenOptimal() const;
107 virtual bool isProvenPrimalInfeasible() const;
109 virtual bool isProvenDualInfeasible() const;
111 virtual bool isPrimalObjectiveLimitReached() const;
113 virtual bool isDualObjectiveLimitReached() const;
115 virtual bool isIterationLimitReached() const;
117
118 //---------------------------------------------------------------------------
127 virtual CoinWarmStart *getEmptyWarmStart () const ;
128
130 virtual CoinWarmStart* getWarmStart() const;
133 virtual bool setWarmStart(const CoinWarmStart* warmstart);
135
136 //---------------------------------------------------------------------------
143 virtual void markHotStart();
146 virtual void solveFromHotStart();
148 virtual void unmarkHotStart();
150
151 //---------------------------------------------------------------------------
166 virtual int getNumCols() const {
168 return rowMatrixCurrent_?
169 rowMatrix_.getNumCols() : colMatrix_.getNumCols(); }
170
172 virtual int getNumRows() const {
173 return rowMatrixCurrent_?
174 rowMatrix_.getNumRows() : colMatrix_.getNumRows(); }
175
177 virtual int getNumElements() const {
178 return rowMatrixCurrent_?
179 rowMatrix_.getNumElements() : colMatrix_.getNumElements(); }
180
182 virtual const double * getColLower() const { return collower_; }
183
185 virtual const double * getColUpper() const { return colupper_; }
186
196 virtual const char * getRowSense() const { return rowsense_; }
197
206 virtual const double * getRightHandSide() const { return rhs_; }
207
216 virtual const double * getRowRange() const { return rowrange_; }
217
219 virtual const double * getRowLower() const { return rowlower_; }
220
222 virtual const double * getRowUpper() const { return rowupper_; }
223
225 virtual const double * getObjCoefficients() const { return objcoeffs_; }
226
228 virtual double getObjSense() const { return objsense_; }
229
231 virtual bool isContinuous(int colNumber) const;
232
233 #if 0
234 virtual bool isBinary(int colNumber) const;
236
241 virtual bool isInteger(int colNumber) const;
242
244 virtual bool isIntegerNonBinary(int colNumber) const;
245
247 virtual bool isFreeBinary(int colNumber) const;
248 #endif
249
251 virtual const CoinPackedMatrix * getMatrixByRow() const;
252
254 virtual const CoinPackedMatrix * getMatrixByCol() const;
255
257 virtual double getInfinity() const { return OsiTestInfinity; }
259
262 virtual const double * getColSolution() const { return colsol_; }
264
266 virtual const double * getRowPrice() const { return rowprice_; }
267
269 virtual const double * getReducedCost() const { return rc_; }
270
273 virtual const double * getRowActivity() const { return lhs_; }
274
276 virtual double getObjValue() const {
277 #if 1
278 // This does not pass unitTest if getObjValue is called before solve
279 return lagrangeanCost_;
280 #else
281 return OsiSolverInterface::getObjValue();
282 #endif
283 }
284
287 virtual int getIterationCount() const { return volprob_.iter(); }
288
306 virtual std::vector<double*> getDualRays(int maxNumRays,
307 bool fullRay = false) const;
319 virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
320
321 #if 0
322
324 virtual OsiVectorInt getFractionalIndices(const double etol=1.e-05)
325 const;
326 #endif
327
328
329
330 //---------------------------------------------------------------------------
331
334 //-------------------------------------------------------------------------
338 virtual void setObjCoeff( int elementIndex, double elementValue ) {
339 objcoeffs_[elementIndex] = elementValue;
340 }
341
342 using OsiSolverInterface::setColLower ;
345 virtual void setColLower( int elementIndex, double elementValue ) {
346 collower_[elementIndex] = elementValue;
347 }
348
349 using OsiSolverInterface::setColUpper ;
352 virtual void setColUpper( int elementIndex, double elementValue ) {
353 colupper_[elementIndex] = elementValue;
354 }
355
357 virtual void setColBounds( int elementIndex,
358 double lower, double upper ) {
359 collower_[elementIndex] = lower;
360 colupper_[elementIndex] = upper;
361 }
362
371 virtual void setColSetBounds(const int* indexFirst,
372 const int* indexLast,
373 const double* boundList);
374
377 virtual void setRowLower( int elementIndex, double elementValue ) {
378 rowlower_[elementIndex] = elementValue;
379 convertBoundToSense(elementValue, rowupper_[elementIndex],
380 rowsense_[elementIndex], rhs_[elementIndex],
381 rowrange_[elementIndex]);
382 }
383
386 virtual void setRowUpper( int elementIndex, double elementValue ) {
387 rowupper_[elementIndex] = elementValue;
388 convertBoundToSense(rowlower_[elementIndex], elementValue,
389 rowsense_[elementIndex], rhs_[elementIndex],
390 rowrange_[elementIndex]);
391 }
392
394 virtual void setRowBounds( int elementIndex,
395 double lower, double upper ) {
396 rowlower_[elementIndex] = lower;
397 rowupper_[elementIndex] = upper;
398 convertBoundToSense(lower, upper,
399 rowsense_[elementIndex], rhs_[elementIndex],
400 rowrange_[elementIndex]);
401 }
402
404 virtual void setRowType(int index, char sense, double rightHandSide,
405 double range) {
406 rowsense_[index] = sense;
407 rhs_[index] = rightHandSide;
408 rowrange_[index] = range;
409 convertSenseToBound(sense, rightHandSide, range,
410 rowlower_[index], rowupper_[index]);
411 }
412
421 virtual void setRowSetBounds(const int* indexFirst,
422 const int* indexLast,
423 const double* boundList);
424
435 virtual void setRowSetTypes(const int* indexFirst,
436 const int* indexLast,
437 const char* senseList,
438 const double* rhsList,
439 const double* rangeList);
441
442 //-------------------------------------------------------------------------
446 virtual void setContinuous(int index);
448 virtual void setInteger(int index);
451 virtual void setContinuous(const int* indices, int len);
454 virtual void setInteger(const int* indices, int len);
456
457 //-------------------------------------------------------------------------
459 virtual void setObjSense(double s ) { objsense_ = s < 0 ? -1.0 : 1.0; }
460
471 virtual void setColSolution(const double * colsol);
472
483 virtual void setRowPrice(const double * rowprice);
484
485 //-------------------------------------------------------------------------
490
491 using OsiSolverInterface::addCol ;
493 virtual void addCol(const CoinPackedVectorBase& vec,
494 const double collb, const double colub,
495 const double obj);
496
497 using OsiSolverInterface::addCols ;
499 virtual void addCols(const int numcols,
500 const CoinPackedVectorBase * const * cols,
501 const double* collb, const double* colub,
502 const double* obj);
503 #if 0
504
505 virtual void addCols(const CoinPackedMatrix& matrix,
506 const double* collb, const double* colub,
507 const double* obj);
508 #endif
509
510 virtual void deleteCols(const int num, const int * colIndices);
511
512 using OsiSolverInterface::addRow ;
514 virtual void addRow(const CoinPackedVectorBase& vec,
515 const double rowlb, const double rowub);
517 virtual void addRow(const CoinPackedVectorBase& vec,
518 const char rowsen, const double rowrhs,
519 const double rowrng);
520
521 using OsiSolverInterface::addRows ;
523 virtual void addRows(const int numrows,
524 const CoinPackedVectorBase * const * rows,
525 const double* rowlb, const double* rowub);
527 virtual void addRows(const int numrows,
528 const CoinPackedVectorBase * const * rows,
529 const char* rowsen, const double* rowrhs,
530 const double* rowrng);
531 #if 0
532
533 virtual void addRows(const CoinPackedMatrix& matrix,
534 const double* rowlb, const double* rowub);
536 virtual void addRows(const CoinPackedMatrix& matrix,
537 const char* rowsen, const double* rowrhs,
538 const double* rowrng);
539 #endif
540
541 virtual void deleteRows(const int num, const int * rowIndices);
542
543 //-----------------------------------------------------------------------
544 #if 0
545
566 virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
567 double effectivenessLb = 0.0);
568 #endif
569
570
571
572 //---------------------------------------------------------------------------
573
574 protected:
576 void initFromRlbRub(const int rownum,
577 const double* rowlb, const double* rowub);
578 void initFromRhsSenseRange(const int rownum, const char* rowsen,
579 const double* rowrhs, const double* rowrng);
580 void initFromClbCubObj(const int colnum, const double* collb,
581 const double* colub, const double* obj);
582 public:
583
597 virtual void loadProblem(const CoinPackedMatrix& matrix,
598 const double* collb, const double* colub,
599 const double* obj,
600 const double* rowlb, const double* rowub);
601
609 virtual void assignProblem(CoinPackedMatrix*& matrix,
610 double*& collb, double*& colub, double*& obj,
611 double*& rowlb, double*& rowub);
612
625 virtual void loadProblem(const CoinPackedMatrix& matrix,
626 const double* collb, const double* colub,
627 const double* obj,
628 const char* rowsen, const double* rowrhs,
629 const double* rowrng);
630
638 virtual void assignProblem(CoinPackedMatrix*& matrix,
639 double*& collb, double*& colub, double*& obj,
640 char*& rowsen, double*& rowrhs,
641 double*& rowrng);
642
645 virtual void loadProblem(const int numcols, const int numrows,
646 const int* start, const int* index,
647 const double* value,
648 const double* collb, const double* colub,
649 const double* obj,
650 const double* rowlb, const double* rowub);
651
654 virtual void loadProblem(const int numcols, const int numrows,
655 const int* start, const int* index,
656 const double* value,
657 const double* collb, const double* colub,
658 const double* obj,
659 const char* rowsen, const double* rowrhs,
660 const double* rowrng);
661
662 using OsiSolverInterface::readMps ;
664 virtual int readMps(const char *filename,
665 const char *extension = "mps");
666
671 virtual void writeMps(const char *filename,
672 const char *extension = "mps",
673 double objSense=0.0) const;
675
676 //---------------------------------------------------------------------------
677
680 VOL_problem* volprob() { return &volprob_; }
683
684 //---------------------------------------------------------------------------
685
688 OsiTestSolverInterface ();
690
692 virtual OsiSolverInterface * clone(bool copyData = true) const;
693
695 OsiTestSolverInterface (const OsiTestSolverInterface &);
696
698 OsiTestSolverInterface & operator=(const OsiTestSolverInterface& rhs);
699
701 virtual ~OsiTestSolverInterface ();
703
704 //---------------------------------------------------------------------------
705
706 protected:
708
709
710 virtual void applyRowCut(const OsiRowCut& rc);
711
713 virtual void applyColCut(const OsiColCut& cc);
715
716 //---------------------------------------------------------------------------
717
718 private:
721 virtual int compute_rc(const VOL_dvector& u, VOL_dvector& rc);
724 virtual int solve_subproblem(const VOL_dvector& dual,
725 const VOL_dvector& rc,
726 double& lcost, VOL_dvector& x, VOL_dvector& v,
727 double& pcost);
730 virtual int heuristics(const VOL_problem& /*p*/,
731 const VOL_dvector& /*x*/, double& heur_val) {
732 heur_val = COIN_DBL_MAX;
733 return 0;
734 }
736
737 //---------------------------------------------------------------------------
738
739 private:
743 void updateRowMatrix_() const;
745 void updateColMatrix_() const;
746
749 void checkData_() const;
752 void compute_rc_(const double* u, double* rc) const;
754 void gutsOfDestructor_();
755
758 void rowRimAllocator_();
761 void colRimAllocator_();
762
764 void rowRimResize_(const int newSize);
766 void colRimResize_(const int newSize);
767
769 void convertBoundsToSenses_();
771 void convertSensesToBounds_();
772
774 bool test_zero_one_minusone_(const CoinPackedMatrix& m) const;
776
777 //---------------------------------------------------------------------------
778
779 private:
780
781 //---------------------------------------------------------------------------
785 mutable bool rowMatrixCurrent_;
788 mutable CoinPackedMatrix rowMatrix_;
790 mutable bool colMatrixCurrent_;
792 mutable CoinPackedMatrix colMatrix_;
794
795 //---------------------------------------------------------------------------
798 bool isZeroOneMinusOne_;
801 OsiVolMatrixOneMinusOne_* rowMatrixOneMinusOne_;
803 OsiVolMatrixOneMinusOne_* colMatrixOneMinusOne_;
805
806 //---------------------------------------------------------------------------
809 double *colupper_;
812 double *collower_;
814 bool *continuous_;
816 double *rowupper_;
818 double *rowlower_;
820 char *rowsense_;
822 double *rhs_;
825 double *rowrange_;
827 double *objcoeffs_;
829
830 //---------------------------------------------------------------------------
832 double objsense_;
833
834 //---------------------------------------------------------------------------
837 double *colsol_;
840 double *rowprice_;
842 double *rc_;
844 double *lhs_;
846 double lagrangeanCost_;
848
849 //---------------------------------------------------------------------------
852 double *rowpriceHotStart_;
853
855 int maxNumrows_;
857 int maxNumcols_;
858
860 VOL_problem volprob_;
861 };
862
864 void
865 OsiTestSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
866
867 #endif
OsiTestSolverInterface::colRimResize_
void colRimResize_(const int newSize)
Reallocate the rim arrays corresponding to the columns.
OsiTestSolverInterface::setContinuous
virtual void setContinuous(int index)
Set the index-th variable to be a continuous variable.
OsiTestSolverInterface::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.
OsiTestSolverInterface::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...
CoinError
Error Class thrown by an exception.
Definition: CoinError.hpp:42
OsiTestSolverInterface::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.
OsiSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read a problem in MPS format from the given filename.
OsiTestSolverInterface::rowupper_
double * rowupper_
Pointer to dense vector of slack variable upper bounds.
Definition: OsiTestSolverInterface.hpp:816
OsiTestSolverInterface::getRowSense
virtual const char * getRowSense() const
Get pointer to array[getNumRows()] of row constraint senses.
Definition: OsiTestSolverInterface.hpp:196
OsiTestSolverInterface::compute_rc_
void compute_rc_(const double *u, double *rc) const
Compute the reduced costs (rc) with respect to the dual values given in u.
OsiTestSolverInterface::getIterationCount
virtual int getIterationCount() const
Get how many iterations it took to solve the problem (whatever &quot;iteration&quot; mean to the solver...
Definition: OsiTestSolverInterface.hpp:287
OsiTestSolverInterface::isProvenDualInfeasible
virtual bool isProvenDualInfeasible() const
Is dual infeasiblity proven?
CoinPackedMatrix::getNumElements
CoinBigIndex getNumElements() const
Number of entries in the packed matrix.
Definition: CoinPackedMatrix.hpp:107
OsiTestSolverInterface::setRowType
virtual void setRowType(int index, char sense, double rightHandSide, double range)
Set the type of a single row
Definition: OsiTestSolverInterface.hpp:404
OsiTestSolverInterface::isDualObjectiveLimitReached
virtual bool isDualObjectiveLimitReached() const
Is the given dual objective limit reached?
OsiTestSolverInterface::rowrange_
double * rowrange_
Pointer to dense vector of slack upper bounds for range constraints (undefined for non-range rows)...
Definition: OsiTestSolverInterface.hpp:825
OsiTestSolverInterface::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...
OsiTestSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -COIN_DBL_MAX for -infinity.
Definition: OsiTestSolverInterface.hpp:345
OsiTestSolverInterface::colMatrixCurrent_
bool colMatrixCurrent_
A flag indicating whether the column ordered matrix is up-to-date.
Definition: OsiTestSolverInterface.hpp:790
OsiTestSolverInterface::getColLower
virtual const double * getColLower() const
Get pointer to array[getNumCols()] of column lower bounds.
Definition: OsiTestSolverInterface.hpp:182
OsiTestSolver.hpp
OsiTestSolverInterface::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...
OsiTestSolverInterface::setColBounds
virtual void setColBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
Definition: OsiTestSolverInterface.hpp:357
OsiTestSolverInterface::getObjSense
virtual double getObjSense() const
Get objective function sense (1 for min (default), -1 for max)
Definition: OsiTestSolverInterface.hpp:228
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::majorDim_
int majorDim_
Definition: OsiTestSolverInterface.hpp:33
OsiTestSolverInterface::initFromClbCubObj
void initFromClbCubObj(const int colnum, const double *collb, const double *colub, const double *obj)
OsiTestSolverInterface::applyColCut
virtual void applyColCut(const OsiColCut &cc)
Apply a column cut (adjust one or more bounds).
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::plusLength_
int * plusLength_
Definition: OsiTestSolverInterface.hpp:39
VOL_user_hooks
The user hooks should be overridden by the user to provide the problem specific routines for the volu...
Definition: OsiTestSolver.hpp:565
OsiSolverInterface::isIntegerNonBinary
virtual bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiTestSolverInterface::maxNumcols_
int maxNumcols_
allocated size of the column related rim vectors
Definition: OsiTestSolverInterface.hpp:857
OsiTestSolverInterface::getColUpper
virtual const double * getColUpper() const
Get pointer to array[getNumCols()] of column upper bounds.
Definition: OsiTestSolverInterface.hpp:185
VOL_problem::iter
int iter() const
returns the iteration number
Definition: OsiTestSolver.hpp:683
OsiSolverInterface::setColLower
virtual void setColLower(int elementIndex, double elementValue)=0
Set a single column lower bound.
OsiTestSolverInterface::updateColMatrix_
void updateColMatrix_() const
Update the column ordered matrix from the row ordered one.
OsiTestSolverInterface::rowRimResize_
void rowRimResize_(const int newSize)
Reallocate the rim arrays corresponding to the rows.
OsiTestSolverInterface::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.
OsiDblParam
OsiDblParam
Definition: OsiSolverParameters.hpp:52
OsiTestSolverInterface::getRowActivity
virtual const double * getRowActivity() const
Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vecto...
Definition: OsiTestSolverInterface.hpp:273
OsiTestSolverInterface::isProvenOptimal
virtual bool isProvenOptimal() const
Is optimality proven?
OsiTestSolverInterface::setObjCoeff
virtual void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: OsiTestSolverInterface.hpp:338
OsiTestSolverInterface::isContinuous
virtual bool isContinuous(int colNumber) const
Return true if column is continuous.
OsiTestSolverInterface::getColSolution
virtual const double * getColSolution() const
Get pointer to array[getNumCols()] of primal solution vector.
Definition: OsiTestSolverInterface.hpp:263
OsiTestSolverInterface::rowMatrixCurrent_
bool rowMatrixCurrent_
A flag indicating whether the row ordered matrix is up-to-date.
Definition: OsiTestSolverInterface.hpp:786
OsiTestSolverInterface::getMatrixByCol
virtual const CoinPackedMatrix * getMatrixByCol() const
Get pointer to column-wise copy of matrix.
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_
Definition: OsiTestSolverInterface.hpp:32
VOL_problem
This class holds every data for the Volume Algorithm and its solve method must be invoked to solve th...
Definition: OsiTestSolver.hpp:607
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiColCut
Column Cut Class.
Definition: OsiColCut.hpp:23
OsiTestSolverInterface::heuristics
virtual int heuristics(const VOL_problem &, const VOL_dvector &, double &heur_val)
Starting from the primal vector x, run a heuristic to produce an integer solution.
Definition: OsiTestSolverInterface.hpp:730
OsiTestSolverInterface::setRowPrice
virtual void setRowPrice(const double *rowprice)
Set dual solution vector.
OsiTestSolverInterface::unmarkHotStart
virtual void unmarkHotStart()
Delete the snapshot.
OsiTestSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get a string parameter.
OsiTestSolverInterface::getEmptyWarmStart
virtual CoinWarmStart * getEmptyWarmStart() const
Get an empty warm start object.
OsiTestSolverInterface::isAbandoned
virtual bool isAbandoned() const
Are there a numerical difficulties?
OsiSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)=0
Set a single column upper bound.
OsiTestSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiTestSolverInterface::convertSensesToBounds_
void convertSensesToBounds_()
For each row convert sense/rhs style row constraints to LB/UB style.
OsiTestSolverInterface::getObjCoefficients
virtual const double * getObjCoefficients() const
Get pointer to array[getNumCols()] of objective function coefficients.
Definition: OsiTestSolverInterface.hpp:225
OsiTestSolverInterface::branchAndBound
virtual void branchAndBound()
Invoke solver&#39;s built-in enumeration algorithm.
Definition: OsiTestSolverInterface.hpp:63
OsiTestSolverInterface::colsol_
double * colsol_
Pointer to dense vector of primal structural variable values.
Definition: OsiTestSolverInterface.hpp:838
OsiTestSolverInterface::colMatrix_
CoinPackedMatrix colMatrix_
The problem matrix in a column ordered form.
Definition: OsiTestSolverInterface.hpp:792
OsiSolverInterface::isInteger
virtual bool isInteger(int colIndex) const
Return true if the variable is integer.
OsiTestSolverInterface::isProvenPrimalInfeasible
virtual bool isProvenPrimalInfeasible() const
Is primal infeasiblity proven?
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::minorDim_
int minorDim_
Definition: OsiTestSolverInterface.hpp:34
OsiTestSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get a double parameter.
OsiTestSolverInterface::isZeroOneMinusOne_
bool isZeroOneMinusOne_
An indicator whether the matrix is 0/1/-1.
Definition: OsiTestSolverInterface.hpp:799
OsiSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)=0
Add a column (primal variable) to the problem.
OsiTestSolverInterface::colupper_
double * colupper_
Pointer to dense vector of structural variable upper bounds.
Definition: OsiTestSolverInterface.hpp:810
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
OsiTestSolverInterface::collower_
double * collower_
Pointer to dense vector of structural variable lower bounds.
Definition: OsiTestSolverInterface.hpp:812
OsiTestSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an integer parameter.
OsiTestSolverInterfaceUnitTest
void OsiTestSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiTestSolverInterface class.
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
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...
OsiTestSolverInterface::objsense_
double objsense_
Sense of objective (1 for min; -1 for max)
Definition: OsiTestSolverInterface.hpp:832
OsiTestSolverInterface::compute_rc
virtual int compute_rc(const VOL_dvector &u, VOL_dvector &rc)
compute reduced costs
CoinPackedMatrix::getNumCols
int getNumCols() const
Number of columns.
Definition: CoinPackedMatrix.hpp:110
OsiTestSolverInterface::updateRowMatrix_
void updateRowMatrix_() const
Update the row ordered matrix from the column ordered one.
OsiVectorInt
std::vector< int > OsiVectorInt
Vector of int.
Definition: OsiCollections.hpp:22
OsiTestSolverInterface::objcoeffs_
double * objcoeffs_
Pointer to dense vector of objective coefficients.
Definition: OsiTestSolverInterface.hpp:827
OsiSolverInterface::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.
OsiTestSolverInterface::getNumElements
virtual int getNumElements() const
Get number of nonzero elements.
Definition: OsiTestSolverInterface.hpp:177
OsiTestSolverInterface::continuous_
bool * continuous_
Pointer to dense vector of bool to indicate if column is continuous.
Definition: OsiTestSolverInterface.hpp:814
OsiTestSolverInterface
Vol(ume) Solver Interface.
Definition: OsiTestSolverInterface.hpp:27
OsiTestSolverInterface::lhs_
double * lhs_
Pointer to dense vector of left hand sides (row activity levels)
Definition: OsiTestSolverInterface.hpp:844
OsiTestSolverInterface::initFromRlbRub
void initFromRlbRub(const int rownum, const double *rowlb, const double *rowub)
OsiTestSolverInterface::rowlower_
double * rowlower_
Pointer to dense vector of slack variable lower bounds.
Definition: OsiTestSolverInterface.hpp:818
OsiTestSolverInterface::colRimAllocator_
void colRimAllocator_()
A method allocating sufficient space for the rim vectors corresponding to the columns.
OsiTestSolverInterface::deleteRows
virtual void deleteRows(const int num, const int *rowIndices)
Delete a set of rows (constraints) from the problem.
OsiTestSolverInterface::setInteger
virtual void setInteger(int index)
Set the index-th variable to be an integer variable.
OsiTestSolverInterface::volprob
VOL_problem * volprob()
Get pointer to Vol model.
Definition: OsiTestSolverInterface.hpp:681
OsiTestSolverInterface::getReducedCost
virtual const double * getReducedCost() const
Get a pointer to array[getNumCols()] of reduced costs.
Definition: OsiTestSolverInterface.hpp:269
OsiTestSolverInterface::setObjSense
virtual void setObjSense(double s)
Set objective function sense (1 for min (default), -1 for max,)
Definition: OsiTestSolverInterface.hpp:459
OsiTestSolverInterface::setRowBounds
virtual void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
Definition: OsiTestSolverInterface.hpp:394
OsiStrParam
OsiStrParam
Definition: OsiSolverParameters.hpp:88
OsiTestSolverInterface::rc_
double * rc_
Pointer to dense vector of reduced costs.
Definition: OsiTestSolverInterface.hpp:842
OsiTestSolverInterface::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()...
OsiSolverInterface::convertSenseToBound
void convertSenseToBound(const char sense, const double right, const double range, double &lower, double &upper) const
A quick inlined function to convert from the sense/rhs/range style of constraint definition to the lb...
Definition: OsiSolverInterface.hpp:2115
OsiSolverInterface::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.
OsiSolverInterface::isBinary
virtual bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiTestSolverInterface::lagrangeanCost_
double lagrangeanCost_
The Lagrangean cost, a lower bound on the objective value.
Definition: OsiTestSolverInterface.hpp:846
OsiTestSolverInterface::operator=
OsiTestSolverInterface & operator=(const OsiTestSolverInterface &rhs)
Assignment operator.
OsiTestSolverInterface::getMatrixByRow
virtual const CoinPackedMatrix * getMatrixByRow() const
Get pointer to row-wise copy of matrix.
OsiTestSolverInterface::getWarmStart
virtual CoinWarmStart * getWarmStart() const
Get warmstarting information.
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::minusSize_
int minusSize_
Definition: OsiTestSolverInterface.hpp:41
OsiTestSolverInterface::getRowLower
virtual const double * getRowLower() const
Get pointer to array[getNumRows()] of row lower bounds.
Definition: OsiTestSolverInterface.hpp:219
OsiSolverInterface::getObjValue
virtual double getObjValue() const =0
Get the objective function value.
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
OsiTestSolverInterface::addCol
virtual void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (primal variable) to the problem.
CoinPackedMatrix::getNumRows
int getNumRows() const
Number of rows.
Definition: CoinPackedMatrix.hpp:114
OsiTestSolverInterface::clone
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
OsiTestSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an integer parameter.
OsiTestSolverInterface::OsiTestSolverInterfaceUnitTest
friend void OsiTestSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir)
A function that tests the methods in the OsiTestSolverInterface class.
OsiTestSolverInterface::setWarmStart
virtual bool setWarmStart(const CoinWarmStart *warmstart)
Set warmstarting information.
OsiSolverInterface::applyCuts
virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs, double effectivenessLb=0.0)
Apply a collection of cuts.
OsiTestSolverInterface::isIterationLimitReached
virtual bool isIterationLimitReached() const
Iteration limit reached?
OsiTestSolverInterface::getPrimalRays
virtual std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiTestSolverInterface::getRowRange
virtual const double * getRowRange() const
Get pointer to array[getNumRows()] of row ranges.
Definition: OsiTestSolverInterface.hpp:216
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::plusStart_
int * plusStart_
Definition: OsiTestSolverInterface.hpp:38
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
OsiTestSolverInterface::initialSolve
virtual void initialSolve()
Solve initial LP relaxation.
OsiTestSolverInterface::getRowUpper
virtual const double * getRowUpper() const
Get pointer to array[getNumRows()] of row upper bounds.
Definition: OsiTestSolverInterface.hpp:222
OsiTestSolverInterface::setRowUpper
virtual void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use COIN_DBL_MAX for infinity.
Definition: OsiTestSolverInterface.hpp:386
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::plusInd_
int * plusInd_
Definition: OsiTestSolverInterface.hpp:37
OsiTestSolverInterface::setRowLower
virtual void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -COIN_DBL_MAX for -infinity.
Definition: OsiTestSolverInterface.hpp:377
OsiSolverInterface.hpp
OsiTestSolverInterface::setColSolution
virtual void setColSolution(const double *colsol)
Set the primal solution column values.
OsiSolverInterface::convertBoundToSense
void convertBoundToSense(const double lower, const double upper, char &sense, double &right, double &range) const
A quick inlined function to convert from the lb/ub style of constraint definition to the sense/rhs/ra...
Definition: OsiSolverInterface.hpp:2081
OsiSolverInterface::isFreeBinary
virtual bool isFreeBinary(int colIndex) const
Return true if the variable is binary and not fixed.
OsiTestSolverInterface::applyRowCut
virtual void applyRowCut(const OsiRowCut &rc)
Apply a row cut (append to constraint matrix).
OsiTestSolverInterface::convertBoundsToSenses_
void convertBoundsToSenses_()
For each row convert LB/UB style row constraints to sense/rhs style.
OsiTestSolverInterface::readMps
virtual int readMps(const char *filename, const char *extension="mps")
Read an mps file from the given filename.
OsiTestSolverInterface::rhs_
double * rhs_
Pointer to dense vector of row right-hand side values.
Definition: OsiTestSolverInterface.hpp:822
OsiTestSolverInterface::getInfinity
virtual double getInfinity() const
Get solver&#39;s value for infinity.
Definition: OsiTestSolverInterface.hpp:257
OsiTestSolverInterface::checkData_
void checkData_() const
Test whether the Volume Algorithm can be applied to the given problem.
OsiTestSolverInterface::getDualRays
virtual std::vector< double * > getDualRays(int maxNumRays, bool fullRay=false) const
Get as many dual rays as the solver can provide.
OsiTestSolverInterface::rowprice_
double * rowprice_
Pointer to dense vector of dual row variable values.
Definition: OsiTestSolverInterface.hpp:840
OsiTestSolverInterface::rowMatrixOneMinusOne_
OsiVolMatrixOneMinusOne_ * rowMatrixOneMinusOne_
The row ordered matrix without the elements.
Definition: OsiTestSolverInterface.hpp:801
OsiTestSolverInterface::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...
OsiTestSolverInterface::rowsense_
char * rowsense_
Pointer to dense vector of row sense indicators.
Definition: OsiTestSolverInterface.hpp:820
OsiTestSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set a string parameter.
OsiTestSolverInterface::resolve
virtual void resolve()
Resolve an LP relaxation after problem modification.
OsiTestSolverInterface::isPrimalObjectiveLimitReached
virtual bool isPrimalObjectiveLimitReached() const
Is the given primal objective limit reached?
OsiIntParam
OsiIntParam
Definition: OsiSolverParameters.hpp:8
OsiTestInfinity
static const double OsiTestInfinity
Definition: OsiTestSolverInterface.hpp:18
OsiTestSolverInterface::maxNumrows_
int maxNumrows_
allocated size of the row related rim vectors
Definition: OsiTestSolverInterface.hpp:855
OsiTestSolverInterface::solveFromHotStart
virtual void solveFromHotStart()
Optimize starting from the hotstart.
OsiTestSolverInterface::gutsOfDestructor_
void gutsOfDestructor_()
A method deleting every member data.
OsiTestSolverInterface::getRowPrice
virtual const double * getRowPrice() const
Get pointer to array[getNumRows()] of dual prices.
Definition: OsiTestSolverInterface.hpp:266
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::minusInd_
int * minusInd_
Definition: OsiTestSolverInterface.hpp:42
OsiSolverInterface::addRow
virtual void addRow(const CoinPackedVectorBase &vec, const double rowlb, const double rowub)=0
Add a row (constraint) to the problem.
OsiTestSolverInterface::rowMatrix_
CoinPackedMatrix rowMatrix_
The problem matrix in a row ordered form.
Definition: OsiTestSolverInterface.hpp:788
OsiTestSolverInterface::getObjValue
virtual double getObjValue() const
Get objective function value.
Definition: OsiTestSolverInterface.hpp:276
COIN_DBL_MAX
const double COIN_DBL_MAX
Definition: CoinFinite.hpp:18
OsiTestSolverInterface::solve_subproblem
virtual int solve_subproblem(const VOL_dvector &dual, const VOL_dvector &rc, double &lcost, VOL_dvector &x, VOL_dvector &v, double &pcost)
Solve the subproblem for the subgradient step.
OsiTestSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set a double parameter.
OsiTestSolverInterface::test_zero_one_minusone_
bool test_zero_one_minusone_(const CoinPackedMatrix &m) const
test whether the given matrix is 0/1/-1 entries only.
OsiTestSolverInterface::markHotStart
virtual void markHotStart()
Create a hotstart point of the optimization process.
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::OsiVolMatrixOneMinusOne_
OsiVolMatrixOneMinusOne_(const CoinPackedMatrix &m)
OsiTestSolverInterface::OsiTestSolverInterface
OsiTestSolverInterface()
Default Constructor.
OsiTestSolverInterface::getNumCols
virtual int getNumCols() const
Get number of columns.
Definition: OsiTestSolverInterface.hpp:167
OsiTestSolverInterface::setColUpper
virtual void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use COIN_DBL_MAX for infinity.
Definition: OsiTestSolverInterface.hpp:352
OsiTestSolverInterface::volprob_
VOL_problem volprob_
The volume solver.
Definition: OsiTestSolverInterface.hpp:860
OsiTestSolverInterface::rowRimAllocator_
void rowRimAllocator_()
A method allocating sufficient space for the rim vectors corresponding to the rows.
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::minusLength_
int * minusLength_
Definition: OsiTestSolverInterface.hpp:44
VOL_dvector
vector of doubles.
Definition: OsiTestSolver.hpp:150
OsiTestSolverInterface::getNumRows
virtual int getNumRows() const
Get number of rows.
Definition: OsiTestSolverInterface.hpp:172
CoinWarmStart
Abstract base class for warm start information.
Definition: CoinWarmStart.hpp:21
OsiTestSolverInterface::rowpriceHotStart_
double * rowpriceHotStart_
An array to store the hotstart information between solveHotStart() calls.
Definition: OsiTestSolverInterface.hpp:852
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::plusSize_
int plusSize_
Definition: OsiTestSolverInterface.hpp:36
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::~OsiVolMatrixOneMinusOne_
~OsiVolMatrixOneMinusOne_()
OsiTestSolverInterface::initFromRhsSenseRange
void initFromRhsSenseRange(const int rownum, const char *rowsen, const double *rowrhs, const double *rowrng)
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::timesMajor
void timesMajor(const double *x, double *y) const
CoinPackedMatrix.hpp
OsiTestSolverInterface::~OsiTestSolverInterface
virtual ~OsiTestSolverInterface()
Destructor.
OsiTestSolverInterface::deleteCols
virtual void deleteCols(const int num, const int *colIndices)
Remove a set of columns (primal variables) from the problem.
OsiTestSolverInterface::getRightHandSide
virtual const double * getRightHandSide() const
Get pointer to array[getNumRows()] of rows right-hand sides.
Definition: OsiTestSolverInterface.hpp:206
OsiTestSolverInterface::colMatrixOneMinusOne_
OsiVolMatrixOneMinusOne_ * colMatrixOneMinusOne_
The column ordered matrix without the elements.
Definition: OsiTestSolverInterface.hpp:803
OsiTestSolverInterface::OsiVolMatrixOneMinusOne_::minusStart_
int * minusStart_
Definition: OsiTestSolverInterface.hpp:43