6 #ifndef CglSimpleRounding_H 7 #define CglSimpleRounding_H 12 #include "CoinPackedMatrix.hpp" 31 const std::string mpdDir );
40 virtual void generateCuts(
const OsiSolverInterface & si, OsiCuts & cs,
76 bool deriveAnIntegerRow(
77 const OsiSolverInterface & si,
79 const CoinShallowPackedVector & matrixRow,
80 CoinPackedVector & irow,
82 bool * negative)
const;
100 int power10ToMakeDoubleAnInt(
103 double dataTol )
const;
108 inline int gcd(
int a,
int b)
const;
114 inline int gcdv(
int n,
const int *
const vi)
const;
132 CglSimpleRounding::gcd(
int a,
int b)
const 140 int remainder = b % a;
141 if (remainder == 0)
return a;
142 else return gcd(remainder,a);
150 CglSimpleRounding::gcdv(
int n,
const int*
const vi)
const 158 int retval=gcd(vi[0], vi[1]);
159 for (
int i=2; i<n; i++){
160 retval=gcd(retval,vi[i]);
172 const std::string mpdDir );
virtual std::string generateCpp(FILE *fp)
Create C++ lines to get to current state.
CglSimpleRounding & operator=(const CglSimpleRounding &rhs)
Assignment operator.
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
Generate simple rounding cuts for the model accessed through the solver interface.
Simple Rounding Cut Generator Class.
CglSimpleRounding()
Default constructor.
Information about where the cut generator is invoked from.
friend void CglSimpleRoundingUnitTest(const OsiSolverInterface *siP, const std::string mpdDir)
A function that tests the methods in the CglSimpleRounding class.
virtual CglCutGenerator * clone() const
Clone.
Cut Generator Base Class.
virtual ~CglSimpleRounding()
Destructor.