Cbc 2.10.5
CbcLinked.hpp
Go to the documentation of this file.
1/* $Id$ */
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"
14#include "OsiClpSolverInterface.hpp"
15#include "OsiChooseVariable.hpp"
16#include "CbcFathom.hpp"
17class CbcModel;
18class CoinPackedMatrix;
19class OsiLinkedBound;
20class OsiObject;
21class CglStored;
22class CglTemporary;
30
31public:
32 //---------------------------------------------------------------------------
35
36 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
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
111 void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, int whichVariableAffected,
112 double multiplier = 1.0);
114 int updateCoefficients(ClpSimplex *solver, CoinPackedMatrix *matrix);
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 }
151 CoinPackedMatrix *cleanMatrix() const
152 {
153 return matrix_;
154 }
159 CoinPackedMatrix *originalRowCopy() const
160 {
161 return originalRowCopy_;
162 }
164 ClpSimplex *quadraticModel() const
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
239protected:
243 //void initialize(ClpSimplex * & solver, OsiObject ** & object) const;
245 void gutsOfDestructor(bool justNullify = false);
247 void gutsOfCopy(const OsiSolverLink &rhs);
249
255 CoinPackedMatrix *matrix_;
259 CoinPackedMatrix *originalRowCopy_;
261 ClpSimplex *quadraticModel_;
275 CoinModel coinModel_;
309};
315
316public:
317 //---------------------------------------------------------------------------
320
321 void updateBounds(ClpSimplex *solver);
323
329 OsiLinkedBound(OsiSolverInterface *model, int variable,
330 int numberAffected, const int *positionL,
331 const int *positionU, const double *multiplier);
332
335
338
341
343
347 inline int variable() const
348 {
349 return variable_;
350 }
352 void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable,
353 double multiplier = 1.0);
355
356protected:
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
378 OsiSolverInterface *model_;
388};
389#include "CbcHeuristic.hpp"
394public:
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
435private:
438};
439
440#include "OsiBranchingObject.hpp"
441
445class CoinWarmStartBasis;
446
447class OsiOldLink : public OsiSOS {
448
449public:
450 // Default Constructor
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
474
476 virtual OsiObject *clone() const;
477
478 // Assignment operator
480
481 // Destructor
482 virtual ~OsiOldLink();
483
484 using OsiObject::infeasibility;
486 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
487
488 using OsiObject::feasibleRegion;
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
524protected:
526
529};
533class OsiOldLinkBranchingObject : public OsiSOSBranchingObject {
534
535public:
536 // Default Constructor
538
539 // Useful constructor
540 OsiOldLinkBranchingObject(OsiSolverInterface *solver, const OsiOldLink *originalObject,
541 int way,
542 double separator);
543
544 // Copy constructor
546
547 // Assignment operator
549
551 virtual OsiBranchingObject *clone() const;
552
553 // Destructor
555
556 using OsiBranchingObject::branch;
558 virtual double branch(OsiSolverInterface *solver);
559
560 using OsiBranchingObject::print;
563 virtual void print(const OsiSolverInterface *solver = NULL);
564
565private:
567};
573
574public:
575 // Default Constructor
577
581 OsiOneLink(const OsiSolverInterface *solver, int xRow, int xColumn, int xyRow,
582 const char *functionString);
583
584 // Copy constructor
586
587 // Assignment operator
589
590 // Destructor
591 virtual ~OsiOneLink();
592
594
596 int xRow_;
600 int xyRow;
602 std::string function_;
603};
612class OsiLink : public OsiSOS {
613
614public:
615 // Default Constructor
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
632
633 // Destructor
634 virtual ~OsiLink();
635
636 using OsiObject::infeasibility;
638 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
639
640 using OsiObject::feasibleRegion;
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
676protected:
679 double meshSize_;
685 int yRow_;
688};
692class OsiLinkBranchingObject : public OsiTwoWayBranchingObject {
693
694public:
695 // Default Constructor
697
698 // Useful constructor
699 OsiLinkBranchingObject(OsiSolverInterface *solver, const OsiLink *originalObject,
700 int way,
701 double separator);
702
703 // Copy constructor
705
706 // Assignment operator
708
710 virtual OsiBranchingObject *clone() const;
711
712 // Destructor
714
715 using OsiBranchingObject::branch;
717 virtual double branch(OsiSolverInterface *solver);
718
719 using OsiBranchingObject::print;
722 virtual void print(const OsiSolverInterface *solver = NULL);
723
724private:
726};
733class OsiBiLinear : public OsiObject2 {
734
735public:
736 // Default Constructor
738
744 OsiBiLinear(OsiSolverInterface *solver, int xColumn,
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
761
763 virtual OsiObject *clone() const;
764
765 // Assignment operator
767
768 // Destructor
769 virtual ~OsiBiLinear();
770
771 using OsiObject::infeasibility;
773 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
774
775 using OsiObject::feasibleRegion;
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
963protected:
965 void computeLambdas(const OsiSolverInterface *solver, double lambda[4]) const;
967
985 mutable double xyBranchValue_;
1026 mutable short chosen_;
1027};
1031class OsiBiLinearBranchingObject : public OsiTwoWayBranchingObject {
1032
1033public:
1034 // Default Constructor
1036
1037 // Useful constructor
1038 OsiBiLinearBranchingObject(OsiSolverInterface *solver, const OsiBiLinear *originalObject,
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
1053
1054 using OsiBranchingObject::branch;
1056 virtual double branch(OsiSolverInterface *solver);
1057
1058 using OsiBranchingObject::print;
1061 virtual void print(const OsiSolverInterface *solver = NULL);
1064 virtual bool boundBranch() const;
1065
1066protected:
1069 short chosen_;
1070};
1078
1079public:
1080 // Default Constructor
1082
1088 OsiBiLinearEquality(OsiSolverInterface *solver, int xColumn,
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
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
1122protected:
1125};
1127
1128class OsiSimpleFixedInteger : public OsiSimpleInteger {
1129
1130public:
1133
1135 OsiSimpleFixedInteger(const OsiSolverInterface *solver, int iColumn);
1136
1138 OsiSimpleFixedInteger(int iColumn, double lower, double upper);
1139
1141 OsiSimpleFixedInteger(const OsiSimpleInteger &);
1142
1145
1147 virtual OsiObject *clone() const;
1148
1151
1154
1155 using OsiObject::infeasibility;
1157 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
1158
1163 virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
1164
1165protected:
1167};
1176class OsiUsesBiLinear : public OsiSimpleInteger {
1177
1178public:
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
1193
1195 virtual OsiObject *clone() const;
1196
1199
1202
1203 using OsiObject::infeasibility;
1205 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
1206
1211 virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
1212
1213 using OsiObject::feasibleRegion;
1219 virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
1220
1223
1224protected:
1231 OsiObject **objects_;
1232};
1240class OsiChooseStrongSubset : public OsiChooseStrong {
1241
1242public:
1245
1247 OsiChooseStrongSubset(const OsiSolverInterface *solver);
1248
1251
1254
1256 virtual OsiChooseVariable *clone() const;
1257
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
1292protected:
1293 // Data
1296};
1297
1298#include <string>
1299
1300#include "CglStored.hpp"
1301
1302class CoinWarmStartBasis;
1304class CglTemporary : public CglStored {
1305
1306public:
1317 virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
1318 const CglTreeInfo info = CglTreeInfo());
1320
1325
1328
1330 virtual CglCutGenerator *clone() const;
1331
1333 CglTemporary &
1335
1337 virtual ~CglTemporary();
1339
1340private:
1341 // Private member methods
1342
1343 // Private member data
1344};
1345//#############################################################################
1346
1352class OsiSolverLinearizedQuadratic : public OsiClpSolverInterface {
1353
1354public:
1355 //---------------------------------------------------------------------------
1358
1359 virtual void initialSolve();
1361
1369 virtual OsiSolverInterface *clone(bool copyData = true) const;
1370
1373
1376
1379
1381
1385 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 }
1405 ClpSimplex *quadraticModel() const
1406 {
1407 return quadraticModel_;
1408 }
1410
1411 //---------------------------------------------------------------------------
1412
1413protected:
1416
1422 ClpSimplex *quadraticModel_;
1431};
1432class ClpSimplex;
1437ClpSimplex *approximateSolution(CoinModel &coinModel,
1438 int numberPasses, double deltaTolerance,
1439 int mode = 0);
1440#endif
1441
1442/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1443*/
ClpSimplex * approximateSolution(CoinModel &coinModel, int numberPasses, double deltaTolerance, int mode=0)
Return an approximate solution to a CoinModel.
heuristic - just picks up any good solution
Definition: CbcLinked.hpp:393
CbcHeuristicDynamic3(CbcModel &model)
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
CbcHeuristicDynamic3(const CbcHeuristicDynamic3 &)
virtual void setModel(CbcModel *model)
update model
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
CbcHeuristicDynamic3 & operator=(const CbcHeuristicDynamic3 &rhs)
Illegal Assignment operator.
virtual CbcHeuristic * clone() const
Clone.
virtual bool canDealWithOdd() const
Returns true if can deal with "odd" problems e.g. sos type 2.
Definition: CbcLinked.hpp:430
Heuristic base class.
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...
Simple Branch and bound class.
Definition: CbcModel.hpp:100
This is for codes where solver needs to know about CbcModel Seems to provide only one value-added fea...
Definition: CbcFathom.hpp:88
Stored Temporary Cut Generator Class - destroyed after first use.
Definition: CbcLinked.hpp:1304
CglTemporary()
Default constructor.
CglTemporary & operator=(const CglTemporary &rhs)
Assignment operator.
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 ~CglTemporary()
Destructor.
virtual CglCutGenerator * clone() const
Clone.
CglTemporary(const CglTemporary &rhs)
Copy constructor.
Branching object for BiLinear objects.
Definition: CbcLinked.hpp:1031
OsiBiLinearBranchingObject & operator=(const OsiBiLinearBranchingObject &rhs)
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
short chosen_
data 1 means branch on x, 2 branch on y
Definition: CbcLinked.hpp:1069
virtual bool boundBranch() const
Return true if branch should only bound variables.
OsiBiLinearBranchingObject(OsiSolverInterface *solver, const OsiBiLinear *originalObject, int way, double separator, int chosen)
virtual double branch(OsiSolverInterface *solver)
Does next branch and updates state.
virtual OsiBranchingObject * clone() const
Clone.
virtual ~OsiBiLinearBranchingObject()
OsiBiLinearBranchingObject(const OsiBiLinearBranchingObject &)
Define Continuous BiLinear objects for an == bound.
Definition: CbcLinked.hpp:1077
virtual ~OsiBiLinearEquality()
virtual double improvement(const OsiSolverInterface *solver) const
Possible improvement.
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
virtual OsiObject * clone() const
Clone.
void setNumberPoints(int value)
Definition: CbcLinked.hpp:1117
OsiBiLinearEquality & operator=(const OsiBiLinearEquality &rhs)
OsiBiLinearEquality(OsiSolverInterface *solver, int xColumn, int yColumn, int xyRow, double rhs, double xMesh)
Useful constructor - This Adds in rows and variables to construct Ordered Set for x*y = b So note not...
int numberPoints_
Number of points.
Definition: CbcLinked.hpp:1124
int numberPoints() const
Number of points.
Definition: CbcLinked.hpp:1113
OsiBiLinearEquality(const OsiBiLinearEquality &)
Define BiLinear objects.
Definition: CbcLinked.hpp:733
short chosen_
Which chosen -1 none, 0 x, 1 y.
Definition: CbcLinked.hpp:1026
double yMeshSize_
y mesh
Definition: CbcLinked.hpp:973
int firstLambda_
First lambda (of 4)
Definition: CbcLinked.hpp:991
virtual OsiObject * clone() const
Clone.
void setXYSatisfied(double value)
Definition: CbcLinked.hpp:906
int xRow_
x row
Definition: CbcLinked.hpp:1012
void addExtraRow(int row, double multiplier)
Adds in data for extra row with variable coefficients.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: CbcLinked.hpp:797
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 xSatisfied() const
X satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:848
int * extraRow_
Row number.
Definition: CbcLinked.hpp:1024
int yRow_
y row (-1 if x*x)
Definition: CbcLinked.hpp:1014
void setXSatisfied(double value)
Definition: CbcLinked.hpp:852
double ySatisfied_
y satisfied if less than this away from mesh
Definition: CbcLinked.hpp:977
int boundType() const
Simple quadratic bound marker.
Definition: CbcLinked.hpp:937
int yColumn() const
Y column.
Definition: CbcLinked.hpp:813
void setYMeshSize(double value)
Definition: CbcLinked.hpp:897
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
int yColumn_
y column
Definition: CbcLinked.hpp:989
int boundType_
Simple quadratic bound marker.
Definition: CbcLinked.hpp:1010
int xColumn_
x column
Definition: CbcLinked.hpp:987
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
void setYOtherSatisfied(double value)
Definition: CbcLinked.hpp:879
void setCoefficient(double value)
Set coefficient.
Definition: CbcLinked.hpp:838
virtual bool boundBranch() const
Return true if branch should only bound variables.
Definition: CbcLinked.hpp:803
int xColumn() const
X column.
Definition: CbcLinked.hpp:808
double getMovement(const OsiBranchingInformation *info)
Gets sum of movements to correct value.
int updateCoefficients(const double *lower, const double *upper, double *objective, CoinPackedMatrix *matrix, CoinWarmStartBasis *basis) const
Updates coefficients - returns number updated.
OsiBiLinear(const OsiBiLinear &)
double xMeshSize() const
X meshSize.
Definition: CbcLinked.hpp:884
double yOtherSatisfied() const
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:875
OsiBiLinear(CoinModel *coinModel, int xColumn, int yColumn, int xyRow, double coefficient, double xMesh, double yMesh, int numberExistingObjects=0, const OsiObject **objects=NULL)
Useful constructor - This Adds in rows and variables to construct valid Linked Ordered Set Adds extra...
void setMeshSizes(const OsiSolverInterface *solver, double x, double y)
Set sizes and other stuff.
double ySatisfied() const
Y satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:857
void setXOtherSatisfied(double value)
Definition: CbcLinked.hpp:870
double * multiplier_
Multiplier for coefficient on row.
Definition: CbcLinked.hpp:1022
double xyCoefficient(const double *solution) const
Returns true value of single xyRow coefficient.
int xyRow() const
XY row.
Definition: CbcLinked.hpp:828
double xySatisfied() const
XY satisfied if two version differ by less than this.
Definition: CbcLinked.hpp:902
virtual ~OsiBiLinear()
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
double xySatisfied_
xy satisfied if less than this away from true
Definition: CbcLinked.hpp:983
double xMeshSize_
x mesh
Definition: CbcLinked.hpp:971
void computeLambdas(const OsiSolverInterface *solver, double lambda[4]) const
Compute lambdas if coefficients not changing.
int xyRow_
Output row.
Definition: CbcLinked.hpp:1016
int numberExtraRows_
Number of extra rows (coefficients to be modified)
Definition: CbcLinked.hpp:1020
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
double yOtherSatisfied_
Y other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:981
void setYSatisfied(double value)
Definition: CbcLinked.hpp:861
void getCoefficients(const OsiSolverInterface *solver, double xB[2], double yB[2], double xybar[4]) const
Get LU coefficients from matrix.
int firstLambda() const
First lambda (of 4)
Definition: CbcLinked.hpp:843
double coefficient_
data
Definition: CbcLinked.hpp:969
void setXMeshSize(double value)
Definition: CbcLinked.hpp:888
double xSatisfied_
x satisfied if less than this away from mesh
Definition: CbcLinked.hpp:975
int yRow() const
Y row.
Definition: CbcLinked.hpp:823
double yMeshSize() const
Y meshSize.
Definition: CbcLinked.hpp:893
void getPseudoShadow(const OsiBranchingInformation *info)
Sets infeasibility and other when pseudo shadow prices.
void setBoundType(int value)
Definition: CbcLinked.hpp:941
double xyBranchValue_
value of x or y to branch about
Definition: CbcLinked.hpp:985
int convexity_
Convexity row.
Definition: CbcLinked.hpp:1018
OsiBiLinear(OsiSolverInterface *solver, int xColumn, int yColumn, int xyRow, double coefficient, double xMesh, double yMesh, int numberExistingObjects=0, const OsiObject **objects=NULL)
Useful constructor - This Adds in rows and variables to construct valid Linked Ordered Set Adds extra...
double xOtherSatisfied() const
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:866
void newBounds(OsiSolverInterface *solver, int way, short xOrY, double separator) const
Does work of branching.
int xRow() const
X row.
Definition: CbcLinked.hpp:818
double coefficient() const
Coefficient.
Definition: CbcLinked.hpp:833
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
void setBranchingStrategy(int value)
Definition: CbcLinked.hpp:926
OsiBiLinear & operator=(const OsiBiLinear &rhs)
double xOtherSatisfied_
X other satisfied if less than this away from mesh.
Definition: CbcLinked.hpp:979
This class chooses a variable to branch on.
Definition: CbcLinked.hpp:1240
void setNumberObjectsToUse(int value)
Set number of objects to use.
Definition: CbcLinked.hpp:1287
OsiChooseStrongSubset(const OsiChooseStrongSubset &)
Copy constructor.
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...
OsiChooseStrongSubset(const OsiSolverInterface *solver)
Constructor from solver (so we can set up arrays etc)
OsiChooseStrongSubset()
Default Constructor.
int numberObjectsToUse_
Number of objects to be used (and set in solver)
Definition: CbcLinked.hpp:1295
int numberObjectsToUse() const
Number of objects to use.
Definition: CbcLinked.hpp:1282
virtual OsiChooseVariable * clone() const
Clone.
OsiChooseStrongSubset & operator=(const OsiChooseStrongSubset &rhs)
Assignment operator.
virtual ~OsiChooseStrongSubset()
Destructor.
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
Branching object for Linked ordered sets.
Definition: CbcLinked.hpp:692
OsiLinkBranchingObject & operator=(const OsiLinkBranchingObject &rhs)
OsiLinkBranchingObject(OsiSolverInterface *solver, const OsiLink *originalObject, int way, double separator)
OsiLinkBranchingObject(const OsiLinkBranchingObject &)
virtual OsiBranchingObject * clone() const
Clone.
virtual ~OsiLinkBranchingObject()
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
virtual double branch(OsiSolverInterface *solver)
Does next branch and updates state.
List of bounds which depend on other bounds.
Definition: CbcLinked.hpp:314
OsiLinkedBound()
Default Constructor.
int numberAffected_
Number of variables/elements affected.
Definition: CbcLinked.hpp:382
OsiLinkedBound(const OsiLinkedBound &)
Copy constructor.
OsiLinkedBound & operator=(const OsiLinkedBound &rhs)
Assignment operator.
~OsiLinkedBound()
Destructor.
int variable_
Variable.
Definition: CbcLinked.hpp:380
OsiLinkedBound(OsiSolverInterface *model, int variable, int numberAffected, const int *positionL, const int *positionU, const double *multiplier)
Useful Constructor.
int maximumAffected_
Maximum number of variables/elements affected.
Definition: CbcLinked.hpp:384
boundElementAction * affected_
Actions.
Definition: CbcLinked.hpp:386
void addBoundModifier(bool upperBoundAffected, bool useUpperBound, int whichVariable, double multiplier=1.0)
Add a bound modifier.
int variable() const
Get variable.
Definition: CbcLinked.hpp:347
OsiSolverInterface * model_
Pointer back to model.
Definition: CbcLinked.hpp:378
void updateBounds(ClpSimplex *solver)
Update other bounds.
Branching object for Linked ordered sets.
Definition: CbcLinked.hpp:533
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
virtual OsiBranchingObject * clone() const
Clone.
OsiOldLinkBranchingObject & operator=(const OsiOldLinkBranchingObject &rhs)
virtual ~OsiOldLinkBranchingObject()
OsiOldLinkBranchingObject(const OsiOldLinkBranchingObject &)
OsiOldLinkBranchingObject(OsiSolverInterface *solver, const OsiOldLink *originalObject, int way, double separator)
virtual double branch(OsiSolverInterface *solver)
Does next branch and updates state.
Define a single integer class - but one where you keep branching until fixed even if satisfied.
Definition: CbcLinked.hpp:1128
OsiSimpleFixedInteger & operator=(const OsiSimpleFixedInteger &rhs)
Assignment operator.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
OsiSimpleFixedInteger(int iColumn, double lower, double upper)
Useful constructor - passed solver index and original bounds.
OsiSimpleFixedInteger(const OsiSolverInterface *solver, int iColumn)
Useful constructor - passed solver index.
OsiSimpleFixedInteger(const OsiSimpleFixedInteger &)
Copy constructor.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
virtual OsiObject * clone() const
Clone.
OsiSimpleFixedInteger()
Default Constructor.
virtual ~OsiSimpleFixedInteger()
Destructor.
OsiSimpleFixedInteger(const OsiSimpleInteger &)
Useful constructor - passed simple integer.
This is to allow the user to replace initialSolve and resolve.
Definition: CbcLinked.hpp:1352
const double * bestSolution() const
Best solution found internally.
Definition: CbcLinked.hpp:1390
double bestObjectiveValue() const
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1385
ClpSimplex * quadraticModel_
Copy of quadratic model if one.
Definition: CbcLinked.hpp:1422
virtual OsiSolverInterface * clone(bool copyData=true) const
Clone.
void setSpecialOptions3(int value)
Set special options.
Definition: CbcLinked.hpp:1395
OsiSolverLinearizedQuadratic()
Default Constructor.
double bestObjectiveValue_
Objective value of best solution found internally.
Definition: CbcLinked.hpp:1420
int specialOptions3() const
Get special options.
Definition: CbcLinked.hpp:1400
int specialOptions3_
0 bit (1) - don't do mini B&B 1 bit (2) - quadratic only in objective
Definition: CbcLinked.hpp:1429
OsiSolverLinearizedQuadratic(const OsiSolverLinearizedQuadratic &)
Copy constructor.
virtual void initialSolve()
Solve initial LP relaxation.
OsiSolverLinearizedQuadratic & operator=(const OsiSolverLinearizedQuadratic &rhs)
Assignment operator.
double * bestSolution_
Best solution found internally.
Definition: CbcLinked.hpp:1424
virtual ~OsiSolverLinearizedQuadratic()
Destructor.
OsiSolverLinearizedQuadratic(ClpSimplex *quadraticModel)
Useful constructor (solution should be good)
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
void addBiLinearObjects(OsiSolverLink *solver)
Add all bi-linear objects.
OsiUsesBiLinear(const OsiSimpleInteger &rhs, int type)
Useful constructor - passed simple integer.
virtual OsiObject * clone() const
Clone.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current value.
OsiUsesBiLinear(const OsiSolverInterface *solver, int iColumn, int type)
Useful constructor - passed solver index.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
OsiObject ** objects_
Objects.
Definition: CbcLinked.hpp:1231
OsiUsesBiLinear()
Default Constructor.
int type_
Type of variable - 0 continuous, 1 integer.
Definition: CbcLinked.hpp:1229
OsiUsesBiLinear & operator=(const OsiUsesBiLinear &rhs)
Assignment operator.
OsiUsesBiLinear(int iColumn, double lower, double upper, int type)
Useful constructor - passed solver index and original bounds.
int numberBiLinear_
data Number of bilinear objects (maybe could be more general)
Definition: CbcLinked.hpp:1227
virtual ~OsiUsesBiLinear()
Destructor.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiUsesBiLinear(const OsiUsesBiLinear &rhs)
Copy constructor.