/home/coin/SVN-release/OS-2.0.0/Bonmin/src/Algorithms/OaGenerators/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(OsiTMINLPInterface *nlp = NULL,
00021         int numRounds = 1,
00022         double abs_violation_tol = 1e-6,
00023         double rel_violation_tol = 1000.,
00024         double beta = -1.
00025            ):
00026         OaDecompositionBase(nlp,NULL, NULL,0,0,0),
00027         objValue_(-COIN_DBL_MAX),
00028         numRounds_(numRounds),
00029         abs_violation_tol_(abs_violation_tol),
00030         rel_violation_tol_(rel_violation_tol),
00031         beta_(beta)
00032     {}
00033     EcpCuts(BabSetupBase & b);
00034 
00036     EcpCuts(const EcpCuts & copy):
00037         OaDecompositionBase(copy),
00038         objValue_(copy.objValue_),
00039         numRounds_(copy.numRounds_),
00040         abs_violation_tol_(copy.abs_violation_tol_),
00041         rel_violation_tol_(copy.rel_violation_tol_),
00042         beta_(copy.beta_)
00043     {}
00044 
00046     CglCutGenerator * clone() const
00047     {
00048       return new EcpCuts(*this);
00049     }
00050 
00052     virtual ~EcpCuts()
00053     {}
00055     virtual void generateCuts(const OsiSolverInterface &si,  OsiCuts & cs,
00056         const CglTreeInfo info = CglTreeInfo()) const;
00057     double doEcpRounds(OsiSolverInterface &si,
00058         bool leaveSiUnchanged,
00059         double* violation = NULL);
00060 
00061     void setNumRounds(int value)
00062     {
00063       numRounds_ = value;
00064     }
00065 
00066     void setPropabilityFactor(double value)
00067     {
00068       beta_ = value;
00069     }
00070 
00071     void setAbsViolationTolerance(double value)
00072     {
00073       abs_violation_tol_ = value;
00074     }
00075     void setRelViolationTolerance(double value)
00076     {
00077       rel_violation_tol_ = value;
00078     }
00079 
00081     static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00082 
00083   protected:
00085     virtual double performOa(OsiCuts & cs, solverManip &nlpManip, solverManip &lpManip,
00086         SubMipSolver *& subMip, OsiBabSolver * babInfo, double &cutoff) const
00087     {
00088       throw -1;
00089     }
00091     virtual bool doLocalSearch() const
00092     {
00093       return 0;
00094     }
00095   private:
00097     mutable double objValue_;
00099     mutable double violation_;
00101     int numRounds_;
00103     double abs_violation_tol_;
00105     double rel_violation_tol_;
00107     double beta_;
00108   };
00109 } /* end namespace Bonmin.*/
00110 #endif

Generated on Mon Aug 3 03:02:17 2009 by  doxygen 1.4.7