Bonmin  1.7
BonEcpCuts.hpp
Go to the documentation of this file.
00001 // (C) Copyright International Business Machines (IBM) 2006, 2007
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Authors :
00006 // P. Bonami, International Business Machines
00007 //
00008 // Date :  12/20/2006
00009 
00010 #ifndef BonECPCuts_HPP
00011 #define BonECPCuts_HPP
00012 
00013 #include "BonOaDecBase.hpp"
00014 #include "CglCutGenerator.hpp"
00015 namespace Bonmin
00016 {
00017   class EcpCuts: public OaDecompositionBase
00018   {
00019   public:
00020     EcpCuts(BabSetupBase & b);
00021 
00023     EcpCuts(const EcpCuts & copy):
00024         OaDecompositionBase(copy),
00025         objValue_(copy.objValue_),
00026         numRounds_(copy.numRounds_),
00027         abs_violation_tol_(copy.abs_violation_tol_),
00028         rel_violation_tol_(copy.rel_violation_tol_),
00029         beta_(copy.beta_)
00030     {}
00031 
00033     CglCutGenerator * clone() const
00034     {
00035       return new EcpCuts(*this);
00036     }
00037 
00039     virtual ~EcpCuts()
00040     {}
00042     virtual void generateCuts(const OsiSolverInterface &si,  OsiCuts & cs,
00043         const CglTreeInfo info = CglTreeInfo()) const;
00044     double doEcpRounds(OsiSolverInterface &si,
00045         bool leaveSiUnchanged,
00046         double* violation = NULL);
00047 
00048     void setNumRounds(int value)
00049     {
00050       numRounds_ = value;
00051     }
00052 
00053     void setPropabilityFactor(double value)
00054     {
00055       beta_ = value;
00056     }
00057 
00058     void setAbsViolationTolerance(double value)
00059     {
00060       abs_violation_tol_ = value;
00061     }
00062     void setRelViolationTolerance(double value)
00063     {
00064       rel_violation_tol_ = value;
00065     }
00066 
00068     static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00069 
00070   protected:
00072     virtual double performOa(OsiCuts & cs, solverManip &lpManip,
00073                    BabInfo * babInfo, double &cutoff, const CglTreeInfo &info) const
00074     {
00075       throw -1;
00076     }
00078     virtual bool doLocalSearch(BabInfo * babInfo) const
00079     {
00080       return 0;
00081     }
00082   private:
00084     mutable double objValue_;
00086     mutable double violation_;
00088     int numRounds_;
00090     double abs_violation_tol_;
00092     double rel_violation_tol_;
00094     double beta_;
00095   };
00096 } /* end namespace Bonmin.*/
00097 #endif