CbcLinked.hpp
Go to the documentation of this file.
1 /* $Id: CbcLinked.hpp 1200 2009-07-25 08:44:13Z forrest $ */
2 // Copyright (C) 2006, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CglLinked_H
5 #define CglLinked_H
6 /* THIS CONTAINS STUFF THAT SHOULD BE IN
7  OsiSolverLink
8  OsiBranchLink
9  CglTemporary
10 */
11 #include "CoinModel.hpp"
12 #include "OsiClpSolverInterface.hpp"
13 #include "OsiChooseVariable.hpp"
14 #include "CbcFathom.hpp"
15 class CbcModel;
16 class CoinPackedMatrix;
17 class OsiLinkedBound;
18 class OsiObject;
19 class CglStored;
20 class CglTemporary;
27 class OsiSolverLink : public CbcOsiSolver {
28 
29 public:
30  //---------------------------------------------------------------------------
33  virtual void initialSolve();
35 
37  virtual void resolve();
38 
46  virtual int fathom(bool allFixed) ;
53  double * nonlinearSLP(int numberPasses, double deltaTolerance);
57  double linearizedBAB(CglStored * cut) ;
66  double * heuristicSolution(int numberPasses, double deltaTolerance, int mode);
67 
69  int doAOCuts(CglTemporary * cutGen, const double * solution, const double * solution2);
71 
72 
75  OsiSolverLink ();
77 
90  OsiSolverLink( CoinModel & modelObject);
91  // Other way with existing object
92  void load( CoinModel & modelObject, bool tightenBounds = false, int logLevel = 1);
94  virtual OsiSolverInterface * clone(bool copyData = true) const;
95 
97  OsiSolverLink (const OsiSolverLink &);
98 
100  OsiSolverLink & operator=(const OsiSolverLink& rhs);
101 
103  virtual ~OsiSolverLink ();
104 
106 
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  return bestObjectiveValue_;
122  }
124  inline void setBestObjectiveValue(double value) {
125  bestObjectiveValue_ = value;
126  }
128  inline const double * bestSolution() const {
129  return bestSolution_;
130  }
132  void setBestSolution(const double * solution, int numberColumns);
134  inline void setSpecialOptions2(int value) {
135  specialOptions2_ = value;
136  }
138  void sayConvex(bool convex);
140  inline int specialOptions2() const {
141  return specialOptions2_;
142  }
146  CoinPackedMatrix * cleanMatrix() const {
147  return matrix_;
148  }
153  CoinPackedMatrix * originalRowCopy() const {
154  return originalRowCopy_;
155  }
157  ClpSimplex * quadraticModel() const {
158  return quadraticModel_;
159  }
161  CoinPackedMatrix * quadraticRow(int rowNumber, double * linear) const;
163  inline double defaultMeshSize() const {
164  return defaultMeshSize_;
165  }
166  inline void setDefaultMeshSize(double value) {
167  defaultMeshSize_ = value;
168  }
170  inline double defaultBound() const {
171  return defaultBound_;
172  }
173  inline void setDefaultBound(double value) {
174  defaultBound_ = value;
175  }
177  inline void setIntegerPriority(int value) {
178  integerPriority_ = value;
179  }
181  inline int integerPriority() const {
182  return integerPriority_;
183  }
185  inline int objectiveVariable() const {
186  return objectiveVariable_;
187  }
189  inline void setBiLinearPriority(int value) {
190  biLinearPriority_ = value;
191  }
193  inline int biLinearPriority() const {
194  return biLinearPriority_;
195  }
197  inline const CoinModel * coinModel() const {
198  return &coinModel_;
199  }
201  void setBiLinearPriorities(int value, double meshSize = 1.0);
209  void setBranchingStrategyOnVariables(int strategyValue, int priorityValue = -1,
210  int mode = 7);
212  void setMeshSizes(double value);
216  void setFixedPriority(int priorityValue);
218 
219  //---------------------------------------------------------------------------
220 
221 protected:
222 
223 
226  //void initialize(ClpSimplex * & solver, OsiObject ** & object) const;
229  void gutsOfDestructor(bool justNullify = false);
231  void gutsOfCopy(const OsiSolverLink & rhs) ;
233 
239  CoinPackedMatrix * matrix_;
243  CoinPackedMatrix * originalRowCopy_;
245  ClpSimplex * quadraticModel_;
249  int * startNonLinear_;
251  int * rowNonLinear_;
255  int * convex_;
257  int * whichNonLinear_;
259  CoinModel coinModel_;
261  int numberVariables_;
271  int specialOptions2_;
273  int objectiveRow_;
275  int objectiveVariable_;
277  double bestObjectiveValue_;
279  double defaultMeshSize_;
281  double defaultBound_;
283  double * bestSolution_;
285  int integerPriority_;
287  int biLinearPriority_;
289  int numberFix_;
291  int * fixVariables_;
293 };
298 class OsiLinkedBound {
299 
300 public:
301  //---------------------------------------------------------------------------
304  void updateBounds(ClpSimplex * solver);
307 
308 
311  OsiLinkedBound ();
314  OsiLinkedBound(OsiSolverInterface * model, int variable,
315  int numberAffected, const int * positionL,
316  const int * positionU, const double * multiplier);
317 
319  OsiLinkedBound (const OsiLinkedBound &);
320 
323 
325  ~OsiLinkedBound ();
326 
328 
331  inline int variable() const {
333  return variable_;
334  }
336  void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable,
337  double multiplier = 1.0);
339 
340 private:
341  typedef struct {
342  double multiplier; // to use in computation
343  int affected; // variable or element affected
344  /*
345  0 - LB of variable affected
346  1 - UB of variable affected
347  2 - element in position (affected) affected
348  */
349  unsigned char affect;
350  unsigned char ubUsed; // nonzero if UB of this variable is used
351  /*
352  0 - use x*multiplier
353  1 - use multiplier/x
354  2 - if UB use min of current upper and x*multiplier, if LB use max of current lower and x*multiplier
355  */
356  unsigned char type; // type of computation
357  } boundElementAction;
358 
361  OsiSolverInterface * model_;
364  int variable_;
366  int numberAffected_;
368  int maximumAffected_;
370  boundElementAction * affected_;
372 };
373 #include "CbcHeuristic.hpp"
377 class CbcHeuristicDynamic3 : public CbcHeuristic {
378 public:
379 
380  // Default Constructor
382 
383  /* Constructor with model
384  */
385  CbcHeuristicDynamic3 (CbcModel & model);
386 
387  // Copy constructor
389 
390  // Destructor
392 
394  virtual CbcHeuristic * clone() const;
395 
397  virtual void setModel(CbcModel * model);
398 
399  using CbcHeuristic::solution ;
410  virtual int solution(double & objectiveValue,
411  double * newSolution);
413  virtual void resetModel(CbcModel * model);
415  virtual bool canDealWithOdd() const {
416  return true;
417  }
418 
419 protected:
420 private:
423 };
424 
425 #include "OsiBranchingObject.hpp"
426 
430 class CoinWarmStartBasis;
431 
432 class OsiOldLink : public OsiSOS {
433 
434 public:
435 
436  // Default Constructor
437  OsiOldLink ();
438 
445  OsiOldLink (const OsiSolverInterface * solver, int numberMembers,
446  int numberLinks, int first,
447  const double * weights, int setNumber);
454  OsiOldLink (const OsiSolverInterface * solver, int numberMembers,
455  int numberLinks, int typeSOS, const int * which,
456  const double * weights, int setNumber);
457 
458  // Copy constructor
459  OsiOldLink ( const OsiOldLink &);
460 
462  virtual OsiObject * clone() const;
463 
464  // Assignment operator
465  OsiOldLink & operator=( const OsiOldLink& rhs);
466 
467  // Destructor
468  virtual ~OsiOldLink ();
469 
470  using OsiObject::infeasibility ;
472  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
473 
474  using OsiObject::feasibleRegion ;
480  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
481 
486  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
487 
489  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
490 
492  inline int numberLinks() const {
493  return numberLinks_;
494  }
495 
498  virtual bool canDoHeuristics() const {
499  return false;
500  }
503  virtual bool boundBranch() const {
504  return false;
505  }
506 
507 private:
509 
511  int numberLinks_;
512 };
516 class OsiOldLinkBranchingObject : public OsiSOSBranchingObject {
517 
518 public:
519 
520  // Default Constructor
522 
523  // Useful constructor
524  OsiOldLinkBranchingObject (OsiSolverInterface * solver, const OsiOldLink * originalObject,
525  int way,
526  double separator);
527 
528  // Copy constructor
530 
531  // Assignment operator
533 
535  virtual OsiBranchingObject * clone() const;
536 
537  // Destructor
538  virtual ~OsiOldLinkBranchingObject ();
539 
540  using OsiBranchingObject::branch ;
542  virtual double branch(OsiSolverInterface * solver);
543 
544  using OsiBranchingObject::print ;
547  virtual void print(const OsiSolverInterface * solver = NULL);
548 private:
550 };
556 class OsiOneLink {
557 
558 public:
559 
560  // Default Constructor
561  OsiOneLink ();
562 
566  OsiOneLink (const OsiSolverInterface * solver, int xRow, int xColumn, int xyRow,
567  const char * functionString);
568 
569  // Copy constructor
570  OsiOneLink ( const OsiOneLink &);
571 
572  // Assignment operator
573  OsiOneLink & operator=( const OsiOneLink& rhs);
574 
575  // Destructor
576  virtual ~OsiOneLink ();
577 
579 
581  int xRow_;
583  int xColumn_;
585  int xyRow;
587  std::string function_;
588 };
598 class OsiLink : public OsiSOS {
599 
600 public:
601 
602  // Default Constructor
603  OsiLink ();
604 
608  OsiLink (const OsiSolverInterface * solver, int yRow,
609  int yColumn, double meshSize);
610 
611  // Copy constructor
612  OsiLink ( const OsiLink &);
613 
615  virtual OsiObject * clone() const;
616 
617  // Assignment operator
618  OsiLink & operator=( const OsiLink& rhs);
619 
620  // Destructor
621  virtual ~OsiLink ();
622 
623  using OsiObject::infeasibility ;
625  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
626 
627  using OsiObject::feasibleRegion ;
633  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
634 
639  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
640 
642  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
643 
645  inline int numberLinks() const {
646  return numberLinks_;
647  }
648 
651  virtual bool canDoHeuristics() const {
652  return false;
653  }
656  virtual bool boundBranch() const {
657  return false;
658  }
659 
660 private:
663  double meshSize_;
665  OsiOneLink * data_;
667  int numberLinks_;
669  int yRow_;
671  int yColumn_;
672 };
676 class OsiLinkBranchingObject : public OsiTwoWayBranchingObject {
677 
678 public:
679 
680  // Default Constructor
682 
683  // Useful constructor
684  OsiLinkBranchingObject (OsiSolverInterface * solver, const OsiLink * originalObject,
685  int way,
686  double separator);
687 
688  // Copy constructor
690 
691  // Assignment operator
693 
695  virtual OsiBranchingObject * clone() const;
696 
697  // Destructor
698  virtual ~OsiLinkBranchingObject ();
699 
700  using OsiBranchingObject::branch ;
702  virtual double branch(OsiSolverInterface * solver);
703 
704  using OsiBranchingObject::print ;
707  virtual void print(const OsiSolverInterface * solver = NULL);
708 private:
710 };
718 class OsiBiLinear : public OsiObject2 {
719 
720 public:
721 
722  // Default Constructor
723  OsiBiLinear ();
724 
730  OsiBiLinear (OsiSolverInterface * solver, int xColumn,
731  int yColumn, int xyRow, double coefficient,
732  double xMesh, double yMesh,
733  int numberExistingObjects = 0, const OsiObject ** objects = NULL );
734 
740  OsiBiLinear (CoinModel * coinModel, int xColumn,
741  int yColumn, int xyRow, double coefficient,
742  double xMesh, double yMesh,
743  int numberExistingObjects = 0, const OsiObject ** objects = NULL );
744 
745  // Copy constructor
746  OsiBiLinear ( const OsiBiLinear &);
747 
749  virtual OsiObject * clone() const;
750 
751  // Assignment operator
752  OsiBiLinear & operator=( const OsiBiLinear& rhs);
753 
754  // Destructor
755  virtual ~OsiBiLinear ();
756 
757  using OsiObject::infeasibility ;
759  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
760 
761  using OsiObject::feasibleRegion ;
767  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
768 
773  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
774 
776  virtual void resetSequenceEtc(int numberColumns, const int * originalColumns);
777 
778  // This does NOT set mutable stuff
779  virtual double checkInfeasibility(const OsiBranchingInformation * info) const;
780 
783  virtual bool canDoHeuristics() const {
784  return false;
785  }
788  virtual bool boundBranch() const {
789  return (branchingStrategy_&4) != 0;
790  }
792  inline int xColumn() const {
793  return xColumn_;
794  }
796  inline int yColumn() const {
797  return yColumn_;
798  }
800  inline int xRow() const {
801  return xRow_;
802  }
804  inline int yRow() const {
805  return yRow_;
806  }
808  inline int xyRow() const {
809  return xyRow_;
810  }
812  inline double coefficient() const {
813  return coefficient_;
814  }
816  inline void setCoefficient(double value) {
817  coefficient_ = value;
818  }
820  inline int firstLambda() const {
821  return firstLambda_;
822  }
824  inline double xSatisfied() const {
825  return xSatisfied_;
826  }
827  inline void setXSatisfied(double value) {
828  xSatisfied_ = value;
829  }
831  inline double ySatisfied() const {
832  return ySatisfied_;
833  }
834  inline void setYSatisfied(double value) {
835  ySatisfied_ = value;
836  }
838  inline double xOtherSatisfied() const {
839  return xOtherSatisfied_;
840  }
841  inline void setXOtherSatisfied(double value) {
842  xOtherSatisfied_ = value;
843  }
845  inline double yOtherSatisfied() const {
846  return yOtherSatisfied_;
847  }
848  inline void setYOtherSatisfied(double value) {
849  yOtherSatisfied_ = value;
850  }
852  inline double xMeshSize() const {
853  return xMeshSize_;
854  }
855  inline void setXMeshSize(double value) {
856  xMeshSize_ = value;
857  }
859  inline double yMeshSize() const {
860  return yMeshSize_;
861  }
862  inline void setYMeshSize(double value) {
863  yMeshSize_ = value;
864  }
866  inline double xySatisfied() const {
867  return xySatisfied_;
868  }
869  inline void setXYSatisfied(double value) {
870  xySatisfied_ = value;
871  }
873  void setMeshSizes(const OsiSolverInterface * solver, double x, double y);
884  inline int branchingStrategy() const {
885  return branchingStrategy_;
886  }
887  inline void setBranchingStrategy(int value) {
888  branchingStrategy_ = value;
889  }
897  inline int boundType() const {
898  return boundType_;
899  }
900  inline void setBoundType(int value) {
901  boundType_ = value;
902  }
904  void newBounds(OsiSolverInterface * solver, int way, short xOrY, double separator) const;
906  int updateCoefficients(const double * lower, const double * upper, double * objective,
907  CoinPackedMatrix * matrix, CoinWarmStartBasis * basis) const;
909  double xyCoefficient(const double * solution) const;
911  void getCoefficients(const OsiSolverInterface * solver, double xB[2], double yB[2], double xybar[4]) const;
913  double computeLambdas(const double xB[3], const double yB[3], const double xybar[4], double lambda[4]) const;
915  void addExtraRow(int row, double multiplier);
917  void getPseudoShadow(const OsiBranchingInformation * info);
919  double getMovement(const OsiBranchingInformation * info);
920 
921 protected:
923  void computeLambdas(const OsiSolverInterface * solver, double lambda[4]) const;
925 
927  double coefficient_;
929  double xMeshSize_;
931  double yMeshSize_;
933  double xSatisfied_;
935  double ySatisfied_;
937  double xOtherSatisfied_;
939  double yOtherSatisfied_;
941  double xySatisfied_;
943  mutable double xyBranchValue_;
945  int xColumn_;
947  int yColumn_;
949  int firstLambda_;
960  int branchingStrategy_;
968  int boundType_;
970  int xRow_;
972  int yRow_;
974  int xyRow_;
976  int convexity_;
978  int numberExtraRows_;
980  double * multiplier_;
982  int * extraRow_;
984  mutable short chosen_;
985 };
989 class OsiBiLinearBranchingObject : public OsiTwoWayBranchingObject {
990 
991 public:
992 
993  // Default Constructor
995 
996  // Useful constructor
997  OsiBiLinearBranchingObject (OsiSolverInterface * solver, const OsiBiLinear * originalObject,
998  int way,
999  double separator, int chosen);
1000 
1001  // Copy constructor
1003 
1004  // Assignment operator
1006 
1008  virtual OsiBranchingObject * clone() const;
1009 
1010  // Destructor
1011  virtual ~OsiBiLinearBranchingObject ();
1012 
1013  using OsiBranchingObject::branch ;
1015  virtual double branch(OsiSolverInterface * solver);
1016 
1017  using OsiBranchingObject::print ;
1020  virtual void print(const OsiSolverInterface * solver = NULL);
1023  virtual bool boundBranch() const;
1024 private:
1027  short chosen_;
1028 };
1036 class OsiBiLinearEquality : public OsiBiLinear {
1037 
1038 public:
1039 
1040  // Default Constructor
1042 
1048  OsiBiLinearEquality (OsiSolverInterface * solver, int xColumn,
1049  int yColumn, int xyRow, double rhs,
1050  double xMesh);
1051 
1052  // Copy constructor
1054 
1056  virtual OsiObject * clone() const;
1057 
1058  // Assignment operator
1060 
1061  // Destructor
1062  virtual ~OsiBiLinearEquality ();
1063 
1065  virtual double improvement(const OsiSolverInterface * solver) const;
1071  double newGrid(OsiSolverInterface * solver, int type) const;
1073  inline int numberPoints() const {
1074  return numberPoints_;
1075  }
1076  inline void setNumberPoints(int value) {
1077  numberPoints_ = value;
1078  }
1079 
1080 private:
1082  int numberPoints_;
1083 };
1085 
1086 
1087 class OsiSimpleFixedInteger : public OsiSimpleInteger {
1088 
1089 public:
1090 
1093 
1095  OsiSimpleFixedInteger (const OsiSolverInterface * solver, int iColumn);
1096 
1098  OsiSimpleFixedInteger (int iColumn, double lower, double upper);
1099 
1101  OsiSimpleFixedInteger (const OsiSimpleInteger &);
1102 
1105 
1107  virtual OsiObject * clone() const;
1108 
1111 
1113  virtual ~OsiSimpleFixedInteger ();
1114 
1115  using OsiObject::infeasibility ;
1117  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
1118 
1123  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
1124 protected:
1126 
1127 };
1137 class OsiUsesBiLinear : public OsiSimpleInteger {
1138 
1139 public:
1140 
1142  OsiUsesBiLinear ();
1143 
1145  OsiUsesBiLinear (const OsiSolverInterface * solver, int iColumn, int type);
1146 
1148  OsiUsesBiLinear (int iColumn, double lower, double upper, int type);
1149 
1151  OsiUsesBiLinear (const OsiSimpleInteger & rhs, int type);
1152 
1154  OsiUsesBiLinear ( const OsiUsesBiLinear & rhs);
1155 
1157  virtual OsiObject * clone() const;
1158 
1160  OsiUsesBiLinear & operator=( const OsiUsesBiLinear& rhs);
1161 
1163  virtual ~OsiUsesBiLinear ();
1164 
1165  using OsiObject::infeasibility ;
1167  virtual double infeasibility(const OsiBranchingInformation * info, int & whichWay) const;
1168 
1173  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) const;
1174 
1175  using OsiObject::feasibleRegion ;
1181  virtual double feasibleRegion(OsiSolverInterface * solver, const OsiBranchingInformation * info) const;
1182 
1184  void addBiLinearObjects(OsiSolverLink * solver);
1185 protected:
1188  int numberBiLinear_;
1190  int type_;
1192  OsiObject ** objects_;
1193 };
1201 class OsiChooseStrongSubset : public OsiChooseStrong {
1202 
1203 public:
1204 
1207 
1209  OsiChooseStrongSubset (const OsiSolverInterface * solver);
1210 
1213 
1216 
1218  virtual OsiChooseVariable * clone() const;
1219 
1221  virtual ~OsiChooseStrongSubset ();
1222 
1227  virtual int setupList ( OsiBranchingInformation *info, bool initialize);
1241  virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables);
1242 
1244  inline int numberObjectsToUse() const {
1245  return numberObjectsToUse_;
1246  }
1248  inline void setNumberObjectsToUse(int value) {
1249  numberObjectsToUse_ = value;
1250  }
1251 
1252 protected:
1253  // Data
1255  int numberObjectsToUse_;
1256 };
1257 
1258 #include <string>
1259 
1260 #include "CglStored.hpp"
1261 
1262 class CoinWarmStartBasis;
1264 class CglTemporary : public CglStored {
1265 
1266 public:
1267 
1268 
1279  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
1280  const CglTreeInfo info = CglTreeInfo()) const;
1282 
1285  CglTemporary ();
1287 
1289  CglTemporary (const CglTemporary & rhs);
1290 
1292  virtual CglCutGenerator * clone() const;
1293 
1295  CglTemporary &
1296  operator=(const CglTemporary& rhs);
1297 
1299  virtual
1300  ~CglTemporary ();
1302 
1303 private:
1304 
1305 // Private member methods
1306 
1307  // Private member data
1308 };
1309 //#############################################################################
1310 
1316 class OsiSolverLinearizedQuadratic : public OsiClpSolverInterface {
1317 
1318 public:
1319  //---------------------------------------------------------------------------
1322  virtual void initialSolve();
1325 
1326 
1334  virtual OsiSolverInterface * clone(bool copyData = true) const;
1335 
1338 
1341 
1343  virtual ~OsiSolverLinearizedQuadratic ();
1344 
1346 
1347 
1350  inline double bestObjectiveValue() const {
1352  return bestObjectiveValue_;
1353  }
1355  const double * bestSolution() const {
1356  return bestSolution_;
1357  }
1359  inline void setSpecialOptions3(int value) {
1360  specialOptions3_ = value;
1361  }
1363  inline int specialOptions3() const {
1364  return specialOptions3_;
1365  }
1367  ClpSimplex * quadraticModel() const {
1368  return quadraticModel_;
1369  }
1371 
1372  //---------------------------------------------------------------------------
1373 
1374 protected:
1375 
1376 
1379 
1382  double bestObjectiveValue_;
1385  ClpSimplex * quadraticModel_;
1387  double * bestSolution_;
1392  int specialOptions3_;
1394 };
1395 class ClpSimplex;
1400 ClpSimplex * approximateSolution(CoinModel & coinModel,
1401  int numberPasses, double deltaTolerance,
1402  int mode = 0);
1403 #endif
1404 
void setXSatisfied(double value)
Definition: CbcLinked.hpp:827
virtual ~CglTemporary()
Destructor.
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:1082
int firstLambda() const
First lambda (of 4)
Definition: CbcLinked.hpp:820
virtual ~OsiBiLinear()
int yColumn_
y column
Definition: CbcLinked.hpp:947
void addBiLinearObjects(OsiSolverLink *solver)
Add all bi-linear objects.
virtual OsiBranchingObject * clone() const
Clone.
void setXYSatisfied(double value)
Definition: CbcLinked.hpp:869
int type_
Type of variable - 0 continuous, 1 integer.
Definition: CbcLinked.hpp:1190
int xyRow() const
XY row.
Definition: CbcLinked.hpp:808
double bestObjectiveValue() const
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1351
virtual bool boundBranch() const
Return true if branch should only bound variables.
OsiBiLinearBranchingObject & operator=(const OsiBiLinearBranchingObject &rhs)
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
int xRow() const
X row.
Definition: CbcLinked.hpp:800
int boundType() const
Simple quadratic bound marker.
Definition: CbcLinked.hpp:897
This is to allow the user to replace initialSolve and resolve.
Definition: CbcLinked.hpp:1316
Define Continuous BiLinear objects for an == bound.
Definition: CbcLinked.hpp:1036
double yOtherSatisfied() const
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:845
double xySatisfied() const
XY satisfied if two version differ by less than this.
Definition: CbcLinked.hpp:866
void setNumberPoints(int value)
Definition: CbcLinked.hpp:1076
virtual ~OsiBiLinearBranchingObject()
ClpSimplex * quadraticModel_
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1385
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:377
OsiUsesBiLinear & operator=(const OsiUsesBiLinear &rhs)
Assignment operator.
OsiLinkedBound & operator=(const OsiLinkedBound &rhs)
Assignment operator.
int xColumn() const
X column.
Definition: CbcLinked.hpp:792
int numberAffected_
Number of variables/elements affected.
Definition: CbcLinked.hpp:366
List of bounds which depend on other bounds.
Definition: CbcLinked.hpp:298
int numberPoints() const
Number of points.
Definition: CbcLinked.hpp:1073
OsiSolverLinearizedQuadratic()
Default Constructor.
double xMeshSize() const
X meshSize.
Definition: CbcLinked.hpp:852
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...
OsiChooseStrongSubset & operator=(const OsiChooseStrongSubset &rhs)
Assignment operator.
void setBoundType(int value)
Definition: CbcLinked.hpp:900
This is for codes where solver needs to know about CbcModel Seems to provide only one value-added fea...
Definition: CbcFathom.hpp:88
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:1188
short chosen_
Which chosen -1 none, 0 x, 1 y.
Definition: CbcLinked.hpp:984
int boundType_
Simple quadratic bound marker.
Definition: CbcLinked.hpp:968
int xyRow_
Output row.
Definition: CbcLinked.hpp:974
double * multiplier_
Multiplier for coefficient on row.
Definition: CbcLinked.hpp:980
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:824
void setCoefficient(double value)
Set coefficient.
Definition: CbcLinked.hpp:816
Define a single variable class which is involved with OsiBiLinear objects.
Definition: CbcLinked.hpp:1137
void newBounds(OsiSolverInterface *solver, int way, short xOrY, double separator) const
Does work of branching.
virtual double branch(OsiSolverInterface *solver)
Does next branch and updates state.
double xyBranchValue_
value of x or y to branch about
Definition: CbcLinked.hpp:943
double xSatisfied_
x satisfied if less than this away from mesh
Definition: CbcLinked.hpp:933
OsiSimpleFixedInteger & operator=(const OsiSimpleFixedInteger &rhs)
Assignment operator.
ClpSimplex * quadraticModel() const
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1367
void setXOtherSatisfied(double value)
Definition: CbcLinked.hpp:841
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:945
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:937
virtual ~OsiSolverLinearizedQuadratic()
Destructor.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSolverInterface * model_
Pointer back to model.
Definition: CbcLinked.hpp:362
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
void setSpecialOptions3(int value)
Set special options.
Definition: CbcLinked.hpp:1359
boundElementAction * affected_
Actions.
Definition: CbcLinked.hpp:370
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:1087
int yRow() const
Y row.
Definition: CbcLinked.hpp:804
Stored Temporary Cut Generator Class - destroyed after first use.
Definition: CbcLinked.hpp:1264
double bestObjectiveValue_
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1383
double yOtherSatisfied_
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:939
ClpSimplex * approximateSolution(CoinModel &coinModel, int numberPasses, double deltaTolerance, int mode=0)
Return an approximate solution to a CoinModel.
OsiSimpleFixedInteger()
Default Constructor.
int firstLambda_
First lambda (of 4)
Definition: CbcLinked.hpp:949
virtual double improvement(const OsiSolverInterface *solver) const
Possible improvement.
This class chooses a variable to branch on.
Definition: CbcLinked.hpp:1201
int variable_
Variable.
Definition: CbcLinked.hpp:364
double xMeshSize_
x mesh
Definition: CbcLinked.hpp:929
double xOtherSatisfied() const
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:838
void setYMeshSize(double value)
Definition: CbcLinked.hpp:862
OsiBiLinear & operator=(const OsiBiLinear &rhs)
virtual ~OsiSimpleFixedInteger()
Destructor.
double * bestSolution_
Best solution found internally.
Definition: CbcLinked.hpp:1387
OsiBiLinearEquality & operator=(const OsiBiLinearEquality &rhs)
int numberObjectsToUse() const
Number of objects to use.
Definition: CbcLinked.hpp:1244
int specialOptions3_
0 bit (1) - don't do mini B&B 1 bit (2) - quadratic only in objective
Definition: CbcLinked.hpp:1392
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.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
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.
virtual CglCutGenerator * clone() const
Clone.
int yRow_
y row (-1 if x*x)
Definition: CbcLinked.hpp:972
void getCoefficients(const OsiSolverInterface *solver, double xB[2], double yB[2], double xybar[4]) const
Get LU coefficients from matrix.
virtual ~OsiUsesBiLinear()
Destructor.
void setYSatisfied(double value)
Definition: CbcLinked.hpp:834
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:884
virtual OsiObject * clone() const
Clone.
double ySatisfied_
y satisfied if less than this away from mesh
Definition: CbcLinked.hpp:935
double coefficient() const
Coefficient.
Definition: CbcLinked.hpp:812
virtual OsiObject * clone() const
Clone.
void setYOtherSatisfied(double value)
Definition: CbcLinked.hpp:848
double xySatisfied_
xy satisfied if less than this away from true
Definition: CbcLinked.hpp:941
Heuristic base class.
void setXMeshSize(double value)
Definition: CbcLinked.hpp:855
Define BiLinear objects.
Definition: CbcLinked.hpp:718
double ySatisfied() const
Y satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:831
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:927
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:976
int specialOptions3() const
Get special options.
Definition: CbcLinked.hpp:1363
void updateBounds(ClpSimplex *solver)
Update other bounds.
OsiObject ** objects_
Objects.
Definition: CbcLinked.hpp:1192
const double * bestSolution() const
Best solution found internally.
Definition: CbcLinked.hpp:1355
virtual OsiObject * clone() const
Clone.
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const
Generate Mixed Integer Stored cuts for the model of the solver interface, si.
virtual OsiObject * clone() const
Clone.
void setBranchingStrategy(int value)
Definition: CbcLinked.hpp:887
int xRow_
x row
Definition: CbcLinked.hpp:970
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: CbcLinked.hpp:783
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
CbcHeuristicDynamic3 & operator=(const CbcHeuristicDynamic3 &rhs)
Illegal Assignment operator.
double yMeshSize() const
Y meshSize.
Definition: CbcLinked.hpp:859
virtual bool canDealWithOdd() const
Returns true if can deal with "odd" problems e.g. sos type 2.
Definition: CbcLinked.hpp:415
void setNumberObjectsToUse(int value)
Set number of objects to use.
Definition: CbcLinked.hpp:1248
int variable() const
Get variable.
Definition: CbcLinked.hpp:332
int * extraRow_
Row number.
Definition: CbcLinked.hpp:982
int yColumn() const
Y column.
Definition: CbcLinked.hpp:796
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)
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:960
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
int maximumAffected_
Maximum number of variables/elements affected.
Definition: CbcLinked.hpp:368
Branching object for BiLinear objects.
Definition: CbcLinked.hpp:989
int numberExtraRows_
Number of extra rows (coefficients to be modified)
Definition: CbcLinked.hpp:978
int numberObjectsToUse_
Number of objects to be used (and set in solver)
Definition: CbcLinked.hpp:1255
virtual void setModel(CbcModel *model)
update model
Simple Branch and bound class.
Definition: CbcModel.hpp:98
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:788
double yMeshSize_
y mesh
Definition: CbcLinked.hpp:931
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:1027