// Copyright (C) 2002, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). #ifndef CglGomory_H #define CglGomory_H #include #include "CglCutGenerator.hpp" class CoinWarmStartBasis; /** Gomory Cut Generator Class */ class CglGomory : public CglCutGenerator { friend void CglGomoryUnitTest(const OsiSolverInterface * siP, const std::string mpdDir ); public: /**@name Generate Cuts */ //@{ /** Generate Mixed Integer Gomory cuts for the model of the solver interface, si. Insert the generated cuts into OsiCut, cs. There is a limit option, which will only generate cuts with less than this number of entries. We can also only look at 0-1 variables a certain distance from integer. */ virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, const CglTreeInfo info = CglTreeInfo()); /** Generates cuts given matrix and solution etc, returns number of cuts generated */ int generateCuts( const OsiRowCutDebugger * debugger, OsiCuts & cs, const CoinPackedMatrix & columnCopy, const CoinPackedMatrix & rowCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar , const CoinWarmStartBasis* warm, const CglTreeInfo info = CglTreeInfo()); /** Generates cuts given matrix and solution etc, returns number of cuts generated (no row copy passed in) */ int generateCuts( const OsiRowCutDebugger * debugger, OsiCuts & cs, const CoinPackedMatrix & columnCopy, const double * colsol, const double * colLower, const double * colUpper, const double * rowLower, const double * rowUpper, const char * intVar , const CoinWarmStartBasis* warm, const CglTreeInfo info = CglTreeInfo()); /// Return true if needs optimal basis to do cuts (will return true) virtual bool needsOptimalBasis() const { return true; } //@} /**@name Change way Gomory works */ //@{ /// Pass in a copy of original solver (clone it) void passInOriginalSolver(OsiSolverInterface * solver); /// Returns original solver inline OsiSolverInterface * originalSolver() const { return originalSolver_;} /// Set type - 0 normal, 1 add original matrix one, 2 replace inline void setGomoryType(int type) { gomoryType_=type;} /// Return type inline int gomoryType() const { return gomoryType_;} //@} /**@name Change limit on how many variables in cut (default 50) */ //@{ /// Set void setLimit(int limit); /// Get int getLimit() const; /// Set at root (if