00001
00002
00003
00004
00005
00006 #ifndef CbcTreeLocal_H
00007 #define CbcTreeLocal_H
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "CbcTree.hpp"
00035 #include "CbcNode.hpp"
00036 #include "OsiRowCut.hpp"
00037 class CbcModel;
00038
00039
00040 class CbcTreeLocal : public CbcTree {
00041
00042 public:
00043
00044
00045 CbcTreeLocal ();
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CbcTreeLocal (CbcModel * model, const double * solution , int range = 10,
00061 int typeCuts = 0, int maxDiversification = 0,
00062 int timeLimit = 1000000, int nodeLimit = 1000000, bool refine = true);
00063
00064 CbcTreeLocal ( const CbcTreeLocal & rhs);
00065
00066
00067 CbcTreeLocal & operator=(const CbcTreeLocal & rhs);
00068
00069 virtual ~CbcTreeLocal();
00070
00072 virtual CbcTree * clone() const;
00074 virtual void generateCpp( FILE * fp) ;
00075
00078
00080 virtual CbcNode * top() const;
00081
00083 virtual void push(CbcNode * x);
00084
00086 virtual void pop() ;
00087
00089
00091
00093 int createCut(const double * solution, OsiRowCut & cut);
00094
00096 virtual bool empty() ;
00097
00099 virtual void endSearch() ;
00101 void reverseCut(int state, double bias = 0.0);
00103 void deleteCut(OsiRowCut & cut);
00105 void passInSolution(const double * solution, double solutionValue);
00106
00107 inline int range() const {
00108 return range_;
00109 }
00110
00111 inline void setRange(int value) {
00112 range_ = value;
00113 }
00114
00115 inline int typeCuts() const {
00116 return typeCuts_;
00117 }
00118
00119 inline void setTypeCuts(int value) {
00120 typeCuts_ = value;
00121 }
00122
00123 inline int maxDiversification() const {
00124 return maxDiversification_;
00125 }
00126
00127 inline void setMaxDiversification(int value) {
00128 maxDiversification_ = value;
00129 }
00130
00131 inline int timeLimit() const {
00132 return timeLimit_;
00133 }
00134
00135 inline void setTimeLimit(int value) {
00136 timeLimit_ = value;
00137 }
00138
00139 inline int nodeLimit() const {
00140 return nodeLimit_;
00141 }
00142
00143 inline void setNodeLimit(int value) {
00144 nodeLimit_ = value;
00145 }
00146
00147 inline bool refine() const {
00148 return refine_;
00149 }
00150
00151 inline void setRefine(bool yesNo) {
00152 refine_ = yesNo;
00153 }
00154
00156 private:
00157
00158 CbcNode * localNode_;
00159
00160 double * bestSolution_;
00161
00162 double * savedSolution_;
00163
00164 int saveNumberSolutions_;
00165
00166 OsiRowCut cut_;
00167
00168 OsiRowCut fixedCut_;
00169
00170 CbcModel * model_;
00171
00172 double * originalLower_;
00173
00174 double * originalUpper_;
00175
00176 int range_;
00177
00178 int typeCuts_;
00179
00180 int maxDiversification_;
00181
00182 int diversification_;
00183
00184 bool nextStrong_;
00185
00186 double rhs_;
00187
00188 double savedGap_;
00189
00190 double bestCutoff_;
00191
00192 int timeLimit_;
00193
00194 int startTime_;
00195
00196 int nodeLimit_;
00197
00198 int startNode_;
00199
00200 int searchType_;
00201
00202 bool refine_;
00203
00204 };
00205
00206 class CbcTreeVariable : public CbcTree {
00207
00208 public:
00209
00210
00211 CbcTreeVariable ();
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226 CbcTreeVariable (CbcModel * model, const double * solution , int range = 10,
00227 int typeCuts = 0, int maxDiversification = 0,
00228 int timeLimit = 1000000, int nodeLimit = 1000000, bool refine = true);
00229
00230 CbcTreeVariable ( const CbcTreeVariable & rhs);
00231
00232
00233 CbcTreeVariable & operator=(const CbcTreeVariable & rhs);
00234
00235 virtual ~CbcTreeVariable();
00236
00238 virtual CbcTree * clone() const;
00240 virtual void generateCpp( FILE * fp) ;
00241
00244
00246 virtual CbcNode * top() const;
00247
00249 virtual void push(CbcNode * x);
00250
00252 virtual void pop() ;
00253
00255
00257
00259 int createCut(const double * solution, OsiRowCut & cut);
00260
00262 virtual bool empty() ;
00263
00265 virtual void endSearch() ;
00267 void reverseCut(int state, double bias = 0.0);
00269 void deleteCut(OsiRowCut & cut);
00271 void passInSolution(const double * solution, double solutionValue);
00272
00273 inline int range() const {
00274 return range_;
00275 }
00276
00277 inline void setRange(int value) {
00278 range_ = value;
00279 }
00280
00281 inline int typeCuts() const {
00282 return typeCuts_;
00283 }
00284
00285 inline void setTypeCuts(int value) {
00286 typeCuts_ = value;
00287 }
00288
00289 inline int maxDiversification() const {
00290 return maxDiversification_;
00291 }
00292
00293 inline void setMaxDiversification(int value) {
00294 maxDiversification_ = value;
00295 }
00296
00297 inline int timeLimit() const {
00298 return timeLimit_;
00299 }
00300
00301 inline void setTimeLimit(int value) {
00302 timeLimit_ = value;
00303 }
00304
00305 inline int nodeLimit() const {
00306 return nodeLimit_;
00307 }
00308
00309 inline void setNodeLimit(int value) {
00310 nodeLimit_ = value;
00311 }
00312
00313 inline bool refine() const {
00314 return refine_;
00315 }
00316
00317 inline void setRefine(bool yesNo) {
00318 refine_ = yesNo;
00319 }
00320
00322 private:
00323
00324 CbcNode * localNode_;
00325
00326 double * bestSolution_;
00327
00328 double * savedSolution_;
00329
00330 int saveNumberSolutions_;
00331
00332 OsiRowCut cut_;
00333
00334 OsiRowCut fixedCut_;
00335
00336 CbcModel * model_;
00337
00338 double * originalLower_;
00339
00340 double * originalUpper_;
00341
00342 int range_;
00343
00344 int typeCuts_;
00345
00346 int maxDiversification_;
00347
00348 int diversification_;
00349
00350 bool nextStrong_;
00351
00352 double rhs_;
00353
00354 double savedGap_;
00355
00356 double bestCutoff_;
00357
00358 int timeLimit_;
00359
00360 int startTime_;
00361
00362 int nodeLimit_;
00363
00364 int startNode_;
00365
00366 int searchType_;
00367
00368 bool refine_;
00369
00370 };
00371 #endif
00372