CouenneSOSObject.hpp

Go to the documentation of this file.
00001 /* $Id: CouenneSOSObject.hpp 490 2011-01-14 16:07:12Z pbelotti $
00002  *
00003  * Name:    CouenneSOSObject.hpp
00004  * Authors: Pietro Belotti, Lehigh University
00005  * Purpose: SOS Object
00006  *
00007  * (C) Carnegie-Mellon University, 2008-09.
00008  * This file is licensed under the Eclipse Public License (EPL)
00009  */
00010 
00011 #ifndef COUENNESOSOBJECT_HPP
00012 #define COUENNESOSOBJECT_HPP
00013 
00014 #include "OsiBranchingObject.hpp"
00015 #include "CouenneJournalist.hpp"
00016 
00017 namespace Couenne {
00018 
00019 class CouenneProblem;
00020 class CouenneSOSObject;
00021 class exprVar;
00022 
00023 
00024 // TODO: SOS of the form sum x_i \le k with k small. Instead of
00025 // branching on a single variable do a SOS-like branching
00026 
00027 class CouenneSOSBranchingObject: public OsiSOSBranchingObject {
00028 
00029 protected:
00030 
00032   CouenneProblem *problem_;
00033 
00037   exprVar *reference_;
00038 
00040   JnlstPtr jnlst_;
00041 
00043   bool doFBBT_;
00044 
00046   bool doConvCuts_;
00047 
00048 public:
00049 
00050   // Default Constructor 
00051   CouenneSOSBranchingObject () {}
00052 
00053   // Useful constructor
00054   CouenneSOSBranchingObject (CouenneProblem *p,
00055                              exprVar *ref,
00056                              OsiSolverInterface *solver,  
00057                              const OsiSOS *originalObject,
00058                              int way, 
00059                              double separator,
00060                              JnlstPtr jnlst,
00061                              bool doFBBT,
00062                              bool doConvCuts):
00063 
00064     OsiSOSBranchingObject (solver, originalObject, way, separator),
00065     problem_   (p),
00066     reference_ (ref),
00067     jnlst_ (jnlst),
00068     doFBBT_ (doFBBT),
00069     doConvCuts_ (doConvCuts) {}
00070 
00071   
00072   // Copy constructor 
00073   CouenneSOSBranchingObject (const CouenneSOSBranchingObject &src):
00074     OsiSOSBranchingObject (src),
00075     problem_    (src.problem_),
00076     reference_  (src.reference_),
00077     jnlst_      (src.jnlst_),
00078     doFBBT_     (src.doFBBT_),
00079     doConvCuts_ (src.doConvCuts_) {}
00080 
00081    
00083   virtual OsiBranchingObject * clone() const
00084   {return new CouenneSOSBranchingObject (*this);}
00085 
00087   virtual double branch (OsiSolverInterface * solver);
00088 };
00089 
00090 
00094 
00095 class CouenneSOSObject: public OsiSOS {
00096 
00097 protected:
00098 
00100   CouenneProblem *problem_;
00101 
00105   exprVar *reference_;
00106 
00108   JnlstPtr jnlst_;
00109 
00111   bool doFBBT_;
00112 
00114   bool doConvCuts_;
00115 
00116 public:
00117 
00118   CouenneSOSObject (OsiSolverInterface *solver, int nelem, int *indices, double *weights, int type,
00119                     CouenneProblem *problem,
00120                     exprVar *ref,
00121                     JnlstPtr jnlst,
00122                     bool doFBBT,
00123                     bool doConvCuts):
00124 
00125     OsiSOS      (solver, nelem, indices, weights, type),
00126     problem_    (problem),
00127     reference_  (ref),
00128     jnlst_      (jnlst),
00129     doFBBT_     (doFBBT),
00130     doConvCuts_ (doConvCuts) {}
00131 
00132 
00134   CouenneSOSObject (const CouenneSOSObject &src):
00135     OsiSOS      (src),
00136     problem_    (src.problem_),
00137     reference_  (src.reference_),
00138     jnlst_      (src.jnlst_),
00139     doFBBT_     (src.doFBBT_),
00140     doConvCuts_ (src.doConvCuts_) {}
00141     
00143   virtual OsiObject * clone () const
00144   {return new CouenneSOSObject (*this);}
00145 
00147   OsiBranchingObject *createBranch (OsiSolverInterface* si, 
00148                                     const OsiBranchingInformation* info, int way) const;
00149 
00151   //exprVar *Reference () const
00152   //{return reference_;}
00153 };
00154 
00155 }
00156 
00157 #endif

Generated on Mon Aug 8 03:06:40 2011 for Couenne by  doxygen 1.4.7