Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CglCutGenerator.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This code is licensed under the terms of the Eclipse Public License (EPL).
4
5 #ifndef CglCutGenerator_H
6 #define CglCutGenerator_H
7
8 #include "OsiCuts.hpp"
9 #include "OsiSolverInterface.hpp"
10 #include "CglTreeInfo.hpp"
11
12 //-------------------------------------------------------------------
13 //
14 // Abstract base class for generating cuts.
15 //
16 //-------------------------------------------------------------------
18
23 class CglCutGenerator {
24
25 public:
32 virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
33 const CglTreeInfo info = CglTreeInfo())
34 = 0;
36
39 CglCutGenerator();
41
43 CglCutGenerator(const CglCutGenerator &);
44
46 virtual CglCutGenerator *clone() const = 0;
47
49 CglCutGenerator &operator=(const CglCutGenerator &rhs);
50
52 virtual ~CglCutGenerator();
53
64 virtual std::string generateCpp(FILE *) { return ""; }
65
67 virtual void refreshSolver(OsiSolverInterface *) {}
69
76 inline int getAggressiveness() const
77 {
78 return aggressive_;
79 }
80
85 inline void setAggressiveness(int value)
86 {
87 aggressive_ = value;
88 }
90 inline void setGlobalCuts(bool trueOrFalse)
91 {
92 canDoGlobalCuts_ = trueOrFalse;
93 }
95 inline bool canDoGlobalCuts() const
96 {
97 return canDoGlobalCuts_;
98 }
106 virtual bool mayGenerateRowCutsInTree() const;
108 virtual bool needsOptimalBasis() const;
110 virtual int maximumLengthOfCutInTree() const
111 {
112 return COIN_INT_MAX;
113 }
115
116 // test this class
117 //static void unitTest();
118
119 // private:
120
125 int aggressive_;
127 bool canDoGlobalCuts_;
128 };
129
130 #endif
131
132 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
133 */
CglCutGenerator::maximumLengthOfCutInTree
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
Definition: CglCutGenerator.hpp:110
CglCutGenerator::aggressive_
int aggressive_
Aggressiveness - 0 = neutral, 100 is normal root node.
Definition: CglCutGenerator.hpp:125
CglCutGenerator::mayGenerateRowCutsInTree
virtual bool mayGenerateRowCutsInTree() const
Returns true if may generate Row cuts in tree (rather than root node).
CglTreeInfo
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
CglCutGenerator::canDoGlobalCuts
bool canDoGlobalCuts() const
Say whether can do global cuts.
Definition: CglCutGenerator.hpp:95
CglCutGenerator::CglCutGenerator
CglCutGenerator()
Default constructor.
CglTreeInfo.hpp
CglCutGenerator
Cut Generator Base Class.
Definition: CglCutGenerator.hpp:23
CglCutGenerator::getAggressiveness
int getAggressiveness() const
Get Aggressiveness - 0 = neutral, 100 is normal root node.
Definition: CglCutGenerator.hpp:76
CglCutGenerator::generateCuts
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())=0
Generate cuts for the model data contained in si.
CglCutGenerator::canDoGlobalCuts_
bool canDoGlobalCuts_
True if can do global cuts i.e. no general integers.
Definition: CglCutGenerator.hpp:127
COIN_INT_MAX
const int COIN_INT_MAX
Definition: CoinFinite.hpp:19
OsiSolverInterface.hpp
CglCutGenerator::refreshSolver
virtual void refreshSolver(OsiSolverInterface *)
This can be used to refresh any information.
Definition: CglCutGenerator.hpp:67
CglCutGenerator::clone
virtual CglCutGenerator * clone() const =0
Clone.
OsiCuts.hpp
CglCutGenerator::~CglCutGenerator
virtual ~CglCutGenerator()
Destructor.
CglCutGenerator::setAggressiveness
void setAggressiveness(int value)
Set Aggressiveness - 0 = neutral, 100 is normal root node.
Definition: CglCutGenerator.hpp:85
CglCutGenerator::generateCpp
virtual std::string generateCpp(FILE *)
Create C++ lines to set the generator in the current state.
Definition: CglCutGenerator.hpp:64
CglCutGenerator::operator=
CglCutGenerator & operator=(const CglCutGenerator &rhs)
Assignment operator.
CglCutGenerator::setGlobalCuts
void setGlobalCuts(bool trueOrFalse)
Set whether can do global cuts.
Definition: CglCutGenerator.hpp:90
CglCutGenerator::needsOptimalBasis
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts.