Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcLinked.hpp
Go to the documentation of this file.
1 /* $Id: CbcLinked.hpp 2465 2019-01-03 19:26:52Z unxusr $ */
2 // Copyright (C) 2006, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CglLinked_H
7 #define CglLinked_H
8 /* THIS CONTAINS STUFF THAT SHOULD BE IN
9  OsiSolverLink
10  OsiBranchLink
11  CglTemporary
12 */
13 #include "CoinModel.hpp"
15 #include "OsiChooseVariable.hpp"
16 #include "CbcFathom.hpp"
17 class CbcModel;
18 class CoinPackedMatrix;
19 class OsiLinkedBound;
20 class OsiObject;
21 class CglStored;
22 class CglTemporary;
29 class OsiSolverLink : public CbcOsiSolver {
30 
31 public:
32  //---------------------------------------------------------------------------
35  virtual void initialSolve();
37 
39  virtual void resolve();
40 
48  virtual int fathom(bool allFixed);
55  double *nonlinearSLP(int numberPasses, double deltaTolerance);
59  double linearizedBAB(CglStored *cut);
68  double *heuristicSolution(int numberPasses, double deltaTolerance, int mode);
69 
71  int doAOCuts(CglTemporary *cutGen, const double *solution, const double *solution2);
73 
76  OsiSolverLink();
78 
91  OsiSolverLink(CoinModel &modelObject);
92  // Other way with existing object
93  void load(CoinModel &modelObject, bool tightenBounds = false, int logLevel = 1);
95  virtual OsiSolverInterface *clone(bool copyData = true) const;
96 
99 
102 
104  virtual ~OsiSolverLink();
105 
107 
110  void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, int whichVariableAffected,
112  double multiplier = 1.0);
114  int updateCoefficients(ClpSimplex *solver, CoinPackedMatrix *matrix);
116  void analyzeObjects();
118  void addTighterConstraints();
120  inline double bestObjectiveValue() const
121  {
122  return bestObjectiveValue_;
123  }
125  inline void setBestObjectiveValue(double value)
126  {
127  bestObjectiveValue_ = value;
128  }
130  inline const double *bestSolution() const
131  {
132  return bestSolution_;
133  }
135  void setBestSolution(const double *solution, int numberColumns);
137  inline void setSpecialOptions2(int value)
138  {
139  specialOptions2_ = value;
140  }
142  void sayConvex(bool convex);
144  inline int specialOptions2() const
145  {
146  return specialOptions2_;
147  }
152  {
153  return matrix_;
154  }
160  {
161  return originalRowCopy_;
162  }
165  {
166  return quadraticModel_;
167  }
169  CoinPackedMatrix *quadraticRow(int rowNumber, double *linear) const;
171  inline double defaultMeshSize() const
172  {
173  return defaultMeshSize_;
174  }
175  inline void setDefaultMeshSize(double value)
176  {
177  defaultMeshSize_ = value;
178  }
180  inline double defaultBound() const
181  {
182  return defaultBound_;
183  }
184  inline void setDefaultBound(double value)
185  {
186  defaultBound_ = value;
187  }
189  inline void setIntegerPriority(int value)
190  {
191  integerPriority_ = value;
192  }
194  inline int integerPriority() const
195  {
196  return integerPriority_;
197  }
199  inline int objectiveVariable() const
200  {
201  return objectiveVariable_;
202  }
204  inline void setBiLinearPriority(int value)
205  {
206  biLinearPriority_ = value;
207  }
209  inline int biLinearPriority() const
210  {
211  return biLinearPriority_;
212  }
214  inline const CoinModel *coinModel() const
215  {
216  return &coinModel_;
217  }
219  void setBiLinearPriorities(int value, double meshSize = 1.0);
227  void setBranchingStrategyOnVariables(int strategyValue, int priorityValue = -1,
228  int mode = 7);
230  void setMeshSizes(double value);
234  void setFixedPriority(int priorityValue);
236 
237  //---------------------------------------------------------------------------
238 
239 protected:
242  //void initialize(ClpSimplex * & solver, OsiObject ** & object) const;
245  void gutsOfDestructor(bool justNullify = false);
247  void gutsOfCopy(const OsiSolverLink &rhs);
249 
271  int *convex_;
299  double *bestSolution_;
309 };
315 
316 public:
317  //---------------------------------------------------------------------------
320  void updateBounds(ClpSimplex *solver);
323 
326  OsiLinkedBound();
330  int numberAffected, const int *positionL,
331  const int *positionU, const double *multiplier);
332 
335 
338 
340  ~OsiLinkedBound();
341 
343 
346  inline int variable() const
348  {
349  return variable_;
350  }
352  void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable,
353  double multiplier = 1.0);
355 
356 protected:
357  typedef struct {
358  double multiplier; // to use in computation
359  int affected; // variable or element affected
360  /*
361  0 - LB of variable affected
362  1 - UB of variable affected
363  2 - element in position (affected) affected
364  */
365  unsigned char affect;
366  unsigned char ubUsed; // nonzero if UB of this variable is used
367  /*
368  0 - use x*multiplier
369  1 - use multiplier/x
370  2 - if UB use min of current upper and x*multiplier, if LB use max of current lower and x*multiplier
371  */
372  unsigned char type; // type of computation
374 
388 };
389 #include "CbcHeuristic.hpp"
394 public:
395  // Default Constructor
397 
398  /* Constructor with model
399  */
401 
402  // Copy constructor
404 
405  // Destructor
407 
409  virtual CbcHeuristic *clone() const;
410 
412  virtual void setModel(CbcModel *model);
413 
425  virtual int solution(double &objectiveValue,
426  double *newSolution);
428  virtual void resetModel(CbcModel *model);
430  virtual bool canDealWithOdd() const
431  {
432  return true;
433  }
434 
435 private:
438 };
439 
440 #include "OsiBranchingObject.hpp"
441 
445 class CoinWarmStartBasis;
446 
447 class OsiOldLink : public OsiSOS {
448 
449 public:
450  // Default Constructor
451  OsiOldLink();
452 
459  OsiOldLink(const OsiSolverInterface *solver, int numberMembers,
460  int numberLinks, int first,
461  const double *weights, int setNumber);
468  OsiOldLink(const OsiSolverInterface *solver, int numberMembers,
469  int numberLinks, int typeSOS, const int *which,
470  const double *weights, int setNumber);
471 
472  // Copy constructor
473  OsiOldLink(const OsiOldLink &);
474 
476  virtual OsiObject *clone() const;
477 
478  // Assignment operator
479  OsiOldLink &operator=(const OsiOldLink &rhs);
480 
481  // Destructor
482  virtual ~OsiOldLink();
483 
486  virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
487 
494  virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
495 
500  virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
501 
503  virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
504 
506  inline int numberLinks() const
507  {
508  return numberLinks_;
509  }
510 
513  virtual bool canDoHeuristics() const
514  {
515  return false;
516  }
519  virtual bool boundBranch() const
520  {
521  return false;
522  }
523 
524 protected:
526 
529 };
534 
535 public:
536  // Default Constructor
538 
539  // Useful constructor
541  int way,
542  double separator);
543 
544  // Copy constructor
546 
547  // Assignment operator
549 
551  virtual OsiBranchingObject *clone() const;
552 
553  // Destructor
554  virtual ~OsiOldLinkBranchingObject();
555 
558  virtual double branch(OsiSolverInterface *solver);
559 
563  virtual void print(const OsiSolverInterface *solver = NULL);
564 
565 private:
567 };
572 class OsiOneLink {
573 
574 public:
575  // Default Constructor
576  OsiOneLink();
577 
581  OsiOneLink(const OsiSolverInterface *solver, int xRow, int xColumn, int xyRow,
582  const char *functionString);
583 
584  // Copy constructor
585  OsiOneLink(const OsiOneLink &);
586 
587  // Assignment operator
588  OsiOneLink &operator=(const OsiOneLink &rhs);
589 
590  // Destructor
591  virtual ~OsiOneLink();
592 
594 
596  int xRow_;
598  int xColumn_;
600  int xyRow;
602  std::string function_;
603 };
612 class OsiLink : public OsiSOS {
613 
614 public:
615  // Default Constructor
616  OsiLink();
617 
621  OsiLink(const OsiSolverInterface *solver, int yRow,
622  int yColumn, double meshSize);
623 
624  // Copy constructor
625  OsiLink(const OsiLink &);
626 
628  virtual OsiObject *clone() const;
629 
630  // Assignment operator
631  OsiLink &operator=(const OsiLink &rhs);
632 
633  // Destructor
634  virtual ~OsiLink();
635 
638  virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
639 
646  virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
647 
652  virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
653 
655  virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
656 
658  inline int numberLinks() const
659  {
660  return numberLinks_;
661  }
662 
665  virtual bool canDoHeuristics() const
666  {
667  return false;
668  }
671  virtual bool boundBranch() const
672  {
673  return false;
674  }
675 
676 protected:
679  double meshSize_;
685  int yRow_;
687  int yColumn_;
688 };
693 
694 public:
695  // Default Constructor
697 
698  // Useful constructor
700  int way,
701  double separator);
702 
703  // Copy constructor
705 
706  // Assignment operator
708 
710  virtual OsiBranchingObject *clone() const;
711 
712  // Destructor
713  virtual ~OsiLinkBranchingObject();
714 
717  virtual double branch(OsiSolverInterface *solver);
718 
722  virtual void print(const OsiSolverInterface *solver = NULL);
723 
724 private:
726 };
733 class OsiBiLinear : public OsiObject2 {
734 
735 public:
736  // Default Constructor
737  OsiBiLinear();
738 
745  int yColumn, int xyRow, double coefficient,
746  double xMesh, double yMesh,
747  int numberExistingObjects = 0, const OsiObject **objects = NULL);
748 
754  OsiBiLinear(CoinModel *coinModel, int xColumn,
755  int yColumn, int xyRow, double coefficient,
756  double xMesh, double yMesh,
757  int numberExistingObjects = 0, const OsiObject **objects = NULL);
758 
759  // Copy constructor
760  OsiBiLinear(const OsiBiLinear &);
761 
763  virtual OsiObject *clone() const;
764 
765  // Assignment operator
766  OsiBiLinear &operator=(const OsiBiLinear &rhs);
767 
768  // Destructor
769  virtual ~OsiBiLinear();
770 
773  virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
774 
781  virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
782 
787  virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
788 
790  virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
791 
792  // This does NOT set mutable stuff
793  virtual double checkInfeasibility(const OsiBranchingInformation *info) const;
794 
797  virtual bool canDoHeuristics() const
798  {
799  return false;
800  }
803  virtual bool boundBranch() const
804  {
805  return (branchingStrategy_ & 4) != 0;
806  }
808  inline int xColumn() const
809  {
810  return xColumn_;
811  }
813  inline int yColumn() const
814  {
815  return yColumn_;
816  }
818  inline int xRow() const
819  {
820  return xRow_;
821  }
823  inline int yRow() const
824  {
825  return yRow_;
826  }
828  inline int xyRow() const
829  {
830  return xyRow_;
831  }
833  inline double coefficient() const
834  {
835  return coefficient_;
836  }
838  inline void setCoefficient(double value)
839  {
840  coefficient_ = value;
841  }
843  inline int firstLambda() const
844  {
845  return firstLambda_;
846  }
848  inline double xSatisfied() const
849  {
850  return xSatisfied_;
851  }
852  inline void setXSatisfied(double value)
853  {
854  xSatisfied_ = value;
855  }
857  inline double ySatisfied() const
858  {
859  return ySatisfied_;
860  }
861  inline void setYSatisfied(double value)
862  {
863  ySatisfied_ = value;
864  }
866  inline double xOtherSatisfied() const
867  {
868  return xOtherSatisfied_;
869  }
870  inline void setXOtherSatisfied(double value)
871  {
872  xOtherSatisfied_ = value;
873  }
875  inline double yOtherSatisfied() const
876  {
877  return yOtherSatisfied_;
878  }
879  inline void setYOtherSatisfied(double value)
880  {
881  yOtherSatisfied_ = value;
882  }
884  inline double xMeshSize() const
885  {
886  return xMeshSize_;
887  }
888  inline void setXMeshSize(double value)
889  {
890  xMeshSize_ = value;
891  }
893  inline double yMeshSize() const
894  {
895  return yMeshSize_;
896  }
897  inline void setYMeshSize(double value)
898  {
899  yMeshSize_ = value;
900  }
902  inline double xySatisfied() const
903  {
904  return xySatisfied_;
905  }
906  inline void setXYSatisfied(double value)
907  {
908  xySatisfied_ = value;
909  }
911  void setMeshSizes(const OsiSolverInterface *solver, double x, double y);
922  inline int branchingStrategy() const
923  {
924  return branchingStrategy_;
925  }
926  inline void setBranchingStrategy(int value)
927  {
928  branchingStrategy_ = value;
929  }
937  inline int boundType() const
938  {
939  return boundType_;
940  }
941  inline void setBoundType(int value)
942  {
943  boundType_ = value;
944  }
946  void newBounds(OsiSolverInterface *solver, int way, short xOrY, double separator) const;
948  int updateCoefficients(const double *lower, const double *upper, double *objective,
949  CoinPackedMatrix *matrix, CoinWarmStartBasis *basis) const;
951  double xyCoefficient(const double *solution) const;
953  void getCoefficients(const OsiSolverInterface *solver, double xB[2], double yB[2], double xybar[4]) const;
955  double computeLambdas(const double xB[3], const double yB[3], const double xybar[4], double lambda[4]) const;
957  void addExtraRow(int row, double multiplier);
959  void getPseudoShadow(const OsiBranchingInformation *info);
961  double getMovement(const OsiBranchingInformation *info);
962 
963 protected:
965  void computeLambdas(const OsiSolverInterface *solver, double lambda[4]) const;
967 
969  double coefficient_;
971  double xMeshSize_;
973  double yMeshSize_;
975  double xSatisfied_;
977  double ySatisfied_;
983  double xySatisfied_;
985  mutable double xyBranchValue_;
987  int xColumn_;
989  int yColumn_;
1012  int xRow_;
1014  int yRow_;
1016  int xyRow_;
1022  double *multiplier_;
1026  mutable short chosen_;
1027 };
1032 
1033 public:
1034  // Default Constructor
1036 
1037  // Useful constructor
1039  int way,
1040  double separator, int chosen);
1041 
1042  // Copy constructor
1044 
1045  // Assignment operator
1047 
1049  virtual OsiBranchingObject *clone() const;
1050 
1051  // Destructor
1052  virtual ~OsiBiLinearBranchingObject();
1053 
1056  virtual double branch(OsiSolverInterface *solver);
1057 
1061  virtual void print(const OsiSolverInterface *solver = NULL);
1064  virtual bool boundBranch() const;
1065 
1066 protected:
1069  short chosen_;
1070 };
1078 
1079 public:
1080  // Default Constructor
1082 
1089  int yColumn, int xyRow, double rhs,
1090  double xMesh);
1091 
1092  // Copy constructor
1094 
1096  virtual OsiObject *clone() const;
1097 
1098  // Assignment operator
1100 
1101  // Destructor
1102  virtual ~OsiBiLinearEquality();
1103 
1105  virtual double improvement(const OsiSolverInterface *solver) const;
1111  double newGrid(OsiSolverInterface *solver, int type) const;
1113  inline int numberPoints() const
1114  {
1115  return numberPoints_;
1116  }
1117  inline void setNumberPoints(int value)
1118  {
1119  numberPoints_ = value;
1120  }
1121 
1122 protected:
1125 };
1127 
1129 
1130 public:
1133 
1135  OsiSimpleFixedInteger(const OsiSolverInterface *solver, int iColumn);
1136 
1138  OsiSimpleFixedInteger(int iColumn, double lower, double upper);
1139 
1142 
1145 
1147  virtual OsiObject *clone() const;
1148 
1151 
1153  virtual ~OsiSimpleFixedInteger();
1154 
1157  virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
1158 
1163  virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
1164 
1165 protected:
1167 };
1177 
1178 public:
1180  OsiUsesBiLinear();
1181 
1183  OsiUsesBiLinear(const OsiSolverInterface *solver, int iColumn, int type);
1184 
1186  OsiUsesBiLinear(int iColumn, double lower, double upper, int type);
1187 
1189  OsiUsesBiLinear(const OsiSimpleInteger &rhs, int type);
1190 
1192  OsiUsesBiLinear(const OsiUsesBiLinear &rhs);
1193 
1195  virtual OsiObject *clone() const;
1196 
1199 
1201  virtual ~OsiUsesBiLinear();
1202 
1205  virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
1206 
1211  virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
1212 
1219  virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
1220 
1222  void addBiLinearObjects(OsiSolverLink *solver);
1223 
1224 protected:
1229  int type_;
1232 };
1241 
1242 public:
1245 
1248 
1251 
1254 
1256  virtual OsiChooseVariable *clone() const;
1257 
1259  virtual ~OsiChooseStrongSubset();
1260 
1265  virtual int setupList(OsiBranchingInformation *info, bool initialize);
1279  virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables);
1280 
1282  inline int numberObjectsToUse() const
1283  {
1284  return numberObjectsToUse_;
1285  }
1287  inline void setNumberObjectsToUse(int value)
1288  {
1289  numberObjectsToUse_ = value;
1290  }
1291 
1292 protected:
1293  // Data
1296 };
1297 
1298 #include <string>
1299 
1300 #include "CglStored.hpp"
1301 
1302 class CoinWarmStartBasis;
1304 class CglTemporary : public CglStored {
1305 
1306 public:
1317  virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
1318  const CglTreeInfo info = CglTreeInfo());
1320 
1323  CglTemporary();
1325 
1327  CglTemporary(const CglTemporary &rhs);
1328 
1330  virtual CglCutGenerator *clone() const;
1331 
1333  CglTemporary &
1334  operator=(const CglTemporary &rhs);
1335 
1337  virtual ~CglTemporary();
1339 
1340 private:
1341  // Private member methods
1342 
1343  // Private member data
1344 };
1345 //#############################################################################
1346 
1353 
1354 public:
1355  //---------------------------------------------------------------------------
1358  virtual void initialSolve();
1361 
1369  virtual OsiSolverInterface *clone(bool copyData = true) const;
1370 
1373 
1376 
1379 
1381 
1384  inline double bestObjectiveValue() const
1386  {
1387  return bestObjectiveValue_;
1388  }
1390  const double *bestSolution() const
1391  {
1392  return bestSolution_;
1393  }
1395  inline void setSpecialOptions3(int value)
1396  {
1397  specialOptions3_ = value;
1398  }
1400  inline int specialOptions3() const
1401  {
1402  return specialOptions3_;
1403  }
1406  {
1407  return quadraticModel_;
1408  }
1410 
1411  //---------------------------------------------------------------------------
1412 
1413 protected:
1416 
1419  double bestObjectiveValue_;
1424  double *bestSolution_;
1431 };
1432 class ClpSimplex;
1438  int numberPasses, double deltaTolerance,
1439  int mode = 0);
1440 #endif
1441 
1442 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1443 */
void getPseudoShadow(const OsiBranchingInformation *info)
Sets infeasibility and other when pseudo shadow prices.
void setXOtherSatisfied(double value)
Definition: CbcLinked.hpp:870
int variable_
Variable.
Definition: CbcLinked.hpp:380
void addBiLinearObjects(OsiSolverLink *solver)
Add all bi-linear objects.
virtual bool canDealWithOdd() const
Returns true if can deal with &quot;odd&quot; problems e.g. sos type 2.
Definition: CbcLinked.hpp:430
boundElementAction * affected_
Actions.
Definition: CbcLinked.hpp:386
const double * bestSolution() const
Best solution found internally.
Definition: CbcLinked.hpp:1390
int boundType_
Simple quadratic bound marker.
Definition: CbcLinked.hpp:1010
virtual OsiObject * clone() const
Clone.
const OsiObject * originalObject() const
Return pointer back to object which created.
int xRow_
x row
Definition: CbcLinked.hpp:1012
virtual ~OsiOldLinkBranchingObject()
OsiOldLinkBranchingObject & operator=(const OsiOldLinkBranchingObject &rhs)
~OsiLinkedBound()
Destructor.
void setNumberPoints(int value)
Definition: CbcLinked.hpp:1117
void setNumberObjectsToUse(int value)
Set number of objects to use.
Definition: CbcLinked.hpp:1287
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
double xMeshSize_
x mesh
Definition: CbcLinked.hpp:971
Branching object for Special ordered sets.
OsiLinkedBound & operator=(const OsiLinkedBound &rhs)
Assignment operator.
virtual OsiBranchingObject * clone() const
Clone.
ClpSimplex * quadraticModel() const
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1405
Define a single variable class which is involved with OsiBiLinear objects.
Definition: CbcLinked.hpp:1176
Define BiLinear objects.
Definition: CbcLinked.hpp:733
virtual CglCutGenerator * clone() const
Clone.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current value.
int type_
Type of variable - 0 continuous, 1 integer.
Definition: CbcLinked.hpp:1229
Stored Cut Generator Class.
Definition: CglStored.hpp:16
ClpSimplex * quadraticModel_
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1422
double ySatisfied_
y satisfied if less than this away from mesh
Definition: CbcLinked.hpp:977
heuristic - just picks up any good solution
Definition: CbcLinked.hpp:393
Define a single integer class.
CbcHeuristicDynamic3 & operator=(const CbcHeuristicDynamic3 &rhs)
Illegal Assignment operator.
virtual ~OsiBiLinear()
virtual CbcHeuristic * clone() const
Clone.
int * extraRow_
Row number.
Definition: CbcLinked.hpp:1024
int variable() const
Get variable.
Definition: CbcLinked.hpp:347
double xMeshSize() const
X meshSize.
Definition: CbcLinked.hpp:884
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
int yRow_
y row (-1 if x*x)
Definition: CbcLinked.hpp:1014
double ySatisfied() const
Y satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:857
int specialOptions3_
0 bit (1) - don&#39;t do mini B&amp;B 1 bit (2) - quadratic only in objective
Definition: CbcLinked.hpp:1429
virtual ~OsiLinkBranchingObject()
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
double * multiplier_
Multiplier for coefficient on row.
Definition: CbcLinked.hpp:1022
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:181
virtual ~OsiSolverLinearizedQuadratic()
Destructor.
Clp Solver Interface.
Abstract branching object base class.
virtual OsiObject * clone() const
Clone.
void setYMeshSize(double value)
Definition: CbcLinked.hpp:897
double xOtherSatisfied() const
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:866
ClpSimplex * approximateSolution(CoinModel &coinModel, int numberPasses, double deltaTolerance, int mode=0)
Return an approximate solution to a CoinModel.
The default COIN simplex (basis-oriented) warm start class.
virtual ~OsiBiLinearBranchingObject()
int xyRow() const
XY row.
Definition: CbcLinked.hpp:828
int numberObjectsToUse() const
Number of objects to use.
Definition: CbcLinked.hpp:1282
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: CbcLinked.hpp:797
OsiSolverLinearizedQuadratic & operator=(const OsiSolverLinearizedQuadratic &rhs)
Assignment operator.
virtual OsiBranchingObject * clone() const
Clone.
int whichWay() const
Return current preferred way to branch.
This class chooses a variable to branch on.
Definition: CbcLinked.hpp:1240
Define Special Ordered Sets of type 1 and 2.
void updateBounds(ClpSimplex *solver)
Update other bounds.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
Branching object for Linked ordered sets.
Definition: CbcLinked.hpp:533
double bestObjectiveValue_
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1420
Abstract Base Class for describing an interface to a solver.
This is for codes where solver needs to know about CbcModel Seems to provide only one value-added fea...
Definition: CbcFathom.hpp:88
int updateCoefficients(const double *lower, const double *upper, double *objective, CoinPackedMatrix *matrix, CoinWarmStartBasis *basis) const
Updates coefficients - returns number updated.
OsiChooseStrongSubset & operator=(const OsiChooseStrongSubset &rhs)
Assignment operator.
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
double * bestSolution_
Best solution found internally.
Definition: CbcLinked.hpp:1424
double xyBranchValue_
value of x or y to branch about
Definition: CbcLinked.hpp:985
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
int numberAffected_
Number of variables/elements affected.
Definition: CbcLinked.hpp:382
virtual ~CglTemporary()
Destructor.
void getCoefficients(const OsiSolverInterface *solver, double xB[2], double yB[2], double xybar[4]) const
Get LU coefficients from matrix.
virtual bool boundBranch() const
Return true if branch should only bound variables.
virtual void initialSolve()
Solve initial LP relaxation.
double xyCoefficient(const double *solution) const
Returns true value of single xyRow coefficient.
double xSatisfied_
x satisfied if less than this away from mesh
Definition: CbcLinked.hpp:975
double computeLambdas(const double xB[3], const double yB[3], const double xybar[4], double lambda[4]) const
Compute lambdas (third entry in each .B is current value) (nonzero if bad)
double infeasibility() const
Return infeasibility.
void setBranchingStrategy(int value)
Definition: CbcLinked.hpp:926
double xOtherSatisfied_
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:979
This is to allow the user to replace initialSolve and resolve.
Definition: CbcLinked.hpp:1352
virtual OsiObject * clone() const
Clone.
virtual OsiObject * clone() const
Clone.
OsiSolverInterface * model_
Pointer back to model.
Definition: CbcLinked.hpp:378
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
int numberMembers() const
Number of members.
Cut Generator Base Class.
int numberPoints_
Number of points.
Definition: CbcLinked.hpp:1124
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment)
virtual double feasibleRegion(OsiSolverInterface *solver) const
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
double newGrid(OsiSolverInterface *solver, int type) const
change grid if type 0 then use solution and make finer if 1 then back to original returns mesh size ...
OsiUsesBiLinear & operator=(const OsiUsesBiLinear &rhs)
Assignment operator.
double yOtherSatisfied_
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:981
int xyRow_
Output row.
Definition: CbcLinked.hpp:1016
List of bounds which depend on other bounds.
Definition: CbcLinked.hpp:314
int yColumn() const
Y column.
Definition: CbcLinked.hpp:813
void setSpecialOptions3(int value)
Set special options.
Definition: CbcLinked.hpp:1395
Define Continuous BiLinear objects for an == bound.
Definition: CbcLinked.hpp:1077
void setXYSatisfied(double value)
Definition: CbcLinked.hpp:906
double bestObjectiveValue() const
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1385
void addExtraRow(int row, double multiplier)
Adds in data for extra row with variable coefficients.
OsiBiLinear & operator=(const OsiBiLinear &rhs)
double xySatisfied_
xy satisfied if less than this away from true
Definition: CbcLinked.hpp:983
int branchingStrategy() const
branching strategy etc bottom 2 bits 0 branch on either, 1 branch on x, 2 branch on y next bit 4 set ...
Definition: CbcLinked.hpp:922
short chosen_
Which chosen -1 none, 0 x, 1 y.
Definition: CbcLinked.hpp:1026
int numberExtraRows_
Number of extra rows (coefficients to be modified)
Definition: CbcLinked.hpp:1020
void setCoefficient(double value)
Set coefficient.
Definition: CbcLinked.hpp:838
int numberBiLinear_
data Number of bilinear objects (maybe could be more general)
Definition: CbcLinked.hpp:1227
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
int boundType() const
Simple quadratic bound marker.
Definition: CbcLinked.hpp:937
int xColumn() const
X column.
Definition: CbcLinked.hpp:808
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Mixed Integer Stored cuts for the model of the solver interface, si.
virtual ~OsiChooseStrongSubset()
Destructor.
OsiSimpleFixedInteger()
Default Constructor.
double coefficient_
data
Definition: CbcLinked.hpp:969
Sparse Matrix Base Class.
int branchingStrategy_
branching strategy etc bottom 2 bits 0 branch on either, 1 branch on x, 2 branch on y next bit 4 set ...
Definition: CbcLinked.hpp:1002
OsiSimpleFixedInteger & operator=(const OsiSimpleFixedInteger &rhs)
Assignment operator.
Branching object for Linked ordered sets.
Definition: CbcLinked.hpp:692
int maximumAffected_
Maximum number of variables/elements affected.
Definition: CbcLinked.hpp:384
OsiBiLinearBranchingObject & operator=(const OsiBiLinearBranchingObject &rhs)
virtual ~OsiBiLinearEquality()
OsiUsesBiLinear()
Default Constructor.
OsiObject ** objects_
Objects.
Definition: CbcLinked.hpp:1231
int xColumn_
x column
Definition: CbcLinked.hpp:987
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
Heuristic base class.
Stored Temporary Cut Generator Class - destroyed after first use.
Definition: CbcLinked.hpp:1304
int xRow() const
X row.
Definition: CbcLinked.hpp:818
int numberObjectsToUse_
Number of objects to be used (and set in solver)
Definition: CbcLinked.hpp:1295
void setMeshSizes(const OsiSolverInterface *solver, double x, double y)
Set sizes and other stuff.
double yMeshSize() const
Y meshSize.
Definition: CbcLinked.hpp:893
CglTemporary()
Default constructor.
int yColumn_
y column
Definition: CbcLinked.hpp:989
double yOtherSatisfied() const
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:875
virtual void setModel(CbcModel *model)
update model
virtual int solution(double &objectiveValue, double *newSolution)=0
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables)
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All lo...
double getMovement(const OsiBranchingInformation *info)
Gets sum of movements to correct value.
int firstLambda() const
First lambda (of 4)
Definition: CbcLinked.hpp:843
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers...
virtual ~OsiSimpleFixedInteger()
Destructor.
void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, double multiplier=1.0)
Add a bound modifier.
double xySatisfied() const
XY satisfied if two version differ by less than this.
Definition: CbcLinked.hpp:902
virtual ~OsiUsesBiLinear()
Destructor.
OsiChooseStrongSubset()
Default Constructor.
virtual OsiBranchingObject * clone() const
Clone.
virtual bool boundBranch() const
Return true if branch should only bound variables.
Definition: CbcLinked.hpp:803
double yMeshSize_
y mesh
Definition: CbcLinked.hpp:973
This class chooses a variable to branch on.
const double * weights() const
Array of weights.
void setYOtherSatisfied(double value)
Definition: CbcLinked.hpp:879
OsiLinkBranchingObject & operator=(const OsiLinkBranchingObject &rhs)
int numberPoints() const
Number of points.
Definition: CbcLinked.hpp:1113
void setXSatisfied(double value)
Definition: CbcLinked.hpp:852
int yRow() const
Y row.
Definition: CbcLinked.hpp:823
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
int convexity_
Convexity row.
Definition: CbcLinked.hpp:1018
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
double coefficient() const
Coefficient.
Definition: CbcLinked.hpp:833
void setBoundType(int value)
Definition: CbcLinked.hpp:941
virtual OsiChooseVariable * clone() const
Clone.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
int way() const
Way returns -1 on down +1 on up.
Abstract base class for `objects&#39;.
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
short chosen_
data 1 means branch on x, 2 branch on y
Definition: CbcLinked.hpp:1069
CglTemporary & operator=(const CglTemporary &rhs)
Assignment operator.
Simple Branch and bound class.
Definition: CbcModel.hpp:100
virtual double improvement(const OsiSolverInterface *solver) const
Possible improvement.
Define a single integer class - but one where you keep branching until fixed even if satisfied...
Definition: CbcLinked.hpp:1128
void setYSatisfied(double value)
Definition: CbcLinked.hpp:861
void newBounds(OsiSolverInterface *solver, int way, short xOrY, double separator) const
Does work of branching.
OsiBiLinearEquality & operator=(const OsiBiLinearEquality &rhs)
int specialOptions3() const
Get special options.
Definition: CbcLinked.hpp:1400
OsiLinkedBound()
Default Constructor.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
Branching object for BiLinear objects.
Definition: CbcLinked.hpp:1031
This class chooses a variable to branch on.
int firstLambda_
First lambda (of 4)
Definition: CbcLinked.hpp:991
void setXMeshSize(double value)
Definition: CbcLinked.hpp:888
double xSatisfied() const
X satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:848
OsiSolverLinearizedQuadratic()
Default Constructor.
This just adds two-wayness to a branching object.