From 9fd2976931c088dc523974afb901e96bad20f73c Mon Sep 17 00:00:00 2001 From: Harpreet Date: Thu, 4 Aug 2016 15:25:44 +0530 Subject: initial add --- build/Bonmin/include/coin/CglGomory.hpp | 204 ++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 build/Bonmin/include/coin/CglGomory.hpp (limited to 'build/Bonmin/include/coin/CglGomory.hpp') diff --git a/build/Bonmin/include/coin/CglGomory.hpp b/build/Bonmin/include/coin/CglGomory.hpp new file mode 100644 index 0000000..2d7f5c5 --- /dev/null +++ b/build/Bonmin/include/coin/CglGomory.hpp @@ -0,0 +1,204 @@ +// 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