Cgl 0.59.7

- 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
CglGomory.hpp
Go to the documentation of this file.
1 // Copyright (C) 2002, 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 CglGomory_H
6 #define CglGomory_H
7
8 #include <string>
9
10 #include "CglCutGenerator.hpp"
11
12 class CoinWarmStartBasis;
14 class CglGomory : public CglCutGenerator {
15 friend void CglGomoryUnitTest(const OsiSolverInterface * siP,
16 const std::string mpdDir );
17
18 public:
19
20
34 virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
35 const CglTreeInfo info = CglTreeInfo());
38 int generateCuts( const OsiRowCutDebugger * debugger,
39 OsiCuts & cs,
40 const CoinPackedMatrix & columnCopy,
41 const CoinPackedMatrix & rowCopy,
42 const double * colsol,
43 const double * colLower, const double * colUpper,
44 const double * rowLower, const double * rowUpper,
45 const char * intVar ,
46 const CoinWarmStartBasis* warm,
47 const CglTreeInfo info = CglTreeInfo());
50 int generateCuts( const OsiRowCutDebugger * debugger,
51 OsiCuts & cs,
52 const CoinPackedMatrix & columnCopy,
53 const double * colsol,
54 const double * colLower, const double * colUpper,
55 const double * rowLower, const double * rowUpper,
56 const char * intVar ,
57 const CoinWarmStartBasis* warm,
58 const CglTreeInfo info = CglTreeInfo());
59
61 virtual bool needsOptimalBasis() const { return true; }
63
66 void passInOriginalSolver(OsiSolverInterface * solver);
69 inline OsiSolverInterface * originalSolver() const
70 { return originalSolver_;}
72 inline void setGomoryType(int type)
73 { gomoryType_=type;}
75 inline int gomoryType() const
76 { return gomoryType_;}
78
81 void setLimit(int limit);
84 int getLimit() const;
86 void setLimitAtRoot(int limit);
88 int getLimitAtRoot() const;
90 virtual int maximumLengthOfCutInTree() const;
92
97 void setAway(double value);
100 double getAway() const;
102 void setAwayAtRoot(double value);
104 double getAwayAtRoot() const;
106
116 void setConditionNumberMultiplier(double value);
119 double getConditionNumberMultiplier() const;
121 void setLargestFactorMultiplier(double value);
123 double getLargestFactorMultiplier() const;
125
128 inline void useAlternativeFactorization(bool yes=true)
130 { alternateFactorization_= (yes) ? 1 : 0;}
132 inline bool alternativeFactorization() const
133 { return (alternateFactorization_!=0);}
135
138 CglGomory ();
140
142 CglGomory (
143 const CglGomory &);
144
146 virtual CglCutGenerator * clone() const;
147
149 CglGomory &
150 operator=(
151 const CglGomory& rhs);
152
154 virtual
155 ~CglGomory ();
157 virtual std::string generateCpp( FILE * fp);
159 virtual void refreshSolver(OsiSolverInterface * solver);
161
162 private:
163
164 // Private member methods
165
166 // Private member data
167
170 double away_;
173 double awayAtRoot_;
175 double conditionNumberMultiplier_;
177 double largestFactorMultiplier_;
179 OsiSolverInterface * originalSolver_;
181 int limit_;
183 int limitAtRoot_;
185 int dynamicLimitInTree_;
187 int numberTimesStalled_;
189 int alternateFactorization_;
191 int gomoryType_;
193 };
194
195 //#############################################################################
201 void CglGomoryUnitTest(const OsiSolverInterface * siP,
202 const std::string mpdDir );
203
204 #endif
CglGomory::largestFactorMultiplier_
double largestFactorMultiplier_
Multiplier for largest factor cut relaxation.
Definition: CglGomory.hpp:177
CglGomory::getAwayAtRoot
double getAwayAtRoot() const
Get away at root.
CglGomory::clone
virtual CglCutGenerator * clone() const
Clone.
CglGomory::getAway
double getAway() const
Get away.
CglGomory::needsOptimalBasis
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true)
Definition: CglGomory.hpp:61
CglGomory::generateCpp
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
CglGomory::passInOriginalSolver
void passInOriginalSolver(OsiSolverInterface *solver)
Pass in a copy of original solver (clone it)
CglGomory::originalSolver
OsiSolverInterface * originalSolver() const
Returns original solver.
Definition: CglGomory.hpp:69
CglGomory::getLimitAtRoot
int getLimitAtRoot() const
Get at root.
CglGomory::alternateFactorization_
int alternateFactorization_
nonzero to use alternative factorization
Definition: CglGomory.hpp:189
CglCutGenerator.hpp
CglGomory::originalSolver_
OsiSolverInterface * originalSolver_
Original solver.
Definition: CglGomory.hpp:179
CglTreeInfo
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
CglGomory::alternativeFactorization
bool alternativeFactorization() const
Get whether alternative factorization being used.
Definition: CglGomory.hpp:132
CglGomory::CglGomoryUnitTest
friend void CglGomoryUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglGomory class.
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
CglGomory::CglGomory
CglGomory()
Default constructor.
CoinWarmStartBasis
The default COIN simplex (basis-oriented) warm start class.
Definition: CoinWarmStartBasis.hpp:40
CglGomory::setAway
void setAway(double value)
Set away.
CglGomory::useAlternativeFactorization
void useAlternativeFactorization(bool yes=true)
Set/unset alternative factorization.
Definition: CglGomory.hpp:129
CglGomory::gomoryType_
int gomoryType_
Type - 0 normal, 1 add original matrix one, 2 replace.
Definition: CglGomory.hpp:191
CglGomory::setLimitAtRoot
void setLimitAtRoot(int limit)
Set at root (if &lt;normal then use normal)
CglGomory::maximumLengthOfCutInTree
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
CglGomory::setLimit
void setLimit(int limit)
Set.
CglGomory::dynamicLimitInTree_
int dynamicLimitInTree_
Dynamic limit in tree.
Definition: CglGomory.hpp:185
CglGomory
Gomory Cut Generator Class.
Definition: CglGomory.hpp:14
CglGomory::getConditionNumberMultiplier
double getConditionNumberMultiplier() const
Get ConditionNumberMultiplier.
CglGomory::~CglGomory
virtual ~CglGomory()
Destructor.
CglCutGenerator
Cut Generator Base Class.
Definition: CglCutGenerator.hpp:23
CglGomory::conditionNumberMultiplier_
double conditionNumberMultiplier_
Multiplier for conditionNumber cut relaxation.
Definition: CglGomory.hpp:175
CglGomory::limit_
int limit_
Limit - only generate if fewer than this in cut.
Definition: CglGomory.hpp:181
CglGomory::refreshSolver
virtual void refreshSolver(OsiSolverInterface *solver)
This can be used to refresh any inforamtion.
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CglGomoryUnitTest
void CglGomoryUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglGomory class.
CglGomory::getLargestFactorMultiplier
double getLargestFactorMultiplier() const
Get LargestFactorMultiplier.
CglGomory::limitAtRoot_
int limitAtRoot_
Limit - only generate if fewer than this in cut (at root)
Definition: CglGomory.hpp:183
CglGomory::setLargestFactorMultiplier
void setLargestFactorMultiplier(double value)
Set LargestFactorMultiplier.
CglGomory::getLimit
int getLimit() const
Get.
CglGomory::awayAtRoot_
double awayAtRoot_
Only investigate if more than this away from integrality (at root)
Definition: CglGomory.hpp:173
CglGomory::away_
double away_
Only investigate if more than this away from integrality.
Definition: CglGomory.hpp:171
OsiRowCutDebugger
Validate cuts against a known solution.
Definition: OsiRowCutDebugger.hpp:42
CglGomory::operator=
CglGomory & operator=(const CglGomory &rhs)
Assignment operator.
CglGomory::gomoryType
int gomoryType() const
Return type.
Definition: CglGomory.hpp:75
CglGomory::numberTimesStalled_
int numberTimesStalled_
Number of times stalled.
Definition: CglGomory.hpp:187
CglGomory::setGomoryType
void setGomoryType(int type)
Set type - 0 normal, 1 add original matrix one, 2 replace.
Definition: CglGomory.hpp:72
CglGomory::setAwayAtRoot
void setAwayAtRoot(double value)
Set away at root.
CglGomory::setConditionNumberMultiplier
void setConditionNumberMultiplier(double value)
Set ConditionNumberMultiplier.
CglGomory::generateCuts
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate Mixed Integer Gomory cuts for the model of the solver interface, si.