coin-Cgl
CglCutGenerator.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef CglCutGenerator_H
4 #define CglCutGenerator_H
5 
6 #include "OsiCuts.hpp"
7 #include "OsiSolverInterface.hpp"
8 #include "CglTreeInfo.hpp"
9 
10 //-------------------------------------------------------------------
11 //
12 // Abstract base class for generating cuts.
13 //
14 //-------------------------------------------------------------------
16 
22 
23 public:
24 
31  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
32  const CglTreeInfo info = CglTreeInfo()) const=0;
34 
35 
38  CglCutGenerator ();
40 
43 
45  virtual CglCutGenerator * clone() const = 0;
46 
49 
51  virtual ~CglCutGenerator ();
52 
63  virtual std::string generateCpp( FILE * ) {return "";}
64 
66  virtual void refreshSolver(OsiSolverInterface * ) {}
68 
75  inline int getAggressiveness() const
76  { return aggressive_;}
77 
82  inline void setAggressiveness(int value)
83  { aggressive_=value;}
84 
92  virtual bool mayGenerateRowCutsInTree() const;
94  virtual bool needsOptimalBasis() const;
96  virtual int maximumLengthOfCutInTree() const
97  { return COIN_INT_MAX;}
99 
100  // test this class
101  //static void unitTest();
102 
103 // private:
104 
110 };
111 
112 #endif
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const =0
Generate cuts for the model data contained in si.
virtual ~CglCutGenerator()
Destructor.
void setAggressiveness(int value)
Set Aggressiveness - 0 = neutral, 100 is normal root node.
CglCutGenerator()
Default constructor.
CglCutGenerator & operator=(const CglCutGenerator &rhs)
Assignment operator.
virtual bool mayGenerateRowCutsInTree() const
Returns true if may generate Row cuts in tree (rather than root node).
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
virtual void refreshSolver(OsiSolverInterface *)
This can be used to refresh any information.
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts.
Cut Generator Base Class.
int getAggressiveness() const
Get Aggressiveness - 0 = neutral, 100 is normal root node.
virtual CglCutGenerator * clone() const =0
Clone.
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:13
int aggressive_
Aggressiveness - 0 = neutral, 100 is normal root node.
virtual std::string generateCpp(FILE *)
Create C++ lines to set the generator in the current state.