Dip-All  0.91.0
CbcLinked.hpp
Go to the documentation of this file.
1 /* $Id: CbcLinked.hpp 1899 2013-04-09 18:12:08Z stefan $ */
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 
74 
77  OsiSolverLink ();
79 
92  OsiSolverLink( CoinModel & modelObject);
93  // Other way with existing object
94  void load( CoinModel & modelObject, bool tightenBounds = false, int logLevel = 1);
96  virtual OsiSolverInterface * clone(bool copyData = true) const;
97 
99  OsiSolverLink (const OsiSolverLink &);
100 
102  OsiSolverLink & operator=(const OsiSolverLink& rhs);
103 
105  virtual ~OsiSolverLink ();
106 
108 
109 
112  void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, int whichVariableAffected,
114  double multiplier = 1.0);
116  int updateCoefficients(ClpSimplex * solver, CoinPackedMatrix * matrix);
118  void analyzeObjects();
120  void addTighterConstraints();
122  inline double bestObjectiveValue() const {
123  return bestObjectiveValue_;
124  }
126  inline void setBestObjectiveValue(double value) {
127  bestObjectiveValue_ = value;
128  }
130  inline const double * bestSolution() const {
131  return bestSolution_;
132  }
134  void setBestSolution(const double * solution, int numberColumns);
136  inline void setSpecialOptions2(int value) {
137  specialOptions2_ = value;
138  }
140  void sayConvex(bool convex);
142  inline int specialOptions2() const {
143  return specialOptions2_;
144  }
149  return matrix_;
150  }
156  return originalRowCopy_;
157  }
160  return quadraticModel_;
161  }
163  CoinPackedMatrix * quadraticRow(int rowNumber, double * linear) const;
165  inline double defaultMeshSize() const {
166  return defaultMeshSize_;
167  }
168  inline void setDefaultMeshSize(double value) {
169  defaultMeshSize_ = value;
170  }
172  inline double defaultBound() const {
173  return defaultBound_;
174  }
175  inline void setDefaultBound(double value) {
176  defaultBound_ = value;
177  }
179  inline void setIntegerPriority(int value) {
180  integerPriority_ = value;
181  }
183  inline int integerPriority() const {
184  return integerPriority_;
185  }
187  inline int objectiveVariable() const {
188  return objectiveVariable_;
189  }
191  inline void setBiLinearPriority(int value) {
192  biLinearPriority_ = value;
193  }
195  inline int biLinearPriority() const {
196  return biLinearPriority_;
197  }
199  inline const CoinModel * coinModel() const {
200  return &coinModel_;
201  }
203  void setBiLinearPriorities(int value, double meshSize = 1.0);
211  void setBranchingStrategyOnVariables(int strategyValue, int priorityValue = -1,
212  int mode = 7);
214  void setMeshSizes(double value);
218  void setFixedPriority(int priorityValue);
220 
221  //---------------------------------------------------------------------------
222 
223 protected:
224 
225 
228  //void initialize(ClpSimplex * & solver, OsiObject ** & object) const;
231  void gutsOfDestructor(bool justNullify = false);
233  void gutsOfCopy(const OsiSolverLink & rhs) ;
235 
257  int * convex_;
285  double * bestSolution_;
295 };
301 
302 public:
303  //---------------------------------------------------------------------------
306  void updateBounds(ClpSimplex * solver);
309 
310 
313  OsiLinkedBound ();
317  int numberAffected, const int * positionL,
318  const int * positionU, const double * multiplier);
319 
321  OsiLinkedBound (const OsiLinkedBound &);
322 
325 
327  ~OsiLinkedBound ();
328 
330 
333  inline int variable() const {
335  return variable_;
336  }
338  void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable,
339  double multiplier = 1.0);
341 
342 private:
343  typedef struct {
344  double multiplier; // to use in computation
345  int affected; // variable or element affected
346  /*
347  0 - LB of variable affected
348  1 - UB of variable affected
349  2 - element in position (affected) affected
350  */
351  unsigned char affect;
352  unsigned char ubUsed; // nonzero if UB of this variable is used
353  /*
354  0 - use x*multiplier
355  1 - use multiplier/x
356  2 - if UB use min of current upper and x*multiplier, if LB use max of current lower and x*multiplier
357  */
358  unsigned char type; // type of computation
360 
374 };
375 #include "CbcHeuristic.hpp"
380 public:
381 
382  // Default Constructor
384 
385  /* Constructor with model
386  */
387  CbcHeuristicDynamic3 (CbcModel & model);
388 
389  // Copy constructor
391 
392  // Destructor
394 
396  virtual CbcHeuristic * clone() const;
397 
399  virtual void setModel(CbcModel * model);
400 
401  using CbcHeuristic::solution ;
412  virtual int solution(double & objectiveValue,
413  double * newSolution);
415  virtual void resetModel(CbcModel * model);
417  virtual bool canDealWithOdd() const {
418  return true;
419  }
420 
421 protected:
422 private:
425 };
426 
427 #include "OsiBranchingObject.hpp"
428 
432 class CoinWarmStartBasis;
433 
434 class OsiOldLink : public OsiSOS {
435 
436 public:
437 
438  // Default Constructor
439  OsiOldLink ();
440 
447  OsiOldLink (const OsiSolverInterface * solver, int numberMembers,
448  int numberLinks, int first,
449  const double * weights, int setNumber);
456  OsiOldLink (const OsiSolverInterface * solver, int numberMembers,
457  int numberLinks, int typeSOS, const int * which,
458  const double * weights, int setNumber);
459 
460  // Copy constructor
461  OsiOldLink ( const OsiOldLink &);
462 
464  virtual OsiObject * clone() const;
465 
466  // Assignment operator
467  OsiOldLink & operator=( const OsiOldLink& rhs);
468 
469  // Destructor
470  virtual ~OsiOldLink ();
471 
474  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
475 
482  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
483 
488  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
489 
491  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
492 
494  inline int numberLinks() const {
495  return numberLinks_;
496  }
497 
500  virtual bool canDoHeuristics() const {
501  return false;
502  }
505  virtual bool boundBranch() const {
506  return false;
507  }
508 
509 private:
511 
514 };
519 
520 public:
521 
522  // Default Constructor
524 
525  // Useful constructor
527  int way,
528  double separator);
529 
530  // Copy constructor
532 
533  // Assignment operator
535 
537  virtual OsiBranchingObject * clone() const;
538 
539  // Destructor
540  virtual ~OsiOldLinkBranchingObject ();
541 
544  virtual double branch(OsiSolverInterface * solver);
545 
549  virtual void print(const OsiSolverInterface * solver = NULL);
550 private:
552 };
558 class OsiOneLink {
559 
560 public:
561 
562  // Default Constructor
563  OsiOneLink ();
564 
568  OsiOneLink (const OsiSolverInterface * solver, int xRow, int xColumn, int xyRow,
569  const char * functionString);
570 
571  // Copy constructor
572  OsiOneLink ( const OsiOneLink &);
573 
574  // Assignment operator
575  OsiOneLink & operator=( const OsiOneLink& rhs);
576 
577  // Destructor
578  virtual ~OsiOneLink ();
579 
581 
583  int xRow_;
585  int xColumn_;
587  int xyRow;
589  std::string function_;
590 };
600 class OsiLink : public OsiSOS {
601 
602 public:
603 
604  // Default Constructor
605  OsiLink ();
606 
610  OsiLink (const OsiSolverInterface * solver, int yRow,
611  int yColumn, double meshSize);
612 
613  // Copy constructor
614  OsiLink ( const OsiLink &);
615 
617  virtual OsiObject * clone() const;
618 
619  // Assignment operator
620  OsiLink & operator=( const OsiLink& rhs);
621 
622  // Destructor
623  virtual ~OsiLink ();
624 
627  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
628 
635  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
636 
641  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
642 
644  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
645 
647  inline int numberLinks() const {
648  return numberLinks_;
649  }
650 
653  virtual bool canDoHeuristics() const {
654  return false;
655  }
658  virtual bool boundBranch() const {
659  return false;
660  }
661 
662 private:
665  double meshSize_;
671  int yRow_;
673  int yColumn_;
674 };
679 
680 public:
681 
682  // Default Constructor
684 
685  // Useful constructor
687  int way,
688  double separator);
689 
690  // Copy constructor
692 
693  // Assignment operator
695 
697  virtual OsiBranchingObject * clone() const;
698 
699  // Destructor
700  virtual ~OsiLinkBranchingObject ();
701 
704  virtual double branch(OsiSolverInterface * solver);
705 
709  virtual void print(const OsiSolverInterface * solver = NULL);
710 private:
712 };
720 class OsiBiLinear : public OsiObject2 {
721 
722 public:
723 
724  // Default Constructor
725  OsiBiLinear ();
726 
732  OsiBiLinear (OsiSolverInterface * solver, int xColumn,
733  int yColumn, int xyRow, double coefficient,
734  double xMesh, double yMesh,
735  int numberExistingObjects = 0, const OsiObject ** objects = NULL );
736 
742  OsiBiLinear (CoinModel * coinModel, int xColumn,
743  int yColumn, int xyRow, double coefficient,
744  double xMesh, double yMesh,
745  int numberExistingObjects = 0, const OsiObject ** objects = NULL );
746 
747  // Copy constructor
748  OsiBiLinear ( const OsiBiLinear &);
749 
751  virtual OsiObject * clone() const;
752 
753  // Assignment operator
754  OsiBiLinear & operator=( const OsiBiLinear& rhs);
755 
756  // Destructor
757  virtual ~OsiBiLinear ();
758 
761  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
762 
769  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
770 
775  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
776 
778  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
779 
780  // This does NOT set mutable stuff
781  virtual double checkInfeasibility(const OsiBranchingInformation * info) const;
782 
785  virtual bool canDoHeuristics() const {
786  return false;
787  }
790  virtual bool boundBranch() const {
791  return (branchingStrategy_&4) != 0;
792  }
794  inline int xColumn() const {
795  return xColumn_;
796  }
798  inline int yColumn() const {
799  return yColumn_;
800  }
802  inline int xRow() const {
803  return xRow_;
804  }
806  inline int yRow() const {
807  return yRow_;
808  }
810  inline int xyRow() const {
811  return xyRow_;
812  }
814  inline double coefficient() const {
815  return coefficient_;
816  }
818  inline void setCoefficient(double value) {
819  coefficient_ = value;
820  }
822  inline int firstLambda() const {
823  return firstLambda_;
824  }
826  inline double xSatisfied() const {
827  return xSatisfied_;
828  }
829  inline void setXSatisfied(double value) {
830  xSatisfied_ = value;
831  }
833  inline double ySatisfied() const {
834  return ySatisfied_;
835  }
836  inline void setYSatisfied(double value) {
837  ySatisfied_ = value;
838  }
840  inline double xOtherSatisfied() const {
841  return xOtherSatisfied_;
842  }
843  inline void setXOtherSatisfied(double value) {
844  xOtherSatisfied_ = value;
845  }
847  inline double yOtherSatisfied() const {
848  return yOtherSatisfied_;
849  }
850  inline void setYOtherSatisfied(double value) {
851  yOtherSatisfied_ = value;
852  }
854  inline double xMeshSize() const {
855  return xMeshSize_;
856  }
857  inline void setXMeshSize(double value) {
858  xMeshSize_ = value;
859  }
861  inline double yMeshSize() const {
862  return yMeshSize_;
863  }
864  inline void setYMeshSize(double value) {
865  yMeshSize_ = value;
866  }
868  inline double xySatisfied() const {
869  return xySatisfied_;
870  }
871  inline void setXYSatisfied(double value) {
872  xySatisfied_ = value;
873  }
875  void setMeshSizes(const OsiSolverInterface * solver, double x, double y);
886  inline int branchingStrategy() const {
887  return branchingStrategy_;
888  }
889  inline void setBranchingStrategy(int value) {
890  branchingStrategy_ = value;
891  }
899  inline int boundType() const {
900  return boundType_;
901  }
902  inline void setBoundType(int value) {
903  boundType_ = value;
904  }
906  void newBounds(OsiSolverInterface * solver, int way, short xOrY, double separator) const;
908  int updateCoefficients(const double * lower, const double * upper, double * objective,
909  CoinPackedMatrix * matrix, CoinWarmStartBasis * basis) const;
911  double xyCoefficient(const double * solution) const;
913  void getCoefficients(const OsiSolverInterface * solver, double xB[2], double yB[2], double xybar[4]) const;
915  double computeLambdas(const double xB[3], const double yB[3], const double xybar[4], double lambda[4]) const;
917  void addExtraRow(int row, double multiplier);
919  void getPseudoShadow(const OsiBranchingInformation * info);
921  double getMovement(const OsiBranchingInformation * info);
922 
923 protected:
925  void computeLambdas(const OsiSolverInterface * solver, double lambda[4]) const;
927 
929  double coefficient_;
931  double xMeshSize_;
933  double yMeshSize_;
935  double xSatisfied_;
937  double ySatisfied_;
943  double xySatisfied_;
945  mutable double xyBranchValue_;
947  int xColumn_;
949  int yColumn_;
972  int xRow_;
974  int yRow_;
976  int xyRow_;
982  double * multiplier_;
984  int * extraRow_;
986  mutable short chosen_;
987 };
992 
993 public:
994 
995  // Default Constructor
997 
998  // Useful constructor
1000  int way,
1001  double separator, int chosen);
1002 
1003  // Copy constructor
1005 
1006  // Assignment operator
1008 
1010  virtual OsiBranchingObject * clone() const;
1011 
1012  // Destructor
1013  virtual ~OsiBiLinearBranchingObject ();
1014 
1017  virtual double branch(OsiSolverInterface * solver);
1018 
1022  virtual void print(const OsiSolverInterface * solver = NULL);
1025  virtual bool boundBranch() const;
1026 private:
1029  short chosen_;
1030 };
1039 
1040 public:
1041 
1042  // Default Constructor
1044 
1051  int yColumn, int xyRow, double rhs,
1052  double xMesh);
1053 
1054  // Copy constructor
1056 
1058  virtual OsiObject * clone() const;
1059 
1060  // Assignment operator
1062 
1063  // Destructor
1064  virtual ~OsiBiLinearEquality ();
1065 
1067  virtual double improvement(const OsiSolverInterface * solver) const;
1073  double newGrid(OsiSolverInterface * solver, int type) const;
1075  inline int numberPoints() const {
1076  return numberPoints_;
1077  }
1078  inline void setNumberPoints(int value) {
1079  numberPoints_ = value;
1080  }
1081 
1082 private:
1085 };
1087 
1088 
1090 
1091 public:
1092 
1095 
1097  OsiSimpleFixedInteger (const OsiSolverInterface * solver, int iColumn);
1098 
1100  OsiSimpleFixedInteger (int iColumn, double lower, double upper);
1101 
1104 
1107 
1109  virtual OsiObject * clone() const;
1110 
1113 
1115  virtual ~OsiSimpleFixedInteger ();
1116 
1117  using OsiObject::infeasibility ;
1119  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
1120 
1125  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
1126 protected:
1128 
1129 };
1140 
1141 public:
1142 
1144  OsiUsesBiLinear ();
1145 
1147  OsiUsesBiLinear (const OsiSolverInterface * solver, int iColumn, int type);
1148 
1150  OsiUsesBiLinear (int iColumn, double lower, double upper, int type);
1151 
1153  OsiUsesBiLinear (const OsiSimpleInteger & rhs, int type);
1154 
1156  OsiUsesBiLinear ( const OsiUsesBiLinear & rhs);
1157 
1159  virtual OsiObject * clone() const;
1160 
1162  OsiUsesBiLinear & operator=( const OsiUsesBiLinear& rhs);
1163 
1165  virtual ~OsiUsesBiLinear ();
1166 
1167  using OsiObject::infeasibility ;
1169  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
1170 
1175  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
1176 
1183  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
1184 
1186  void addBiLinearObjects(OsiSolverLink * solver);
1187 protected:
1192  int type_;
1195 };
1204 
1205 public:
1206 
1209 
1211  OsiChooseStrongSubset (const OsiSolverInterface * solver);
1212 
1215 
1218 
1220  virtual OsiChooseVariable * clone() const;
1221 
1223  virtual ~OsiChooseStrongSubset ();
1224 
1229  virtual int setupList ( OsiBranchingInformation *info, bool initialize);
1243  virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables);
1244 
1246  inline int numberObjectsToUse() const {
1247  return numberObjectsToUse_;
1248  }
1250  inline void setNumberObjectsToUse(int value) {
1251  numberObjectsToUse_ = value;
1252  }
1253 
1254 protected:
1255  // Data
1258 };
1259 
1260 #include <string>
1261 
1262 #include "CglStored.hpp"
1263 
1264 class CoinWarmStartBasis;
1266 class CglTemporary : public CglStored {
1267 
1268 public:
1269 
1270 
1281  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
1282  const CglTreeInfo info = CglTreeInfo());
1284 
1287  CglTemporary ();
1289 
1291  CglTemporary (const CglTemporary & rhs);
1292 
1294  virtual CglCutGenerator * clone() const;
1295 
1297  CglTemporary &
1298  operator=(const CglTemporary& rhs);
1299 
1301  virtual
1302  ~CglTemporary ();
1304 
1305 private:
1306 
1307 // Private member methods
1308 
1309  // Private member data
1310 };
1311 //#############################################################################
1312 
1319 
1320 public:
1321  //---------------------------------------------------------------------------
1324  virtual void initialSolve();
1327 
1328 
1336  virtual OsiSolverInterface * clone(bool copyData = true) const;
1337 
1340 
1343 
1345  virtual ~OsiSolverLinearizedQuadratic ();
1346 
1348 
1349 
1352  inline double bestObjectiveValue() const {
1354  return bestObjectiveValue_;
1355  }
1357  const double * bestSolution() const {
1358  return bestSolution_;
1359  }
1361  inline void setSpecialOptions3(int value) {
1362  specialOptions3_ = value;
1363  }
1365  inline int specialOptions3() const {
1366  return specialOptions3_;
1367  }
1370  return quadraticModel_;
1371  }
1373 
1374  //---------------------------------------------------------------------------
1375 
1376 protected:
1377 
1378 
1381 
1384  double bestObjectiveValue_;
1389  double * bestSolution_;
1396 };
1397 class ClpSimplex;
1403  int numberPasses, double deltaTolerance,
1404  int mode = 0);
1405 #endif
1406 
void setXSatisfied(double value)
Definition: CbcLinked.hpp:829
virtual ~CglTemporary()
Destructor.
This class chooses a variable to branch on.
Branching object for Special ordered sets.
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 ...
OsiChooseStrongSubset()
Default Constructor.
int numberPoints_
Number of points.
Definition: CbcLinked.hpp:1084
int firstLambda() const
First lambda (of 4)
Definition: CbcLinked.hpp:822
virtual ~OsiBiLinear()
int yColumn_
y column
Definition: CbcLinked.hpp:949
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:161
void addBiLinearObjects(OsiSolverLink *solver)
Add all bi-linear objects.
int numberMembers() const
Number of members.
virtual OsiBranchingObject * clone() const
Clone.
void setXYSatisfied(double value)
Definition: CbcLinked.hpp:871
int type_
Type of variable - 0 continuous, 1 integer.
Definition: CbcLinked.hpp:1192
int xyRow() const
XY row.
Definition: CbcLinked.hpp:810
Define a single integer class.
virtual int tightenBounds(int lightweight=0)
Tighten bounds - lightweight or very lightweight 0 - normal, 1 lightweight but just integers...
boundElementAction * affected_
Actions.
Definition: CbcLinked.hpp:372
double bestObjectiveValue() const
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1353
virtual bool boundBranch() const
Return true if branch should only bound variables.
OsiBiLinearBranchingObject & operator=(const OsiBiLinearBranchingObject &rhs)
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
int xRow() const
X row.
Definition: CbcLinked.hpp:802
int boundType() const
Simple quadratic bound marker.
Definition: CbcLinked.hpp:899
This is to allow the user to replace initialSolve and resolve.
Definition: CbcLinked.hpp:1318
Define Continuous BiLinear objects for an == bound.
Definition: CbcLinked.hpp:1038
double yOtherSatisfied() const
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:847
double xySatisfied() const
XY satisfied if two version differ by less than this.
Definition: CbcLinked.hpp:868
Define Special Ordered Sets of type 1 and 2.
void setNumberPoints(int value)
Definition: CbcLinked.hpp:1078
virtual ~OsiBiLinearBranchingObject()
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
virtual OsiChooseVariable * clone() const
Clone.
heuristic - just picks up any good solution
Definition: CbcLinked.hpp:379
OsiUsesBiLinear & operator=(const OsiUsesBiLinear &rhs)
Assignment operator.
OsiLinkedBound & operator=(const OsiLinkedBound &rhs)
Assignment operator.
int xColumn() const
X column.
Definition: CbcLinked.hpp:794
int numberAffected_
Number of variables/elements affected.
Definition: CbcLinked.hpp:368
List of bounds which depend on other bounds.
Definition: CbcLinked.hpp:300
int numberPoints() const
Number of points.
Definition: CbcLinked.hpp:1075
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...
OsiSolverLinearizedQuadratic()
Default Constructor.
double xMeshSize() const
X meshSize.
Definition: CbcLinked.hpp:854
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...
Sparse Matrix Base Class.
double infeasibility() const
Return infeasibility.
OsiChooseStrongSubset & operator=(const OsiChooseStrongSubset &rhs)
Assignment operator.
void setBoundType(int value)
Definition: CbcLinked.hpp:902
This is for codes where solver needs to know about CbcModel Seems to provide only one value-added fea...
Definition: CbcFathom.hpp:90
void setMeshSizes(const OsiSolverInterface *solver, double x, double y)
Set sizes and other stuff.
int numberBiLinear_
data Number of bilinear objects (maybe could be more general)
Definition: CbcLinked.hpp:1190
short chosen_
Which chosen -1 none, 0 x, 1 y.
Definition: CbcLinked.hpp:986
int boundType_
Simple quadratic bound marker.
Definition: CbcLinked.hpp:970
int xyRow_
Output row.
Definition: CbcLinked.hpp:976
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
void addExtraRow(int row, double multiplier)
Adds in data for extra row with variable coefficients.
double xSatisfied() const
X satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:826
void setCoefficient(double value)
Set coefficient.
Definition: CbcLinked.hpp:818
const OsiObject * originalObject() const
Return pointer back to object which created.
Define a single variable class which is involved with OsiBiLinear objects.
Definition: CbcLinked.hpp:1139
void newBounds(OsiSolverInterface *solver, int way, short xOrY, double separator) const
Does work of branching.
double xyBranchValue_
value of x or y to branch about
Definition: CbcLinked.hpp:945
double xSatisfied_
x satisfied if less than this away from mesh
Definition: CbcLinked.hpp:935
OsiSimpleFixedInteger & operator=(const OsiSimpleFixedInteger &rhs)
Assignment operator.
ClpSimplex * quadraticModel() const
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1369
void setXOtherSatisfied(double value)
Definition: CbcLinked.hpp:843
virtual ~OsiBiLinearEquality()
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
CglTemporary & operator=(const CglTemporary &rhs)
Assignment operator.
int xColumn_
x column
Definition: CbcLinked.hpp:947
virtual void initialSolve()
Solve initial LP relaxation.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
virtual ~OsiChooseStrongSubset()
Destructor.
double xOtherSatisfied_
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:939
virtual ~OsiSolverLinearizedQuadratic()
Destructor.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
void gutsOfDestructor()
The real work of a copy constructor (used by copy and assignment)
int way() const
Way returns -1 on down +1 on up.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
void setSpecialOptions3(int value)
Set special options.
Definition: CbcLinked.hpp:1361
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
Define a single integer class - but one where you keep branching until fixed even if satisfied...
Definition: CbcLinked.hpp:1089
int yRow() const
Y row.
Definition: CbcLinked.hpp:806
Stored Temporary Cut Generator Class - destroyed after first use.
Definition: CbcLinked.hpp:1266
double bestObjectiveValue_
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1385
double yOtherSatisfied_
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:941
OsiSimpleFixedInteger()
Default Constructor.
int firstLambda_
First lambda (of 4)
Definition: CbcLinked.hpp:951
virtual double improvement(const OsiSolverInterface *solver) const
Possible improvement.
This class chooses a variable to branch on.
Definition: CbcLinked.hpp:1203
double * bestSolution_
Best solution found internally.
Definition: CbcLinked.hpp:1389
int variable_
Variable.
Definition: CbcLinked.hpp:366
double xMeshSize_
x mesh
Definition: CbcLinked.hpp:931
double xOtherSatisfied() const
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:840
void setYMeshSize(double value)
Definition: CbcLinked.hpp:864
OsiBiLinear & operator=(const OsiBiLinear &rhs)
virtual ~OsiSimpleFixedInteger()
Destructor.
Clp Solver Interface.
OsiBiLinearEquality & operator=(const OsiBiLinearEquality &rhs)
int numberObjectsToUse() const
Number of objects to use.
Definition: CbcLinked.hpp:1246
int specialOptions3_
0 bit (1) - don&#39;t do mini B&amp;B 1 bit (2) - quadratic only in objective
Definition: CbcLinked.hpp:1394
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current value.
virtual CbcHeuristic * clone() const
Clone.
OsiSolverLinearizedQuadratic & operator=(const OsiSolverLinearizedQuadratic &rhs)
Assignment operator.
const double * weights() const
Array of weights.
This just adds two-wayness to a branching object.
Abstract Base Class for describing an interface to a solver.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
void getPseudoShadow(const OsiBranchingInformation *info)
Sets infeasibility and other when pseudo shadow prices.
double xyCoefficient(const double *solution) const
Returns true value of single xyRow coefficient.
Cut Generator Base Class.
virtual CglCutGenerator * clone() const
Clone.
int yRow_
y row (-1 if x*x)
Definition: CbcLinked.hpp:974
void getCoefficients(const OsiSolverInterface *solver, double xB[2], double yB[2], double xybar[4]) const
Get LU coefficients from matrix.
virtual ~OsiUsesBiLinear()
Destructor.
int whichWay() const
Return current preferred way to branch.
void setYSatisfied(double value)
Definition: CbcLinked.hpp:836
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:886
virtual OsiObject * clone() const
Clone.
double ySatisfied_
y satisfied if less than this away from mesh
Definition: CbcLinked.hpp:937
double coefficient() const
Coefficient.
Definition: CbcLinked.hpp:814
virtual OsiObject * clone() const
Clone.
void setYOtherSatisfied(double value)
Definition: CbcLinked.hpp:850
double xySatisfied_
xy satisfied if less than this away from true
Definition: CbcLinked.hpp:943
Heuristic base class.
void setXMeshSize(double value)
Definition: CbcLinked.hpp:857
Define BiLinear objects.
Definition: CbcLinked.hpp:720
double ySatisfied() const
Y satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:833
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 coefficient_
data
Definition: CbcLinked.hpp:929
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 double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
double getMovement(const OsiBranchingInformation *info)
Gets sum of movements to correct value.
int convexity_
Convexity row.
Definition: CbcLinked.hpp:978
int * extraRow_
Row number.
Definition: CbcLinked.hpp:984
int specialOptions3() const
Get special options.
Definition: CbcLinked.hpp:1365
void updateBounds(ClpSimplex *solver)
Update other bounds.
const double * bestSolution() const
Best solution found internally.
Definition: CbcLinked.hpp:1357
virtual OsiObject * clone() const
Clone.
virtual OsiObject * clone() const
Clone.
void setBranchingStrategy(int value)
Definition: CbcLinked.hpp:889
int xRow_
x row
Definition: CbcLinked.hpp:972
Stored Cut Generator Class.
Definition: CglStored.hpp:16
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: CbcLinked.hpp:785
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
CbcHeuristicDynamic3 & operator=(const CbcHeuristicDynamic3 &rhs)
Illegal Assignment operator.
This class chooses a variable to branch on.
double yMeshSize() const
Y meshSize.
Definition: CbcLinked.hpp:861
virtual bool canDealWithOdd() const
Returns true if can deal with &quot;odd&quot; problems e.g. sos type 2.
Definition: CbcLinked.hpp:417
void setNumberObjectsToUse(int value)
Set number of objects to use.
Definition: CbcLinked.hpp:1250
int variable() const
Get variable.
Definition: CbcLinked.hpp:334
int yColumn() const
Y column.
Definition: CbcLinked.hpp:798
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
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)
Abstract base class for `objects&#39;.
int updateCoefficients(const double *lower, const double *upper, double *objective, CoinPackedMatrix *matrix, CoinWarmStartBasis *basis) const
Updates coefficients - returns number updated.
OsiUsesBiLinear()
Default Constructor.
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:962
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
OsiObject ** objects_
Objects.
Definition: CbcLinked.hpp:1194
int maximumAffected_
Maximum number of variables/elements affected.
Definition: CbcLinked.hpp:370
Branching object for BiLinear objects.
Definition: CbcLinked.hpp:991
ClpSimplex * approximateSolution(CoinModel &coinModel, int numberPasses, double deltaTolerance, int mode=0)
Return an approximate solution to a CoinModel.
OsiSolverInterface * model_
Pointer back to model.
Definition: CbcLinked.hpp:364
int numberExtraRows_
Number of extra rows (coefficients to be modified)
Definition: CbcLinked.hpp:980
int numberObjectsToUse_
Number of objects to be used (and set in solver)
Definition: CbcLinked.hpp:1257
The default COIN simplex (basis-oriented) warm start class.
ClpSimplex * quadraticModel_
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1387
virtual void setModel(CbcModel *model)
update model
double * multiplier_
Multiplier for coefficient on row.
Definition: CbcLinked.hpp:982
Simple Branch and bound class.
Definition: CbcModel.hpp:101
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
~OsiLinkedBound()
Destructor.
virtual bool boundBranch() const
Return true if branch should only bound variables.
Definition: CbcLinked.hpp:790
double yMeshSize_
y mesh
Definition: CbcLinked.hpp:933
Abstract branching object base class.
void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, double multiplier=1.0)
Add a bound modifier.
CglTemporary()
Default constructor.
OsiLinkedBound()
Default Constructor.
short chosen_
data 1 means branch on x, 2 branch on y
Definition: CbcLinked.hpp:1029