coin-Cgl
CglGomory.hpp
Go to the documentation of this file.
1 // Copyright (C) 2002, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef CglGomory_H
4 #define CglGomory_H
5 
6 #include <string>
7 
8 #include "CglCutGenerator.hpp"
9 
10 class CoinWarmStartBasis;
12 class CglGomory : public CglCutGenerator {
13  friend void CglGomoryUnitTest(const OsiSolverInterface * siP,
14  const std::string mpdDir );
15 
16 public:
17 
18 
32  virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs,
33  const CglTreeInfo info = CglTreeInfo()) const;
36  int generateCuts( const OsiRowCutDebugger * debugger,
37  OsiCuts & cs,
38  const CoinPackedMatrix & columnCopy,
39  const CoinPackedMatrix & rowCopy,
40  const double * colsol,
41  const double * colLower, const double * colUpper,
42  const double * rowLower, const double * rowUpper,
43  const char * intVar ,
44  const CoinWarmStartBasis* warm,
45  const CglTreeInfo info = CglTreeInfo()) const;
48  int generateCuts( const OsiRowCutDebugger * debugger,
49  OsiCuts & cs,
50  const CoinPackedMatrix & columnCopy,
51  const double * colsol,
52  const double * colLower, const double * colUpper,
53  const double * rowLower, const double * rowUpper,
54  const char * intVar ,
55  const CoinWarmStartBasis* warm,
56  const CglTreeInfo info = CglTreeInfo()) const;
57 
59  virtual bool needsOptimalBasis() const;
61 
64  void setLimit(int limit);
67  int getLimit() const;
69  void setLimitAtRoot(int limit);
71  int getLimitAtRoot() const;
73  virtual int maximumLengthOfCutInTree() const;
75 
80  void setAway(double value);
83  double getAway() const;
85  void setAwayAtRoot(double value);
87  double getAwayAtRoot() const;
89 
99  void setConditionNumberMultiplier(double value);
102  double getConditionNumberMultiplier() const;
104  void setLargestFactorMultiplier(double value);
106  double getLargestFactorMultiplier() const;
108 
111  inline void useAlternativeFactorization(bool yes=true)
113  { alternateFactorization_= (yes) ? 1 : 0;}
115  inline bool alternativeFactorization() const
116  { return (alternateFactorization_!=0);}
118 
121  CglGomory ();
123 
125  CglGomory (
126  const CglGomory &);
127 
129  virtual CglCutGenerator * clone() const;
130 
132  CglGomory &
133  operator=(
134  const CglGomory& rhs);
135 
137  virtual
138  ~CglGomory ();
140  virtual std::string generateCpp( FILE * fp);
142 
143 private:
144 
145  // Private member methods
146 
147  // Private member data
148 
151  double away_;
154  double awayAtRoot_;
160  int limit_;
164  mutable int dynamicLimitInTree_;
166  mutable int numberTimesStalled_;
170 };
171 
172 //#############################################################################
178 void CglGomoryUnitTest(const OsiSolverInterface * siP,
179  const std::string mpdDir );
180 
181 #endif
double getLargestFactorMultiplier() const
Get LargestFactorMultiplier.
double largestFactorMultiplier_
Multiplier for largest factor cut relaxation.
Definition: CglGomory.hpp:158
CglGomory & operator=(const CglGomory &rhs)
Assignment operator.
bool alternativeFactorization() const
Get whether alternative factorization being used.
Definition: CglGomory.hpp:115
double awayAtRoot_
Only investigate if more than this away from integrality (at root)
Definition: CglGomory.hpp:154
void setLimit(int limit)
Set.
int getLimit() const
Get.
virtual CglCutGenerator * clone() const
Clone.
void CglGomoryUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglGomory class.
int alternateFactorization_
nonzero to use alternative factorization
Definition: CglGomory.hpp:168
CglGomory()
Default constructor.
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
double getAwayAtRoot() const
Get away at root.
double getAway() const
Get away.
double getConditionNumberMultiplier() const
Get ConditionNumberMultiplier.
int dynamicLimitInTree_
Dynamic limit in tree.
Definition: CglGomory.hpp:164
double away_
Only investigate if more than this away from integrality.
Definition: CglGomory.hpp:152
double conditionNumberMultiplier_
Multiplier for conditionNumber cut relaxation.
Definition: CglGomory.hpp:156
void useAlternativeFactorization(bool yes=true)
Set/unset alternative factorization.
Definition: CglGomory.hpp:112
int limitAtRoot_
Limit - only generate if fewer than this in cut (at root)
Definition: CglGomory.hpp:162
Gomory Cut Generator Class.
Definition: CglGomory.hpp:12
int limit_
Limit - only generate if fewer than this in cut.
Definition: CglGomory.hpp:160
Cut Generator Base Class.
void setLargestFactorMultiplier(double value)
Set LargestFactorMultiplier.
void setAwayAtRoot(double value)
Set away at root.
virtual ~CglGomory()
Destructor.
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const
Generate Mixed Integer Gomory cuts for the model of the solver interface, si.
void setAway(double value)
Set away.
int getLimitAtRoot() const
Get at root.
void setLimitAtRoot(int limit)
Set at root (if
friend void CglGomoryUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglGomory class.
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:13
int numberTimesStalled_
Number of times stalled.
Definition: CglGomory.hpp:166
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts (will return true)
void setConditionNumberMultiplier(double value)
Set ConditionNumberMultiplier.