Go to the documentation of this file.00001
00002
00003
00004 #ifndef CbcBranchBase_H
00005 #define CbcBranchBase_H
00006
00007 #include <string>
00008 #include <vector>
00009 #include "OsiBranchingObject.hpp"
00010
00011 enum CbcRangeCompare {
00012 CbcRangeSame,
00013 CbcRangeDisjoint,
00014 CbcRangeSubset,
00015 CbcRangeSuperset,
00016 CbcRangeOverlap
00017 };
00018
00019 #include "CbcObject.hpp"
00020 #include "CbcBranchingObject.hpp"
00021 #include "CbcBranchDecision.hpp"
00022 #include "CbcConsequence.hpp"
00023 #include "CbcObjectUpdateData.hpp"
00024
00025
00026
00033 static inline CbcRangeCompare
00034 CbcCompareRanges(double* thisBd, const double* otherBd,
00035 const bool replaceIfOverlap)
00036 {
00037 const double lbDiff = thisBd[0] - otherBd[0];
00038 if (lbDiff < 0) {
00039 if (thisBd[1] >= otherBd[1]) {
00040 return CbcRangeSuperset;
00041 } else if (thisBd[1] < otherBd[0]) {
00042 return CbcRangeDisjoint;
00043 } else {
00044
00045 if (replaceIfOverlap) {
00046 thisBd[0] = otherBd[0];
00047 }
00048 return CbcRangeOverlap;
00049 }
00050 } else if (lbDiff > 0) {
00051 if (thisBd[1] <= otherBd[1]) {
00052 return CbcRangeSubset;
00053 } else if (thisBd[0] > otherBd[1]) {
00054 return CbcRangeDisjoint;
00055 } else {
00056
00057 if (replaceIfOverlap) {
00058 thisBd[1] = otherBd[1];
00059 }
00060 return CbcRangeOverlap;
00061 }
00062 } else {
00063 if (thisBd[1] == otherBd[1]) {
00064 return CbcRangeSame;
00065 }
00066 return thisBd[1] < otherBd[1] ? CbcRangeSubset : CbcRangeSuperset;
00067 }
00068
00069 return CbcRangeSame;
00070
00071 }
00072
00073
00074
00075 #endif
00076