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