Clp 1.17.6

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OsiBranchingObject.hpp
Go to the documentation of this file.
1 // Copyright (C) 2006, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This code is licensed under the terms of the Eclipse Public License (EPL).
4
5 #ifndef OsiBranchingObject_H
6 #define OsiBranchingObject_H
7
8 #include <cassert>
9 #include <string>
10 #include <vector>
11
12 #include "CoinError.hpp"
13 #include "CoinTypes.hpp"
14
15 class OsiSolverInterface;
16 class OsiSolverBranch;
17
18 class OsiBranchingObject;
19 class OsiBranchingInformation;
20
21 //#############################################################################
22 //This contains the abstract base class for an object and for branching.
23 //It also contains a simple integer class
24 //#############################################################################
25
56 class OsiObject {
57
58 public:
60 OsiObject();
61
63 OsiObject(const OsiObject &);
64
66 OsiObject &operator=(const OsiObject &rhs);
67
69 virtual OsiObject *clone() const = 0;
70
72 virtual ~OsiObject();
73
95 double infeasibility(const OsiSolverInterface *solver, int &whichWay) const;
96 // Faster version when more information available
97 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const = 0;
98 // This does NOT set mutable stuff
99 virtual double checkInfeasibility(const OsiBranchingInformation *info) const;
100
105 virtual double feasibleRegion(OsiSolverInterface *solver) const;
111 virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const = 0;
112
118 virtual OsiBranchingObject *createBranch(OsiSolverInterface * /*solver*/,
119 const OsiBranchingInformation * /*info*/,
120 int /*way*/) const
121 {
122 throw CoinError("Need code", "createBranch", "OsiBranchingObject");
123 return NULL;
124 }
125
128 virtual bool canDoHeuristics() const
129 {
130 return true;
131 }
134 virtual bool canMoveToNearest() const
135 {
136 return false;
137 }
141 virtual int columnNumber() const;
143 inline int priority() const
144 {
145 return priority_;
146 }
148 inline void setPriority(int priority)
149 {
150 priority_ = priority;
151 }
154 virtual bool boundBranch() const
155 {
156 return true;
157 }
159 virtual bool canHandleShadowPrices() const
160 {
161 return false;
162 }
164 inline int numberWays() const
165 {
166 return numberWays_;
167 }
169 inline void setNumberWays(int numberWays)
170 {
171 numberWays_ = static_cast< short int >(numberWays);
172 }
177 inline void setWhichWay(int way)
178 {
179 whichWay_ = static_cast< short int >(way);
180 }
185 inline int whichWay() const
186 {
187 return whichWay_;
188 }
190 virtual int preferredWay() const
191 {
192 return -1;
193 }
195 inline double infeasibility() const
196 {
197 return infeasibility_;
198 }
200 virtual double upEstimate() const;
202 virtual double downEstimate() const;
207 virtual void resetBounds(const OsiSolverInterface *) {}
210 virtual void resetSequenceEtc(int, const int *) {}
212 virtual void updateBefore(const OsiObject *) {}
214 virtual void updateAfter(const OsiObject *, const OsiObject *) {}
215
216 protected:
218
220 mutable double infeasibility_;
222 mutable short whichWay_;
224 short numberWays_;
226 int priority_;
227 };
230
231 class OsiObject2 : public OsiObject {
232
233 public:
235 OsiObject2();
236
238 OsiObject2(const OsiObject2 &);
239
241 OsiObject2 &operator=(const OsiObject2 &rhs);
242
244 virtual ~OsiObject2();
245
247 inline void setPreferredWay(int value)
248 {
249 preferredWay_ = value;
250 }
251
253 virtual int preferredWay() const
254 {
255 return preferredWay_;
256 }
257
258 protected:
260 int preferredWay_;
262 mutable double otherInfeasibility_;
263 };
264
282 class OsiBranchingObject {
283
284 public:
286 OsiBranchingObject();
287
289 OsiBranchingObject(OsiSolverInterface *solver, double value);
290
292 OsiBranchingObject(const OsiBranchingObject &);
293
295 OsiBranchingObject &operator=(const OsiBranchingObject &rhs);
296
298 virtual OsiBranchingObject *clone() const = 0;
299
301 virtual ~OsiBranchingObject();
302
304 inline int numberBranches() const
305 {
306 return numberBranches_;
307 }
308
310 inline int numberBranchesLeft() const
311 {
312 return numberBranches_ - branchIndex_;
313 }
314
316 inline void incrementNumberBranchesLeft()
317 {
318 numberBranches_++;
319 }
320
324 inline void setNumberBranchesLeft(int /*value*/)
325 { /*assert (value==1&&!branchIndex_);*/
326 numberBranches_ = 1;
327 }
328
330 inline void decrementNumberBranchesLeft()
331 {
332 branchIndex_++;
333 }
334
340 virtual double branch(OsiSolverInterface *solver) = 0;
346 virtual double branch() { return branch(NULL); }
349 virtual bool boundBranch() const
350 {
351 return true;
352 }
356 inline int branchIndex() const
357 {
358 return branchIndex_;
359 }
360
363 inline void setBranchingIndex(int branchIndex)
364 {
365 branchIndex_ = static_cast< short int >(branchIndex);
366 }
367
369 inline double value() const
370 {
371 return value_;
372 }
373
375 inline const OsiObject *originalObject() const
376 {
377 return originalObject_;
378 }
380 inline void setOriginalObject(const OsiObject *object)
381 {
382 originalObject_ = object;
383 }
387 virtual void checkIsCutoff(double) {}
389 int columnNumber() const;
392 virtual void print(const OsiSolverInterface * = NULL) const {}
393
394 protected:
396 double value_;
397
399 const OsiObject *originalObject_;
400
403 int numberBranches_;
404
408 short branchIndex_;
409 };
410 /* This contains information
411 This could also contain pseudo shadow prices
412 or information for dealing with computing and trusting pseudo-costs
413 */
414 class OsiBranchingInformation {
415
416 public:
418 OsiBranchingInformation();
419
424 OsiBranchingInformation(const OsiSolverInterface *solver, bool normalSolver, bool copySolution = false);
425
427 OsiBranchingInformation(const OsiBranchingInformation &);
428
430 OsiBranchingInformation &operator=(const OsiBranchingInformation &rhs);
431
433 virtual OsiBranchingInformation *clone() const;
434
436 virtual ~OsiBranchingInformation();
437
438 // Note public
439 public:
441
448 int stateOfSearch_;
450 double objectiveValue_;
452 double cutoff_;
454 double direction_;
456 double integerTolerance_;
458 double primalTolerance_;
460 double timeRemaining_;
462 double defaultDual_;
464 mutable const OsiSolverInterface *solver_;
466 int numberColumns_;
468 mutable const double *lower_;
470 mutable const double *solution_;
472 mutable const double *upper_;
474 const double *hotstartSolution_;
476 const double *pi_;
478 const double *rowActivity_;
480 const double *objective_;
482 const double *rowLower_;
484 const double *rowUpper_;
486 const double *elementByColumn_;
488 const CoinBigIndex *columnStart_;
490 const int *columnLength_;
492 const int *row_;
498 double *usefulRegion_;
500 int *indexRegion_;
502 int numberSolutions_;
504 int numberBranchingSolutions_;
506 int depth_;
508 bool owningSolution_;
509 };
510
512
513 class OsiTwoWayBranchingObject : public OsiBranchingObject {
514
515 public:
517 OsiTwoWayBranchingObject();
518
525 OsiTwoWayBranchingObject(OsiSolverInterface *solver, const OsiObject *originalObject,
526 int way, double value);
527
529 OsiTwoWayBranchingObject(const OsiTwoWayBranchingObject &);
530
532 OsiTwoWayBranchingObject &operator=(const OsiTwoWayBranchingObject &rhs);
533
535 virtual ~OsiTwoWayBranchingObject();
536
537 using OsiBranchingObject::branch;
543 virtual double branch(OsiSolverInterface *solver) = 0;
544
545 inline int firstBranch() const { return firstBranch_; }
547 inline int way() const
548 {
549 return !branchIndex_ ? firstBranch_ : -firstBranch_;
550 }
551
552 protected:
554 int firstBranch_;
555 };
557
558 class OsiSimpleInteger : public OsiObject2 {
559
560 public:
562 OsiSimpleInteger();
563
565 OsiSimpleInteger(const OsiSolverInterface *solver, int iColumn);
566
568 OsiSimpleInteger(int iColumn, double lower, double upper);
569
571 OsiSimpleInteger(const OsiSimpleInteger &);
572
574 virtual OsiObject *clone() const;
575
577 OsiSimpleInteger &operator=(const OsiSimpleInteger &rhs);
578
580 virtual ~OsiSimpleInteger();
581
582 using OsiObject::infeasibility;
584 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
585
586 using OsiObject::feasibleRegion;
592 virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
593
598 virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
599
601 inline void setColumnNumber(int value)
602 {
603 columnNumber_ = value;
604 }
605
610 virtual int columnNumber() const;
611
613 inline double originalLowerBound() const
614 {
615 return originalLower_;
616 }
617 inline void setOriginalLowerBound(double value)
618 {
619 originalLower_ = value;
620 }
621 inline double originalUpperBound() const
622 {
623 return originalUpper_;
624 }
625 inline void setOriginalUpperBound(double value)
626 {
627 originalUpper_ = value;
628 }
633 virtual void resetBounds(const OsiSolverInterface *solver);
636 virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
637
639 virtual double upEstimate() const;
641 virtual double downEstimate() const;
643 virtual bool canHandleShadowPrices() const
644 {
645 return false;
646 }
647
648 protected:
651 double originalLower_;
653 double originalUpper_;
655 int columnNumber_;
656 };
664 class OsiIntegerBranchingObject : public OsiTwoWayBranchingObject {
665
666 public:
668 OsiIntegerBranchingObject();
669
677 OsiIntegerBranchingObject(OsiSolverInterface *solver, const OsiSimpleInteger *originalObject,
678 int way, double value);
686 OsiIntegerBranchingObject(OsiSolverInterface *solver, const OsiSimpleInteger *originalObject,
687 int way, double value, double downUpperBound, double upLowerBound);
688
690 OsiIntegerBranchingObject(const OsiIntegerBranchingObject &);
691
693 OsiIntegerBranchingObject &operator=(const OsiIntegerBranchingObject &rhs);
694
696 virtual OsiBranchingObject *clone() const;
697
699 virtual ~OsiIntegerBranchingObject();
700
701 using OsiBranchingObject::branch;
707 virtual double branch(OsiSolverInterface *solver);
708
709 using OsiBranchingObject::print;
712 virtual void print(const OsiSolverInterface *solver = NULL);
713
714 protected:
715 // Probably could get away with just value which is already stored
717 double down_[2];
719 double up_[2];
720 };
721
728 class OsiSOS : public OsiObject2 {
729
730 public:
731 // Default Constructor
732 OsiSOS();
733
738 OsiSOS(const OsiSolverInterface *solver, int numberMembers,
739 const int *which, const double *weights, int type = 1);
740
741 // Copy constructor
742 OsiSOS(const OsiSOS &);
743
745 virtual OsiObject *clone() const;
746
747 // Assignment operator
748 OsiSOS &operator=(const OsiSOS &rhs);
749
750 // Destructor
751 virtual ~OsiSOS();
752
753 using OsiObject::infeasibility;
755 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
756
757 using OsiObject::feasibleRegion;
763 virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
764
769 virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
771 virtual double upEstimate() const;
773 virtual double downEstimate() const;
774
776 virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
777
779 inline int numberMembers() const
780 {
781 return numberMembers_;
782 }
783
785 inline const int *members() const
786 {
787 return members_;
788 }
789
791 inline int sosType() const
792 {
793 return sosType_;
794 }
795
797 inline int setType() const
798 {
799 return sosType_;
800 }
801
803 inline const double *weights() const
804 {
805 return weights_;
806 }
807
810 virtual bool canDoHeuristics() const
811 {
812 return (sosType_ == 1 && integerValued_);
813 }
815 inline void setIntegerValued(bool yesNo)
816 {
817 integerValued_ = yesNo;
818 }
820 virtual bool canHandleShadowPrices() const
821 {
822 return true;
823 }
825 inline void setNumberMembers(int value)
826 {
827 numberMembers_ = value;
828 }
829
831 inline int *mutableMembers() const
832 {
833 return members_;
834 }
835
837 inline void setSosType(int value)
838 {
839 sosType_ = value;
840 }
841
843 inline double *mutableWeights() const
844 {
845 return weights_;
846 }
847
848 protected:
850
852 int *members_;
854 double *weights_;
855
857 int numberMembers_;
859 int sosType_;
861 bool integerValued_;
862 };
863
867 class OsiSOSBranchingObject : public OsiTwoWayBranchingObject {
868
869 public:
870 // Default Constructor
871 OsiSOSBranchingObject();
872
873 // Useful constructor
874 OsiSOSBranchingObject(OsiSolverInterface *solver, const OsiSOS *originalObject,
875 int way,
876 double separator);
877
878 // Copy constructor
879 OsiSOSBranchingObject(const OsiSOSBranchingObject &);
880
881 // Assignment operator
882 OsiSOSBranchingObject &operator=(const OsiSOSBranchingObject &rhs);
883
885 virtual OsiBranchingObject *clone() const;
886
887 // Destructor
888 virtual ~OsiSOSBranchingObject();
889
890 using OsiBranchingObject::branch;
892 virtual double branch(OsiSolverInterface *solver);
893
894 using OsiBranchingObject::print;
897 virtual void print(const OsiSolverInterface *solver = NULL);
898
899 private:
901 };
904 class OsiLotsize : public OsiObject2 {
905
906 public:
907 // Default Constructor
908 OsiLotsize();
909
910 /* Useful constructor - passed model index.
911 Also passed valid values - if range then pairs
912 */
913 OsiLotsize(const OsiSolverInterface *solver, int iColumn,
914 int numberPoints, const double *points, bool range = false);
915
916 // Copy constructor
917 OsiLotsize(const OsiLotsize &);
918
920 virtual OsiObject *clone() const;
921
922 // Assignment operator
923 OsiLotsize &operator=(const OsiLotsize &rhs);
924
925 // Destructor
926 virtual ~OsiLotsize();
927
928 using OsiObject::infeasibility;
930 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
931
932 using OsiObject::feasibleRegion;
940 virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const;
941
946 virtual OsiBranchingObject *createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const;
947
949 inline void setColumnNumber(int value)
950 {
951 columnNumber_ = value;
952 }
953
958 virtual int columnNumber() const;
964 virtual void resetBounds(const OsiSolverInterface *solver);
965
969 bool findRange(double value, double integerTolerance) const;
970
973 virtual void floorCeiling(double &floorLotsize, double &ceilingLotsize, double value,
974 double tolerance) const;
975
977 inline double originalLowerBound() const
978 {
979 return bound_[0];
980 }
981 inline double originalUpperBound() const
982 {
983 return bound_[rangeType_ * numberRanges_ - 1];
984 }
986 inline int rangeType() const
987 {
988 return rangeType_;
989 }
991 inline int numberRanges() const
992 {
993 return numberRanges_;
994 }
996 inline double *bound() const
997 {
998 return bound_;
999 }
1002 virtual void resetSequenceEtc(int numberColumns, const int *originalColumns);
1003
1005 virtual double upEstimate() const;
1007 virtual double downEstimate() const;
1009 virtual bool canHandleShadowPrices() const
1010 {
1011 return true;
1012 }
1015 virtual bool canDoHeuristics() const
1016 {
1017 return false;
1018 }
1019
1020 private:
1022
1024 int columnNumber_;
1026 int rangeType_;
1028 int numberRanges_;
1029 // largest gap
1030 double largestGap_;
1032 double *bound_;
1034 mutable int range_;
1035 };
1036
1047 class OsiLotsizeBranchingObject : public OsiTwoWayBranchingObject {
1048
1049 public:
1051 OsiLotsizeBranchingObject();
1052
1060 OsiLotsizeBranchingObject(OsiSolverInterface *solver, const OsiLotsize *originalObject,
1061 int way, double value);
1062
1064 OsiLotsizeBranchingObject(const OsiLotsizeBranchingObject &);
1065
1067 OsiLotsizeBranchingObject &operator=(const OsiLotsizeBranchingObject &rhs);
1068
1070 virtual OsiBranchingObject *clone() const;
1071
1073 virtual ~OsiLotsizeBranchingObject();
1074
1075 using OsiBranchingObject::branch;
1081 virtual double branch(OsiSolverInterface *solver);
1082
1083 using OsiBranchingObject::print;
1086 virtual void print(const OsiSolverInterface *solver = NULL);
1087
1088 protected:
1090 double down_[2];
1092 double up_[2];
1093 };
1094 #endif
1095
1096 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1097 */
OsiBranchingInformation::objective_
const double * objective_
Objective.
Definition: OsiBranchingObject.hpp:480
OsiSOS::resetSequenceEtc
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
CoinError
Error Class thrown by an exception.
Definition: CoinError.hpp:42
OsiObject2::preferredWay_
int preferredWay_
Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Definition: OsiBranchingObject.hpp:260
OsiBranchingObject::boundBranch
virtual bool boundBranch() const
Return true if branch should fix variables.
Definition: OsiBranchingObject.hpp:349
OsiSimpleInteger::operator=
OsiSimpleInteger & operator=(const OsiSimpleInteger &rhs)
Assignment operator.
OsiSOS::operator=
OsiSOS & operator=(const OsiSOS &rhs)
OsiSOS::setNumberMembers
void setNumberMembers(int value)
Set number of members.
Definition: OsiBranchingObject.hpp:825
OsiBranchingInformation::primalTolerance_
double primalTolerance_
Primal tolerance.
Definition: OsiBranchingObject.hpp:458
OsiSimpleInteger::originalUpperBound
double originalUpperBound() const
Definition: OsiBranchingObject.hpp:621
OsiBranchingInformation::stateOfSearch_
int stateOfSearch_
data
Definition: OsiBranchingObject.hpp:448
OsiBranchingObject::originalObject
const OsiObject * originalObject() const
Return pointer back to object which created.
Definition: OsiBranchingObject.hpp:375
OsiLotsizeBranchingObject::OsiLotsizeBranchingObject
OsiLotsizeBranchingObject()
Default constructor.
OsiSimpleInteger::originalLowerBound
double originalLowerBound() const
Original bounds.
Definition: OsiBranchingObject.hpp:613
OsiBranchingInformation::indexRegion_
int * indexRegion_
Useful index region to go with usefulRegion_.
Definition: OsiBranchingObject.hpp:500
OsiSOS::sosType_
int sosType_
SOS type.
Definition: OsiBranchingObject.hpp:859
OsiBranchingObject::incrementNumberBranchesLeft
void incrementNumberBranchesLeft()
Increment the number of branch arms left for this branching object.
Definition: OsiBranchingObject.hpp:316
OsiLotsize::numberRanges
int numberRanges() const
Number of points.
Definition: OsiBranchingObject.hpp:991
OsiTwoWayBranchingObject::firstBranch
int firstBranch() const
Definition: OsiBranchingObject.hpp:545
OsiObject::priority
int priority() const
Return Priority - note 1 is highest priority.
Definition: OsiBranchingObject.hpp:143
OsiLotsize::operator=
OsiLotsize & operator=(const OsiLotsize &rhs)
OsiBranchingInformation::row_
const int * row_
Row indices.
Definition: OsiBranchingObject.hpp:492
OsiSOSBranchingObject
Branching object for Special ordered sets.
Definition: OsiBranchingObject.hpp:867
OsiObject::whichWay_
short whichWay_
Computed preferred way to branch.
Definition: OsiBranchingObject.hpp:222
OsiSOS::setIntegerValued
void setIntegerValued(bool yesNo)
Set whether set is integer valued or not.
Definition: OsiBranchingObject.hpp:815
OsiIntegerBranchingObject::operator=
OsiIntegerBranchingObject & operator=(const OsiIntegerBranchingObject &rhs)
Assignment operator.
CoinTypes.hpp
OsiLotsize::findRange
bool findRange(double value, double integerTolerance) const
Finds range of interest so value is feasible in range range_ or infeasible between hi[range_] and lo[...
OsiObject::priority_
int priority_
Priority.
Definition: OsiBranchingObject.hpp:226
OsiBranchingInformation::direction_
double direction_
Direction 1.0 for minimization, -1.0 for maximization.
Definition: OsiBranchingObject.hpp:454
OsiSOSBranchingObject::OsiSOSBranchingObject
OsiSOSBranchingObject()
OsiIntegerBranchingObject::OsiIntegerBranchingObject
OsiIntegerBranchingObject()
Default constructor.
OsiBranchingInformation
Definition: OsiBranchingObject.hpp:414
OsiBranchingObject::branchIndex_
short branchIndex_
The state of the branching object.
Definition: OsiBranchingObject.hpp:408
OsiObject::updateAfter
virtual void updateAfter(const OsiObject *, const OsiObject *)
Updates stuff like pseudocosts after threads finished.
Definition: OsiBranchingObject.hpp:214
OsiSimpleInteger
Define a single integer class.
Definition: OsiBranchingObject.hpp:558
OsiTwoWayBranchingObject::~OsiTwoWayBranchingObject
virtual ~OsiTwoWayBranchingObject()
Destructor.
OsiSOS::canDoHeuristics
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: OsiBranchingObject.hpp:810
OsiSOS::canHandleShadowPrices
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
Definition: OsiBranchingObject.hpp:820
OsiObject::infeasibility_
double infeasibility_
data
Definition: OsiBranchingObject.hpp:220
OsiSOSBranchingObject::~OsiSOSBranchingObject
virtual ~OsiSOSBranchingObject()
OsiSimpleInteger::columnNumber
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns &gt;= 0 Used by heuristics.
OsiObject::canDoHeuristics
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: OsiBranchingObject.hpp:128
OsiBranchingInformation::clone
virtual OsiBranchingInformation * clone() const
Clone.
OsiSOS::weights_
double * weights_
Weights.
Definition: OsiBranchingObject.hpp:854
OsiBranchingInformation::objectiveValue_
double objectiveValue_
Value of objective function (in minimization sense)
Definition: OsiBranchingObject.hpp:450
OsiLotsizeBranchingObject::up_
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
Definition: OsiBranchingObject.hpp:1092
OsiObject2::~OsiObject2
virtual ~OsiObject2()
Destructor.
OsiLotsizeBranchingObject::down_
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
Definition: OsiBranchingObject.hpp:1090
OsiLotsize::bound_
double * bound_
Ranges.
Definition: OsiBranchingObject.hpp:1032
OsiObject::~OsiObject
virtual ~OsiObject()
Destructor.
OsiObject::canMoveToNearest
virtual bool canMoveToNearest() const
Return true if object can take part in move to nearest heuristic.
Definition: OsiBranchingObject.hpp:134
OsiBranchingObject
Abstract branching object base class.
Definition: OsiBranchingObject.hpp:282
OsiObject::columnNumber
virtual int columnNumber() const
Column number if single column object -1 otherwise, Used by heuristics.
OsiTwoWayBranchingObject::OsiTwoWayBranchingObject
OsiTwoWayBranchingObject()
Default constructor.
OsiLotsize::resetBounds
virtual void resetBounds(const OsiSolverInterface *solver)
Reset original upper and lower bound values from the solver.
OsiSimpleInteger::columnNumber_
int columnNumber_
Column number in solver.
Definition: OsiBranchingObject.hpp:655
OsiSimpleInteger::OsiSimpleInteger
OsiSimpleInteger()
Default Constructor.
OsiBranchingInformation::rowLower_
const double * rowLower_
Pointer to current lower bounds on rows.
Definition: OsiBranchingObject.hpp:482
OsiBranchingObject::decrementNumberBranchesLeft
void decrementNumberBranchesLeft()
Decrement the number of branch arms left for this branching object.
Definition: OsiBranchingObject.hpp:330
OsiBranchingInformation::pi_
const double * pi_
Pointer to duals.
Definition: OsiBranchingObject.hpp:476
OsiLotsize::bound
double * bound() const
Ranges.
Definition: OsiBranchingObject.hpp:996
OsiObject::numberWays
int numberWays() const
Return maximum number of ways branch may have.
Definition: OsiBranchingObject.hpp:164
OsiObject::operator=
OsiObject & operator=(const OsiObject &rhs)
Assignment operator.
OsiLotsize::range_
int range_
Current range.
Definition: OsiBranchingObject.hpp:1034
OsiBranchingInformation::integerTolerance_
double integerTolerance_
Integer tolerance.
Definition: OsiBranchingObject.hpp:456
OsiBranchingObject::value
double value() const
Current value.
Definition: OsiBranchingObject.hpp:369
OsiLotsize::createBranch
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSimpleInteger::originalUpper_
double originalUpper_
Original upper bound.
Definition: OsiBranchingObject.hpp:653
OsiObject::whichWay
int whichWay() const
Return current preferred way to branch.
Definition: OsiBranchingObject.hpp:185
OsiSOSBranchingObject::operator=
OsiSOSBranchingObject & operator=(const OsiSOSBranchingObject &rhs)
OsiSOS
Define Special Ordered Sets of type 1 and 2.
Definition: OsiBranchingObject.hpp:728
OsiIntegerBranchingObject::clone
virtual OsiBranchingObject * clone() const
Clone.
OsiLotsize::columnNumber
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns &gt;= 0 Used by heuristics.
OsiBranchingObject::originalObject_
const OsiObject * originalObject_
Pointer back to object which created.
Definition: OsiBranchingObject.hpp:399
OsiLotsizeBranchingObject::operator=
OsiLotsizeBranchingObject & operator=(const OsiLotsizeBranchingObject &rhs)
Assignment operator.
OsiBranchingObject::OsiBranchingObject
OsiBranchingObject()
Default Constructor.
OsiLotsizeBranchingObject
Lotsize branching object.
Definition: OsiBranchingObject.hpp:1047
OsiBranchingObject::setBranchingIndex
void setBranchingIndex(int branchIndex)
Set the state of the branching object.
Definition: OsiBranchingObject.hpp:363
OsiBranchingObject::operator=
OsiBranchingObject & operator=(const OsiBranchingObject &rhs)
Assignment operator.
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
OsiObject::setNumberWays
void setNumberWays(int numberWays)
Set maximum number of ways branch may have.
Definition: OsiBranchingObject.hpp:169
OsiBranchingInformation::cutoff_
double cutoff_
Value of objective cutoff (in minimization sense)
Definition: OsiBranchingObject.hpp:452
OsiIntegerBranchingObject::down_
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
Definition: OsiBranchingObject.hpp:717
OsiBranchingInformation::solver_
const OsiSolverInterface * solver_
Pointer to solver.
Definition: OsiBranchingObject.hpp:464
OsiBranchingObject::setNumberBranchesLeft
void setNumberBranchesLeft(int)
Set the number of branch arms left for this branching object Just for forcing.
Definition: OsiBranchingObject.hpp:324
OsiBranchingObject::print
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
Definition: OsiBranchingObject.hpp:392
OsiLotsizeBranchingObject::clone
virtual OsiBranchingObject * clone() const
Clone.
OsiObject::boundBranch
virtual bool boundBranch() const
Return true if branch should only bound variables.
Definition: OsiBranchingObject.hpp:154
CoinError.hpp
OsiBranchingObject::numberBranches_
int numberBranches_
Number of branches.
Definition: OsiBranchingObject.hpp:403
OsiIntegerBranchingObject::up_
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
Definition: OsiBranchingObject.hpp:719
OsiLotsize::columnNumber_
int columnNumber_
data
Definition: OsiBranchingObject.hpp:1024
OsiLotsize::feasibleRegion
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to contain the current solution.
OsiSimpleInteger::setOriginalUpperBound
void setOriginalUpperBound(double value)
Definition: OsiBranchingObject.hpp:625
OsiSOS::setSosType
void setSosType(int value)
Set SOS type.
Definition: OsiBranchingObject.hpp:837
OsiSimpleInteger::~OsiSimpleInteger
virtual ~OsiSimpleInteger()
Destructor.
OsiBranchingInformation::OsiBranchingInformation
OsiBranchingInformation()
Default Constructor.
OsiBranchingInformation::lower_
const double * lower_
Pointer to current lower bounds on columns.
Definition: OsiBranchingObject.hpp:468
OsiSOSBranchingObject::print
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
OsiObject::infeasibility
double infeasibility() const
Return infeasibility.
Definition: OsiBranchingObject.hpp:195
OsiObject::clone
virtual OsiObject * clone() const =0
Clone.
OsiObject::canHandleShadowPrices
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
Definition: OsiBranchingObject.hpp:159
OsiObject2::preferredWay
virtual int preferredWay() const
Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Definition: OsiBranchingObject.hpp:253
OsiObject2::OsiObject2
OsiObject2()
Default Constructor.
OsiBranchingInformation::numberColumns_
int numberColumns_
The number of columns.
Definition: OsiBranchingObject.hpp:466
OsiLotsize
Lotsize class.
Definition: OsiBranchingObject.hpp:904
OsiBranchingObject::~OsiBranchingObject
virtual ~OsiBranchingObject()
Destructor.
OsiLotsize::~OsiLotsize
virtual ~OsiLotsize()
OsiSimpleInteger::downEstimate
virtual double downEstimate() const
Return &quot;down&quot; estimate (default 1.0e-5)
OsiObject2::otherInfeasibility_
double otherInfeasibility_
&quot;Infeasibility&quot; on other way
Definition: OsiBranchingObject.hpp:262
OsiSOS::numberMembers
int numberMembers() const
Number of members.
Definition: OsiBranchingObject.hpp:779
OsiObject::feasibleRegion
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...
OsiObject::resetBounds
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
Definition: OsiBranchingObject.hpp:207
OsiSimpleInteger::canHandleShadowPrices
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
Definition: OsiBranchingObject.hpp:643
OsiBranchingInformation::solution_
const double * solution_
Pointer to current solution.
Definition: OsiBranchingObject.hpp:470
OsiLotsize::downEstimate
virtual double downEstimate() const
Return &quot;down&quot; estimate (default 1.0e-5)
OsiLotsize::originalUpperBound
double originalUpperBound() const
Definition: OsiBranchingObject.hpp:981
OsiObject::numberWays_
short numberWays_
Maximum number of ways on branch.
Definition: OsiBranchingObject.hpp:224
OsiObject::updateBefore
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
Definition: OsiBranchingObject.hpp:212
OsiSOS::downEstimate
virtual double downEstimate() const
Return &quot;down&quot; estimate (default 1.0e-5)
OsiBranchingInformation::elementByColumn_
const double * elementByColumn_
Elements in column copy of matrix.
Definition: OsiBranchingObject.hpp:486
OsiBranchingObject::setOriginalObject
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
Definition: OsiBranchingObject.hpp:380
OsiObject::downEstimate
virtual double downEstimate() const
Return &quot;down&quot; estimate (default 1.0e-5)
OsiBranchingInformation::columnLength_
const int * columnLength_
Column lengths.
Definition: OsiBranchingObject.hpp:490
OsiLotsize::clone
virtual OsiObject * clone() const
Clone.
OsiSOSBranchingObject::clone
virtual OsiBranchingObject * clone() const
Clone.
OsiLotsizeBranchingObject::~OsiLotsizeBranchingObject
virtual ~OsiLotsizeBranchingObject()
Destructor.
OsiTwoWayBranchingObject::operator=
OsiTwoWayBranchingObject & operator=(const OsiTwoWayBranchingObject &rhs)
Assignment operator.
OsiSOS::sosType
int sosType() const
SOS type.
Definition: OsiBranchingObject.hpp:791
OsiObject::createBranch
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
Create a branching object and indicate which way to branch first.
Definition: OsiBranchingObject.hpp:118
OsiLotsize::canHandleShadowPrices
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
Definition: OsiBranchingObject.hpp:1009
OsiSOS::members_
int * members_
data
Definition: OsiBranchingObject.hpp:852
OsiSimpleInteger::resetBounds
virtual void resetBounds(const OsiSolverInterface *solver)
Reset variable bounds to their original values.
OsiLotsize::upEstimate
virtual double upEstimate() const
Return &quot;up&quot; estimate (default 1.0e-5)
OsiBranchingInformation::numberBranchingSolutions_
int numberBranchingSolutions_
Number of branching solutions found (i.e. exclude heuristics)
Definition: OsiBranchingObject.hpp:504
OsiSimpleInteger::setOriginalLowerBound
void setOriginalLowerBound(double value)
Definition: OsiBranchingObject.hpp:617
OsiBranchingObject::numberBranchesLeft
int numberBranchesLeft() const
The number of branch arms left for this branching object.
Definition: OsiBranchingObject.hpp:310
OsiIntegerBranchingObject
Simple branching object for an integer variable.
Definition: OsiBranchingObject.hpp:664
OsiBranchingInformation::rowActivity_
const double * rowActivity_
Pointer to row activity.
Definition: OsiBranchingObject.hpp:478
OsiIntegerBranchingObject::print
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
OsiBranchingObject::columnNumber
int columnNumber() const
For debug.
OsiBranchingInformation::usefulRegion_
double * usefulRegion_
Useful region of length CoinMax(numberColumns,2*numberRows) This is allocated and deleted before OsiO...
Definition: OsiBranchingObject.hpp:498
OsiObject2
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
Definition: OsiBranchingObject.hpp:231
OsiBranchingInformation::columnStart_
const CoinBigIndex * columnStart_
Column starts.
Definition: OsiBranchingObject.hpp:488
OsiObject::checkInfeasibility
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
OsiLotsize::largestGap_
double largestGap_
Definition: OsiBranchingObject.hpp:1030
OsiBranchingInformation::defaultDual_
double defaultDual_
Dual to use if row bound violated (if negative then pseudoShadowPrices off)
Definition: OsiBranchingObject.hpp:462
OsiLotsize::originalLowerBound
double originalLowerBound() const
Original bounds.
Definition: OsiBranchingObject.hpp:977
OsiSimpleInteger::feasibleRegion
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
OsiBranchingInformation::upper_
const double * upper_
Pointer to current upper bounds on columns.
Definition: OsiBranchingObject.hpp:472
OsiSOS::createBranch
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSimpleInteger::originalLower_
double originalLower_
data Original lower bound
Definition: OsiBranchingObject.hpp:651
OsiBranchingInformation::owningSolution_
bool owningSolution_
TEMP.
Definition: OsiBranchingObject.hpp:508
OsiLotsizeBranchingObject::print
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
OsiSOS::feasibleRegion
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
OsiSimpleInteger::resetSequenceEtc
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
OsiSimpleInteger::upEstimate
virtual double upEstimate() const
Return &quot;up&quot; estimate (default 1.0e-5)
OsiSimpleInteger::setColumnNumber
void setColumnNumber(int value)
Set solver column number.
Definition: OsiBranchingObject.hpp:601
OsiObject2::setPreferredWay
void setPreferredWay(int value)
Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Definition: OsiBranchingObject.hpp:247
OsiLotsize::floorCeiling
virtual void floorCeiling(double &floorLotsize, double &ceilingLotsize, double value, double tolerance) const
Returns floor and ceiling.
OsiSimpleInteger::createBranch
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSOS::mutableWeights
double * mutableWeights() const
Array of weights.
Definition: OsiBranchingObject.hpp:843
OsiLotsize::resetSequenceEtc
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
OsiBranchingInformation::timeRemaining_
double timeRemaining_
Maximum time remaining before stopping on time.
Definition: OsiBranchingObject.hpp:460
OsiBranchingObject::branchIndex
int branchIndex() const
Get the state of the branching object This is just the branch index.
Definition: OsiBranchingObject.hpp:356
OsiLotsize::rangeType
int rangeType() const
Type - 1 points, 2 ranges.
Definition: OsiBranchingObject.hpp:986
OsiSOS::members
const int * members() const
Members (indices in range 0 ... numberColumns-1)
Definition: OsiBranchingObject.hpp:785
OsiBranchingInformation::numberSolutions_
int numberSolutions_
Number of solutions found.
Definition: OsiBranchingObject.hpp:502
OsiSOS::mutableMembers
int * mutableMembers() const
Members (indices in range 0 ... numberColumns-1)
Definition: OsiBranchingObject.hpp:831
OsiLotsize::OsiLotsize
OsiLotsize()
OsiLotsize::canDoHeuristics
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
Definition: OsiBranchingObject.hpp:1015
OsiSimpleInteger::clone
virtual OsiObject * clone() const
Clone.
OsiSOS::weights
const double * weights() const
Array of weights.
Definition: OsiBranchingObject.hpp:803
OsiObject::setPriority
void setPriority(int priority)
Set priority.
Definition: OsiBranchingObject.hpp:148
OsiSOS::upEstimate
virtual double upEstimate() const
Return &quot;up&quot; estimate (default 1.0e-5)
OsiBranchingObject::checkIsCutoff
virtual void checkIsCutoff(double)
Double checks in case node can change its mind! Returns objective value Can change objective etc...
Definition: OsiBranchingObject.hpp:387
OsiBranchingInformation::rowUpper_
const double * rowUpper_
Pointer to current upper bounds on rows.
Definition: OsiBranchingObject.hpp:484
OsiBranchingInformation::hotstartSolution_
const double * hotstartSolution_
Highly optional target (hot start) solution.
Definition: OsiBranchingObject.hpp:474
OsiObject::resetSequenceEtc
virtual void resetSequenceEtc(int, const int *)
Change column numbers after preprocessing.
Definition: OsiBranchingObject.hpp:210
OsiLotsize::numberRanges_
int numberRanges_
Number of points.
Definition: OsiBranchingObject.hpp:1028
OsiIntegerBranchingObject::~OsiIntegerBranchingObject
virtual ~OsiIntegerBranchingObject()
Destructor.
OsiSOS::~OsiSOS
virtual ~OsiSOS()
OsiSolverBranch
Solver Branch Class.
Definition: OsiSolverBranch.hpp:18
OsiLotsize::rangeType_
int rangeType_
Type - 1 points, 2 ranges.
Definition: OsiBranchingObject.hpp:1026
OsiSOS::OsiSOS
OsiSOS()
OsiBranchingInformation::depth_
int depth_
Depth in tree.
Definition: OsiBranchingObject.hpp:506
OsiTwoWayBranchingObject::way
int way() const
Way returns -1 on down +1 on up.
Definition: OsiBranchingObject.hpp:547
OsiObject
Abstract base class for `objects&#39;.
Definition: OsiBranchingObject.hpp:56
OsiBranchingObject::branch
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object...
Definition: OsiBranchingObject.hpp:346
OsiBranchingObject::numberBranches
int numberBranches() const
The number of branch arms created for this branching object.
Definition: OsiBranchingObject.hpp:304
OsiBranchingInformation::~OsiBranchingInformation
virtual ~OsiBranchingInformation()
Destructor.
OsiSOS::clone
virtual OsiObject * clone() const
Clone.
OsiBranchingObject::clone
virtual OsiBranchingObject * clone() const =0
Clone.
OsiSOS::integerValued_
bool integerValued_
Whether integer valued.
Definition: OsiBranchingObject.hpp:861
OsiBranchingInformation::operator=
OsiBranchingInformation & operator=(const OsiBranchingInformation &rhs)
Assignment operator.
OsiLotsize::setColumnNumber
void setColumnNumber(int value)
Set solver column number.
Definition: OsiBranchingObject.hpp:949
OsiObject::upEstimate
virtual double upEstimate() const
Return &quot;up&quot; estimate (default 1.0e-5)
OsiObject2::operator=
OsiObject2 & operator=(const OsiObject2 &rhs)
Assignment operator.
OsiObject::preferredWay
virtual int preferredWay() const
Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Definition: OsiBranchingObject.hpp:190
OsiSOS::numberMembers_
int numberMembers_
Number of members.
Definition: OsiBranchingObject.hpp:857
OsiTwoWayBranchingObject::firstBranch_
int firstBranch_
Which way was first branch -1 = down, +1 = up.
Definition: OsiBranchingObject.hpp:554
OsiSOS::setType
int setType() const
SOS type.
Definition: OsiBranchingObject.hpp:797
OsiBranchingObject::value_
double value_
Current value - has some meaning about branch.
Definition: OsiBranchingObject.hpp:396
OsiTwoWayBranchingObject
This just adds two-wayness to a branching object.
Definition: OsiBranchingObject.hpp:513
OsiObject::setWhichWay
void setWhichWay(int way)
Return preferred way to branch.
Definition: OsiBranchingObject.hpp:177
OsiObject::OsiObject
OsiObject()
Default Constructor.