Go to the documentation of this file.
6 #ifndef CbcCutGenerator_H
7 #define CbcCutGenerator_H
9 #include "OsiSolverInterface.hpp"
10 #include "OsiCuts.hpp"
11 #include "CglCutGenerator.hpp"
16 class OsiRowCutDebugger;
70 bool generateCuts(OsiCuts &cs,
int fullScan, OsiSolverInterface *solver,
81 int howOften = 1,
const char *name = NULL,
83 bool infeasible =
false,
int howOftenInsub = -100,
108 return generatorName_;
132 return whenCutGenerator_;
137 return whenCutGeneratorInSub_;
166 return depthCutGenerator_;
171 return depthCutGeneratorInSub_;
176 maximumTries_ = value;
181 return maximumTries_;
197 return (switches_ & 1) != 0;
203 switches_ |= value ? 1 : 0;
208 return (switches_ & 2) != 0;
214 switches_ |= value ? 2 : 0;
221 return (switches_ & 4) != 0;
229 switches_ |= value ? 4 : 0;
234 return (switches_ & 64) != 0;
240 switches_ |= value ? 64 : 0;
241 timeInCutGenerator_ = 0.0;
246 return timeInCutGenerator_;
250 timeInCutGenerator_ += value;
264 numberTimes_ = value;
268 numberTimes_ += value;
281 numberCuts_ += value;
286 return numberElements_;
290 numberElements_ = value;
294 numberElements_ += value;
299 return numberColumnCuts_;
303 numberColumnCuts_ = value;
307 numberColumnCuts_ += value;
312 return numberCutsActive_;
316 numberCutsActive_ = value;
320 numberCutsActive_ += value;
324 switchOffIfLessThan_ = value;
328 return switchOffIfLessThan_;
333 return (switches_ & 128) != 0;
339 switches_ |= yesNo ? 128 : 0;
344 return (switches_ & 8) != 0;
350 switches_ |= yesNo ? 8 : 0;
355 return (switches_ & 16) != 0;
361 switches_ |= yesNo ? 16 : 0;
366 return (switches_ & 512) != 0;
372 switches_ |= yesNo ? 512 : 0;
377 return (switches_ & 1024) != 0;
383 switches_ |= yesNo ? 1024 : 0;
388 return (switches_ & 2048) != 0;
394 switches_ |= yesNo ? 2048 : 0;
399 return (switches_ & 4096) != 0;
405 switches_ |= yesNo ? 4096 : 0;
410 return (switches_ & 8192) != 0;
416 switches_ |= yesNo ? 8192 : 0;
421 return numberCutsAtRoot_;
425 numberCutsAtRoot_ = value;
430 return numberActiveCutsAtRoot_;
434 numberActiveCutsAtRoot_ = value;
439 return numberShortCutsAtRoot_;
443 numberShortCutsAtRoot_ = value;
453 return (switches_ & 32) != 0;
459 switches_ |= yesNo ? 32 : 0;
464 return (switches_ & 256) != 0;
470 switches_ |= yesNo ? 256 : 0;
485 double timeInCutGenerator_;
490 CglCutGenerator *generator_;
493 char *generatorName_;
498 int whenCutGenerator_;
502 int whenCutGeneratorInSub_;
505 int switchOffIfLessThan_;
510 int depthCutGenerator_;
516 int depthCutGeneratorInSub_;
527 int numberColumnCuts_;
529 int numberCutsActive_;
531 int numberCutsAtRoot_;
533 int numberActiveCutsAtRoot_;
535 int numberShortCutsAtRoot_;
543 #define SCANCUTS 1000
545 #define SCANCUTS_PROBING 1000
void setGlobalCuts(bool yesNo)
Set whether global cuts.
void setGlobalCutsAtRoot(bool yesNo)
Set whether global cuts at root.
int numberCutsAtRoot() const
Number of cuts generated at root.
const char * cutGeneratorName() const
return name of generator
void setHowOften(int value)
Set the cut generation interval.
int numberCutsInTotal() const
Total number of cuts added.
void incrementNumberElementsInTotal(int value=1)
void setWhenInfeasible(bool value)
Set whether the cut generator should be called when the subproblem is found to be infeasible.
CbcCutGenerator()
Default constructor.
void setNumberActiveCutsAtRoot(int value)
int inaccuracy() const
Get level of cut inaccuracy (0 means exact e.g. cliques)
void setNeedsOptimalBasis(bool yesNo)
Set if optimal basis needed.
void setWhatDepth(int value)
Set the cut generation depth.
void setNumberShortCutsAtRoot(int value)
bool whetherInMustCallAgainMode() const
Whether in must call again mode (or after others)
void setAtSolution(bool value)
Set whether the cut generator should be called when a solution is found.
void setSwitchedOff(bool yesNo)
Set whether generator switched off for moment.
void incrementNumberColumnCuts(int value=1)
int switchOffIfLessThan() const
bool atSolution() const
Get whether the cut generator should be called when a solution is found.
void incrementNumberTimesEntered(int value=1)
void setWhetherCallAtEnd(bool yesNo)
Set whether to call at end.
bool needsOptimalBasis() const
Say if optimal basis needed.
int maximumTries() const
Get maximum number of times to enter.
CglCutGenerator * generator() const
Get the CglCutGenerator corresponding to this CbcCutGenerator.
bool globalCuts() const
Whether global cuts.
bool whetherToUse() const
Whether to use if any cuts generated.
void setSwitches(int value)
Set switches (for copying from virgin state)
void setNumberColumnCuts(int value)
int switches() const
Get switches.
CbcCutGenerator & operator=(const CbcCutGenerator &rhs)
Assignment operator.
void setNormal(bool value)
Set whether the cut generator should be called in the normal place.
void setNeedsRefresh(bool yesNo)
Set whether needs refresh on copy.
void refreshModel(CbcModel *model)
Set the client model.
int numberShortCutsAtRoot() const
Number of short cuts at root.
void setNumberCutsInTotal(int value)
double timeInCutGenerator() const
Return time taken in cut generator.
bool globalCutsAtRoot() const
Whether global cuts at root.
Simple Branch and bound class.
int howOften() const
Get the cut generation interval.
void incrementNumberCutsInTotal(int value=1)
bool mustCallAgain() const
Whether generator MUST be called again if any cuts (i.e. ignore break from loop)
void scaleBackStatistics(int factor)
Scale back statistics by factor.
void setMaximumTries(int value)
Set maximum number of times to enter.
void setWhetherInMustCallAgainMode(bool yesNo)
Set whether in must call again mode (or after others)
int numberCutsActive() const
Total number of cuts active after (at end of n cut passes at each node)
void addStatistics(const CbcCutGenerator *other)
Add in statistics from other.
void setSwitchOffIfLessThan(int value)
bool whetherCallAtEnd() const
Whether to call at end.
void setInaccuracy(int level)
Set level of cut inaccuracy (0 means exact e.g. cliques)
void setNumberElementsInTotal(int value)
int numberTimesEntered() const
Number times cut generator entered.
void setNumberCutsAtRoot(int value)
void setWhatDepthInSub(int value)
Set the cut generation depth in sub tree.
int whatDepth() const
Get the cut generation depth criterion.
bool generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface *solver, CbcNode *node)
Generate cuts for the client model.
void setTiming(bool value)
Set whether the cut generator is being timed.
bool normal() const
Get whether the cut generator should be called in the normal place.
Information required while the node is live.
bool switchedOff() const
Whether generator switched off for moment.
int numberActiveCutsAtRoot() const
Number of cuts active at root.
bool timing() const
Get whether the cut generator is being timed.
bool ineffectualCuts() const
Whether last round of cuts did little.
int numberColumnCuts() const
Total number of column cuts.
int howOftenInSub() const
Get the cut generation interval.in sub tree.
void setIneffectualCuts(bool yesNo)
Set whether last round of cuts did little.
void setModel(CbcModel *model)
Set model.
Interface between Cbc and Cut Generation Library.
void incrementTimeInCutGenerator(double value)
void incrementNumberCutsActive(int value=1)
void setNumberTimesEntered(int value)
bool whenInfeasible() const
Get whether the cut generator should be called when the subproblem is found to be infeasible.
int whatDepthInSub() const
Get the cut generation depth criterion.in sub tree.
void setNumberCutsActive(int value)
~CbcCutGenerator()
Destructor.
bool needsRefresh() const
Whether needs refresh on copy.
int numberElementsInTotal() const
Total number of elements added.
void setMustCallAgain(bool yesNo)
Set whether generator MUST be called again if any cuts (i.e. ignore break from loop)
void setWhetherToUse(bool yesNo)
Set whether to use if any cuts generated.
void generateTuning(FILE *fp)
Create C++ lines to show how to tune.