Bonmin
1.7
|
00001 // (C) Copyright International Business Machines Corporation 2007 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // Authors : 00006 // Pierre Bonami, International Business Machines Corporation 00007 // 00008 // Date : 10/06/2007 00009 00010 #ifndef BonLinearCutsGenerator_H 00011 #define BonLinearCutsGenerator_H 00012 00013 #include "CglCutGenerator.hpp" 00014 #include "CoinSmartPtr.hpp" 00015 #include "BonOuterApprox.hpp" 00016 #include "BonBonminSetup.hpp" 00017 #include <list> 00018 00019 namespace Bonmin { 00020 class LinearCutsGenerator : public CglCutGenerator { 00021 public: 00023 struct CuttingMethod : public Coin::ReferencedObject 00024 { 00025 int frequency; 00026 std::string id; 00027 CglCutGenerator * cgl; 00028 bool atSolution; 00029 bool normal; 00030 CuttingMethod(): 00031 atSolution(false), 00032 normal(true) 00033 {} 00034 00035 CuttingMethod(const CuttingMethod & other): 00036 frequency(other.frequency), 00037 id(other.id), 00038 cgl(other.cgl), 00039 atSolution(other.atSolution), 00040 normal(other.normal) 00041 {} 00042 }; 00043 LinearCutsGenerator(): 00044 CglCutGenerator(), 00045 methods_(){ 00046 } 00047 00048 00049 LinearCutsGenerator(const LinearCutsGenerator & other): 00050 CglCutGenerator(other), 00051 methods_(other.methods_){ 00052 } 00053 00054 CglCutGenerator * clone() const { 00055 return new LinearCutsGenerator(*this); 00056 } 00057 00058 virtual ~LinearCutsGenerator(){ 00059 } 00060 00061 bool needsOptimalBasis() { return false;} 00062 00063 void initialize(BabSetupBase& s); 00064 00065 void generateCuts(const OsiSolverInterface &solver, OsiCuts &cs, 00066 const CglTreeInfo info = CglTreeInfo()); 00067 00068 private: 00069 std::list<Coin::SmartPtr<CuttingMethod> > methods_; 00070 }; 00071 00072 }/* Ends Bonmin namespace.*/ 00073 00074 #endif 00075