6 #ifndef CbcCutGenerator_H 7 #define CbcCutGenerator_H 9 #include "OsiSolverInterface.hpp" 10 #include "OsiCuts.hpp" 11 #include "CglCutGenerator.hpp" 16 class OsiRowCutDebugger;
71 bool generateCuts( OsiCuts &cs,
int fullScan, OsiSolverInterface * solver,
83 int howOften = 1,
const char * name = NULL,
85 bool infeasible =
false,
int howOftenInsub = -100,
109 return generatorName_;
132 return whenCutGenerator_;
136 return whenCutGeneratorInSub_;
162 return depthCutGenerator_;
166 return depthCutGeneratorInSub_;
170 { maximumTries_ = value;}
173 {
return maximumTries_;}
185 return (switches_&1) != 0;
190 switches_ |= value ? 1 : 0;
194 return (switches_&2) != 0;
199 switches_ |= value ? 2 : 0;
205 return (switches_&4) != 0;
212 switches_ |= value ? 4 : 0;
216 return (switches_&64) != 0;
221 switches_ |= value ? 64 : 0;
222 timeInCutGenerator_ = 0.0;
226 return timeInCutGenerator_;
229 timeInCutGenerator_ += value;
240 numberTimes_ = value;
243 numberTimes_ += value;
253 numberCuts_ += value;
257 return numberElements_;
260 numberElements_ = value;
263 numberElements_ += value;
267 return numberColumnCuts_;
270 numberColumnCuts_ = value;
273 numberColumnCuts_ += value;
277 return numberCutsActive_;
280 numberCutsActive_ = value;
283 numberCutsActive_ += value;
286 switchOffIfLessThan_ = value;
289 return switchOffIfLessThan_;
293 return (switches_&128) != 0;
298 switches_ |= yesNo ? 128 : 0;
302 return (switches_&8) != 0;
307 switches_ |= yesNo ? 8 : 0;
311 return (switches_&16) != 0;
316 switches_ |= yesNo ? 16 : 0;
320 return (switches_&512) != 0;
325 switches_ |= yesNo ? 512 : 0;
329 return (switches_&1024) != 0;
334 switches_ |= yesNo ? 1024 : 0;
338 return (switches_&2048) != 0;
343 switches_ |= yesNo ? 2048 : 0;
347 return (switches_&4096) != 0;
352 switches_ |= yesNo ? 4096 : 0;
356 return (switches_&8192) != 0;
361 switches_ |= yesNo ? 8192 : 0;
365 return numberCutsAtRoot_;
368 numberCutsAtRoot_ = value;
372 return numberActiveCutsAtRoot_;
375 numberActiveCutsAtRoot_ = value;
379 return numberShortCutsAtRoot_;
382 numberShortCutsAtRoot_ = value;
390 return (switches_&32) != 0;
395 switches_ |= yesNo ? 32 : 0;
399 return (switches_&256) != 0;
404 switches_ |= yesNo ? 256 : 0;
419 double timeInCutGenerator_;
424 CglCutGenerator * generator_;
427 char * generatorName_;
432 int whenCutGenerator_;
436 int whenCutGeneratorInSub_;
439 int switchOffIfLessThan_;
444 int depthCutGenerator_;
450 int depthCutGeneratorInSub_;
461 int numberColumnCuts_;
463 int numberCutsActive_;
465 int numberCutsAtRoot_;
467 int numberActiveCutsAtRoot_;
469 int numberShortCutsAtRoot_;
477 # define SCANCUTS 1000 479 # define SCANCUTS_PROBING 1000 int maximumTries() const
Get maximum number of times to enter.
bool globalCuts() const
Whether global cuts.
bool normal() const
Get whether the cut generator should be called in the normal place.
void setSwitches(int value)
Set switches (for copying from virgin state)
bool whenInfeasible() const
Get whether the cut generator should be called when the subproblem is found to be infeasible...
void setNumberColumnCuts(int value)
void setWhatDepth(int value)
Set the cut generation depth.
int switches() const
Get switches.
int numberColumnCuts() const
Total number of column cuts.
void setNormal(bool value)
Set whether the cut generator should be called in the normal place.
void setWhetherToUse(bool yesNo)
Set whether to use if any cuts generated.
void setIneffectualCuts(bool yesNo)
Set whether last round of cuts did little.
void setNumberCutsInTotal(int value)
int numberCutsAtRoot() const
Number of cuts generated at root.
const char * cutGeneratorName() const
return name of generator
void incrementNumberCutsInTotal(int value=1)
int numberCutsInTotal() const
Total number of cuts added.
bool whetherToUse() const
Whether to use if any cuts generated.
int whatDepthInSub() const
Get the cut generation depth criterion.in sub tree.
void setWhenInfeasible(bool value)
Set whether the cut generator should be called when the subproblem is found to be infeasible...
bool mustCallAgain() const
Whether generator MUST be called again if any cuts (i.e. ignore break from loop)
CbcCutGenerator & operator=(const CbcCutGenerator &rhs)
Assignment operator.
int inaccuracy() const
Get level of cut inaccuracy (0 means exact e.g. cliques)
double timeInCutGenerator() const
Return time taken in cut generator.
void setGlobalCuts(bool yesNo)
Set whether global cuts.
int switchOffIfLessThan() const
void setNumberCutsAtRoot(int value)
bool generateCuts(OsiCuts &cs, int fullScan, OsiSolverInterface *solver, CbcNode *node)
Generate cuts for the client model.
int howOften() const
Get the cut generation interval.
void setTiming(bool value)
Set whether the cut generator is being timed.
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.
void setNeedsOptimalBasis(bool yesNo)
Set if optimal basis needed.
void setWhetherInMustCallAgainMode(bool yesNo)
Set whether in must call again mode (or after others)
void setNumberShortCutsAtRoot(int value)
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 numberTimesEntered() const
Number times cut generator entered.
void refreshModel(CbcModel *model)
Set the client model.
void setNumberTimesEntered(int value)
Information required while the node is live.
bool atSolution() const
Get whether the cut generator should be called when a solution is found.
void setNumberCutsActive(int value)
bool switchedOff() const
Whether generator switched off for moment.
void setWhetherCallAtEnd(bool yesNo)
Set whether to call at end.
~CbcCutGenerator()
Destructor.
bool needsOptimalBasis() const
Say if optimal basis needed.
CglCutGenerator * generator() const
Get the CglCutGenerator corresponding to this CbcCutGenerator.
void generateTuning(FILE *fp)
Create C++ lines to show how to tune.
void scaleBackStatistics(int factor)
Scale back statistics by factor.
void setMaximumTries(int value)
Set maximum number of times to enter.
void setModel(CbcModel *model)
Set model.
void setGlobalCutsAtRoot(bool yesNo)
Set whether global cuts at root.
void setNeedsRefresh(bool yesNo)
Set whether needs refresh on copy.
bool whetherCallAtEnd() const
Whether to call at end.
int numberShortCutsAtRoot() const
Number of short cuts at root.
void incrementNumberCutsActive(int value=1)
void setInaccuracy(int level)
Set level of cut inaccuracy (0 means exact e.g. cliques)
void setNumberElementsInTotal(int value)
bool globalCutsAtRoot() const
Whether global cuts at root.
void setWhatDepthInSub(int value)
Set the cut generation depth in sub tree.
CbcCutGenerator()
Default constructor.
bool needsRefresh() const
Whether needs refresh on copy.
int numberElementsInTotal() const
Total number of elements added.
void setNumberActiveCutsAtRoot(int value)
void setMustCallAgain(bool yesNo)
Set whether generator MUST be called again if any cuts (i.e. ignore break from loop) ...
bool whetherInMustCallAgainMode() const
Whether in must call again mode (or after others)
Interface between Cbc and Cut Generation Library.
int howOftenInSub() const
Get the cut generation interval.in sub tree.
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)
Simple Branch and bound class.
void setHowOften(int value)
Set the cut generation interval.
void incrementTimeInCutGenerator(double value)
void incrementNumberElementsInTotal(int value=1)
void incrementNumberTimesEntered(int value=1)
int whatDepth() const
Get the cut generation depth criterion.