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