Osi 0.108.9
Loading...
Searching...
No Matches
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
16class OsiSolverBranch;
17
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
56class OsiObject {
57
58public:
61
64
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
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 {
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
216protected:
218
220 mutable double infeasibility_;
222 mutable short whichWay_;
227};
230
231class OsiObject2 : public OsiObject {
232
233public:
236
239
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
258protected:
262 mutable double otherInfeasibility_;
263};
264
283
284public:
287
290
293
296
298 virtual OsiBranchingObject *clone() const = 0;
299
302
304 inline int numberBranches() const
305 {
306 return numberBranches_;
307 }
308
310 inline int numberBranchesLeft() const
311 {
313 }
314
317 {
319 }
320
324 inline void setNumberBranchesLeft(int /*value*/)
325 { /*assert (value==1&&!branchIndex_);*/
326 numberBranches_ = 1;
327 }
328
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
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
394protected:
396 double value_;
397
400
404
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*/
415
416public:
419
424 OsiBranchingInformation(const OsiSolverInterface *solver, bool normalSolver, bool copySolution = false);
425
428
431
434
437
438 // Note public
439public:
441
452 double cutoff_;
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_;
509};
510
512
514
515public:
518
526 int way, double value);
527
530
533
536
543 virtual double branch(OsiSolverInterface *solver) = 0;
544
545 inline int firstBranch() const { return firstBranch_; }
547 inline int way() const
548 {
550 }
551
552protected:
555};
557
559
560public:
563
565 OsiSimpleInteger(const OsiSolverInterface *solver, int iColumn);
566
568 OsiSimpleInteger(int iColumn, double lower, double upper);
569
572
574 virtual OsiObject *clone() const;
575
578
581
584 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
585
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
648protected:
656};
665
666public:
669
678 int way, double value);
687 int way, double value, double downUpperBound, double upLowerBound);
688
691
694
696 virtual OsiBranchingObject *clone() const;
697
700
707 virtual double branch(OsiSolverInterface *solver);
708
712 virtual void print(const OsiSolverInterface *solver = NULL);
713
714protected:
715 // Probably could get away with just value which is already stored
717 double down_[2];
719 double up_[2];
720};
721
728class OsiSOS : public OsiObject2 {
729
730public:
731 // Default Constructor
733
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
755 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
756
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
848protected:
850
854 double *weights_;
855
862};
863
868
869public:
870 // Default Constructor
872
873 // Useful constructor
875 int way,
876 double separator);
877
878 // Copy constructor
880
881 // Assignment operator
883
885 virtual OsiBranchingObject *clone() const;
886
887 // Destructor
889
892 virtual double branch(OsiSolverInterface *solver);
893
897 virtual void print(const OsiSolverInterface *solver = NULL);
898
899private:
901};
904class OsiLotsize : public OsiObject2 {
905
906public:
907 // Default Constructor
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
918
920 virtual OsiObject *clone() const;
921
922 // Assignment operator
924
925 // Destructor
926 virtual ~OsiLotsize();
927
930 virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const;
931
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
1020private:
1022
1029 // largest gap
1032 double *bound_;
1034 mutable int range_;
1035};
1036
1048
1049public:
1052
1061 int way, double value);
1062
1065
1068
1070 virtual OsiBranchingObject *clone() const;
1071
1074
1081 virtual double branch(OsiSolverInterface *solver);
1082
1086 virtual void print(const OsiSolverInterface *solver = NULL);
1087
1088protected:
1090 double down_[2];
1092 double up_[2];
1093};
1094#endif
1095
1096/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1097*/
int numberBranchingSolutions_
Number of branching solutions found (i.e. exclude heuristics)
OsiBranchingInformation(const OsiBranchingInformation &)
Copy constructor.
double objectiveValue_
Value of objective function (in minimization sense)
double defaultDual_
Dual to use if row bound violated (if negative then pseudoShadowPrices off)
const double * rowLower_
Pointer to current lower bounds on rows.
double primalTolerance_
Primal tolerance.
const double * solution_
Pointer to current solution.
const double * pi_
Pointer to duals.
OsiBranchingInformation & operator=(const OsiBranchingInformation &rhs)
Assignment operator.
const int * row_
Row indices.
const CoinBigIndex * columnStart_
Column starts.
const double * elementByColumn_
Elements in column copy of matrix.
const OsiSolverInterface * solver_
Pointer to solver.
const double * objective_
Objective.
const double * rowActivity_
Pointer to row activity.
double * usefulRegion_
Useful region of length CoinMax(numberColumns,2*numberRows) This is allocated and deleted before OsiO...
const double * hotstartSolution_
Highly optional target (hot start) solution.
OsiBranchingInformation(const OsiSolverInterface *solver, bool normalSolver, bool copySolution=false)
Useful Constructor (normalSolver true if has matrix etc etc) copySolution true if constructot should ...
int * indexRegion_
Useful index region to go with usefulRegion_.
OsiBranchingInformation()
Default Constructor.
double direction_
Direction 1.0 for minimization, -1.0 for maximization.
int numberColumns_
The number of columns.
const int * columnLength_
Column lengths.
virtual OsiBranchingInformation * clone() const
Clone.
virtual ~OsiBranchingInformation()
Destructor.
double timeRemaining_
Maximum time remaining before stopping on time.
const double * upper_
Pointer to current upper bounds on columns.
int numberSolutions_
Number of solutions found.
double cutoff_
Value of objective cutoff (in minimization sense)
const double * rowUpper_
Pointer to current upper bounds on rows.
const double * lower_
Pointer to current lower bounds on columns.
double integerTolerance_
Integer tolerance.
Abstract branching object base class.
void setOriginalObject(const OsiObject *object)
Set pointer back to object which created.
OsiBranchingObject()
Default Constructor.
virtual double branch(OsiSolverInterface *solver)=0
Execute the actions required to branch, as specified by the current state of the branching object,...
virtual double branch()
Execute the actions required to branch, as specified by the current state of the branching object,...
void setNumberBranchesLeft(int)
Set the number of branch arms left for this branching object Just for forcing.
int numberBranchesLeft() const
The number of branch arms left for this branching object.
virtual bool boundBranch() const
Return true if branch should fix variables.
virtual ~OsiBranchingObject()
Destructor.
int branchIndex() const
Get the state of the branching object This is just the branch index.
OsiBranchingObject(const OsiBranchingObject &)
Copy constructor.
void decrementNumberBranchesLeft()
Decrement the number of branch arms left for this branching object.
int columnNumber() const
For debug.
const OsiObject * originalObject_
Pointer back to object which created.
virtual OsiBranchingObject * clone() const =0
Clone.
int numberBranches() const
The number of branch arms created for this branching object.
OsiBranchingObject(OsiSolverInterface *solver, double value)
Constructor.
double value() const
Current value.
OsiBranchingObject & operator=(const OsiBranchingObject &rhs)
Assignment operator.
int numberBranches_
Number of branches.
double value_
Current value - has some meaning about branch.
short branchIndex_
The state of the branching object.
void setBranchingIndex(int branchIndex)
Set the state of the branching object.
void incrementNumberBranchesLeft()
Increment the number of branch arms left for this branching object.
const OsiObject * originalObject() const
Return pointer back to object which created.
virtual void print(const OsiSolverInterface *=NULL) const
Print something about branch - only if log level high.
virtual void checkIsCutoff(double)
Double checks in case node can change its mind! Returns objective value Can change objective etc.
Simple branching object for an integer variable.
OsiIntegerBranchingObject(OsiSolverInterface *solver, const OsiSimpleInteger *originalObject, int way, double value)
Create a standard floor/ceiling branch object.
virtual ~OsiIntegerBranchingObject()
Destructor.
virtual OsiBranchingObject * clone() const
Clone.
OsiIntegerBranchingObject(OsiSolverInterface *solver, const OsiSimpleInteger *originalObject, int way, double value, double downUpperBound, double upLowerBound)
Create a standard floor/ceiling branch object.
OsiIntegerBranchingObject()
Default constructor.
OsiIntegerBranchingObject & operator=(const OsiIntegerBranchingObject &rhs)
Assignment operator.
OsiIntegerBranchingObject(const OsiIntegerBranchingObject &)
Copy constructor.
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
virtual double branch(OsiSolverInterface *solver)
Sets the bounds for the variable according to the current arm of the branch and advances the object s...
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
Lotsize branching object.
OsiLotsizeBranchingObject(OsiSolverInterface *solver, const OsiLotsize *originalObject, int way, double value)
Create a lotsize floor/ceiling branch object.
virtual ~OsiLotsizeBranchingObject()
Destructor.
OsiLotsizeBranchingObject()
Default constructor.
OsiLotsizeBranchingObject & operator=(const OsiLotsizeBranchingObject &rhs)
Assignment operator.
double down_[2]
Lower [0] and upper [1] bounds for the down arm (way_ = -1)
OsiLotsizeBranchingObject(const OsiLotsizeBranchingObject &)
Copy constructor.
virtual void print(const OsiSolverInterface *solver=NULL)
Print something about branch - only if log level high.
double up_[2]
Lower [0] and upper [1] bounds for the up arm (way_ = 1)
virtual OsiBranchingObject * clone() const
Clone.
virtual double branch(OsiSolverInterface *solver)
Sets the bounds for the variable according to the current arm of the branch and advances the object s...
Lotsize class.
double originalLowerBound() const
Original bounds.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
OsiLotsize & operator=(const OsiLotsize &rhs)
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
double originalUpperBound() const
virtual void resetBounds(const OsiSolverInterface *solver)
Reset original upper and lower bound values from the solver.
virtual void floorCeiling(double &floorLotsize, double &ceilingLotsize, double value, double tolerance) const
Returns floor and ceiling.
OsiLotsize(const OsiSolverInterface *solver, int iColumn, int numberPoints, const double *points, bool range=false)
int rangeType() const
Type - 1 points, 2 ranges.
void setColumnNumber(int value)
Set solver column number.
int rangeType_
Type - 1 points, 2 ranges.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to contain the current solution.
OsiLotsize(const OsiLotsize &)
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
virtual ~OsiLotsize()
double * bound_
Ranges.
int numberRanges() const
Number of points.
int numberRanges_
Number of points.
virtual OsiObject * clone() const
Clone.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
int range_
Current range.
double * bound() const
Ranges.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
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[...
Define a class to add a bit of complexity to OsiObject This assumes 2 way branching.
virtual int preferredWay() const
Get preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
double otherInfeasibility_
"Infeasibility" on other way
int preferredWay_
Preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual ~OsiObject2()
Destructor.
OsiObject2 & operator=(const OsiObject2 &rhs)
Assignment operator.
OsiObject2()
Default Constructor.
OsiObject2(const OsiObject2 &)
Copy constructor.
void setPreferredWay(int value)
Set preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
Abstract base class for ‘objects’.
double infeasibility() const
Return infeasibility.
virtual bool canMoveToNearest() const
Return true if object can take part in move to nearest heuristic.
double infeasibility_
data
virtual OsiObject * clone() const =0
Clone.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual void updateAfter(const OsiObject *, const OsiObject *)
Updates stuff like pseudocosts after threads finished.
int numberWays() const
Return maximum number of ways branch may have.
short numberWays_
Maximum number of ways on branch.
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
short whichWay_
Computed preferred way to branch.
virtual void resetSequenceEtc(int, const int *)
Change column numbers after preprocessing.
virtual void updateBefore(const OsiObject *)
Updates stuff like pseudocosts before threads.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const =0
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
Create a branching object and indicate which way to branch first.
double infeasibility(const OsiSolverInterface *solver, int &whichWay) const
Infeasibility of the object.
int priority_
Priority.
virtual void resetBounds(const OsiSolverInterface *)
Reset variable bounds to their original values.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
OsiObject(const OsiObject &)
Copy constructor.
int whichWay() const
Return current preferred way to branch.
void setPriority(int priority)
Set priority.
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...
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
void setWhichWay(int way)
Return preferred way to branch.
virtual ~OsiObject()
Destructor.
virtual int preferredWay() const
Get pre-emptive preferred way of branching - -1 off, 0 down, 1 up (for 2-way)
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
void setNumberWays(int numberWays)
Set maximum number of ways branch may have.
OsiObject & operator=(const OsiObject &rhs)
Assignment operator.
OsiObject()
Default Constructor.
int priority() const
Return Priority - note 1 is highest priority.
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const =0
For the variable(s) referenced by the object, look at the current solution and set bounds to match th...
virtual int columnNumber() const
Column number if single column object -1 otherwise, Used by heuristics.
virtual bool boundBranch() const
Return true if branch should only bound variables.
Branching object for Special ordered sets.
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.
virtual OsiBranchingObject * clone() const
Clone.
OsiSOSBranchingObject & operator=(const OsiSOSBranchingObject &rhs)
OsiSOSBranchingObject(const OsiSOSBranchingObject &)
virtual ~OsiSOSBranchingObject()
OsiSOSBranchingObject(OsiSolverInterface *solver, const OsiSOS *originalObject, int way, double separator)
Define Special Ordered Sets of type 1 and 2.
double * weights_
Weights.
int setType() const
SOS type.
OsiSOS & operator=(const OsiSOS &rhs)
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
const int * members() const
Members (indices in range 0 ... numberColumns-1)
OsiSOS(const OsiSOS &)
double * mutableWeights() const
Array of weights.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Redoes data when sequence numbers change.
int sosType() const
SOS type.
virtual bool canDoHeuristics() const
Return true if object can take part in normal heuristics.
void setNumberMembers(int value)
Set number of members.
virtual OsiObject * clone() const
Clone.
void setIntegerValued(bool yesNo)
Set whether set is integer valued or not.
int * members_
data
int * mutableMembers() const
Members (indices in range 0 ... numberColumns-1)
bool integerValued_
Whether integer valued.
const double * weights() const
Array of weights.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
virtual ~OsiSOS()
int sosType_
SOS type.
void setSosType(int value)
Set SOS type.
int numberMembers() const
Number of members.
int numberMembers_
Number of members.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSOS(const OsiSolverInterface *solver, int numberMembers, const int *which, const double *weights, int type=1)
Useful constructor - which are indices and weights are also given.
Define a single integer class.
virtual OsiObject * clone() const
Clone.
virtual void resetSequenceEtc(int numberColumns, const int *originalColumns)
Change column numbers after preprocessing.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way) const
Creates a branching object.
OsiSimpleInteger(int iColumn, double lower, double upper)
Useful constructor - passed solver index and original bounds.
int columnNumber_
Column number in solver.
virtual double upEstimate() const
Return "up" estimate (default 1.0e-5)
virtual int columnNumber() const
Column number if single column object -1 otherwise, so returns >= 0 Used by heuristics.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
void setOriginalUpperBound(double value)
virtual double feasibleRegion(OsiSolverInterface *solver, const OsiBranchingInformation *info) const
Set bounds to fix the variable at the current (integer) value.
double originalUpperBound() const
virtual void resetBounds(const OsiSolverInterface *solver)
Reset variable bounds to their original values.
virtual ~OsiSimpleInteger()
Destructor.
double originalLowerBound() const
Original bounds.
OsiSimpleInteger(const OsiSimpleInteger &)
Copy constructor.
virtual double infeasibility(const OsiBranchingInformation *info, int &whichWay) const
Infeasibility - large is 0.5.
void setOriginalLowerBound(double value)
double originalUpper_
Original upper bound.
OsiSimpleInteger & operator=(const OsiSimpleInteger &rhs)
Assignment operator.
void setColumnNumber(int value)
Set solver column number.
virtual bool canHandleShadowPrices() const
Return true if knows how to deal with Pseudo Shadow Prices.
double originalLower_
data Original lower bound
OsiSimpleInteger(const OsiSolverInterface *solver, int iColumn)
Useful constructor - passed solver index.
OsiSimpleInteger()
Default Constructor.
Solver Branch Class.
Abstract Base Class for describing an interface to a solver.
This just adds two-wayness to a branching object.
OsiTwoWayBranchingObject()
Default constructor.
OsiTwoWayBranchingObject(const OsiTwoWayBranchingObject &)
Copy constructor.
int firstBranch_
Which way was first branch -1 = down, +1 = up.
int way() const
Way returns -1 on down +1 on up.
virtual double branch(OsiSolverInterface *solver)=0
Sets the bounds for the variable according to the current arm of the branch and advances the object s...
virtual ~OsiTwoWayBranchingObject()
Destructor.
OsiTwoWayBranchingObject(OsiSolverInterface *solver, const OsiObject *originalObject, int way, double value)
Create a standard tw0-way branch object.
OsiTwoWayBranchingObject & operator=(const OsiTwoWayBranchingObject &rhs)
Assignment operator.