/home/coin/SVN-release/OS-2.0.0/Couenne/src/disjunctive/CouenneDisjCuts.cpp

Go to the documentation of this file.
00001 /* $Id: CouenneDisjCuts.cpp 141 2009-06-03 04:19:19Z pbelotti $ */
00002 /*
00003  * Name:    CouenneDisjCuts.cpp
00004  * Author:  Pietro Belotti
00005  * Purpose: methods for the disjunctive cuts
00006  *
00007  * (C) Carnegie-Mellon University, 2008. 
00008  * This file is licensed under the Common Public License (CPL)
00009  */
00010 
00011 #include "CouenneDisjCuts.hpp"
00012 #include "CouenneProblem.hpp"
00013 #include "CouenneSolverInterface.hpp"
00014 
00015 
00017 CouenneDisjCuts::CouenneDisjCuts (Bonmin::OsiTMINLPInterface *minlp,
00018                                   Bonmin::BabSetupBase *base,
00019                                   CouenneCutGenerator *cg,
00020                                   OsiChooseVariable *bcv,
00021                                   bool is_strong,
00022                                   JnlstPtr journalist,
00023                                   const Ipopt::SmartPtr<Ipopt::OptionsList> options):
00024   couenneCG_          (cg),
00025   nrootcuts_          (-1), // to indicate first iteration not done yet
00026   ntotalcuts_         (0),
00027   septime_            (0.),
00028   objValue_           (-COIN_DBL_MAX),
00029   minlp_              (minlp),
00030   branchingMethod_    (bcv),
00031   isBranchingStrong_  (is_strong),
00032   jnlst_              (journalist),
00033   activeRows_         (false),
00034   activeCols_         (false),
00035   addPreviousCut_     (false),
00036   cpuTime_            (-1.) {
00037 
00038   options -> GetNumericValue ("time_limit", cpuTime_,  "couenne.");
00039 
00040   options -> GetNumericValue ("disj_init_perc",   initDisjPercentage_,  "couenne.");
00041   options -> GetIntegerValue ("disj_init_number", initDisjNumber_,      "couenne.");
00042   options -> GetIntegerValue ("disj_depth_level", depthLevelling_,      "couenne.");
00043   options -> GetIntegerValue ("disj_depth_stop",  depthStopSeparate_,   "couenne.");
00044 
00045   std::string s;
00046   options -> GetStringValue ("disj_active_rows", s, "couenne."); activeRows_     = (s == "yes");
00047   options -> GetStringValue ("disj_active_cols", s, "couenne."); activeCols_     = (s == "yes");
00048   options -> GetStringValue ("disj_cumulative",  s, "couenne."); addPreviousCut_ = (s == "yes");
00049 }
00050 
00051 
00053 CouenneDisjCuts::CouenneDisjCuts (const CouenneDisjCuts &src):
00054   couenneCG_          (src.couenneCG_),
00055   nrootcuts_          (src.nrootcuts_),
00056   ntotalcuts_         (src.ntotalcuts_),
00057   septime_            (src.septime_),
00058   objValue_           (src.objValue_),
00059   minlp_              (src.minlp_),
00060   branchingMethod_    (src.branchingMethod_),
00061   isBranchingStrong_  (src.isBranchingStrong_),
00062   jnlst_              (src.jnlst_),
00063   initDisjPercentage_ (src.initDisjPercentage_),
00064   initDisjNumber_     (src.initDisjNumber_),
00065   depthLevelling_     (src.depthLevelling_),
00066   depthStopSeparate_  (src.depthStopSeparate_),
00067   activeRows_         (src.activeRows_),
00068   activeCols_         (src.activeCols_),
00069   addPreviousCut_     (src.addPreviousCut_),
00070   cpuTime_            (src.cpuTime_) {}
00071 
00072 
00074 void CouenneDisjCuts::registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions) {
00075 
00076   roptions -> AddLowerBoundedIntegerOption
00077     ("minlp_disj_cuts",
00078      "The frequency (in terms of nodes) at which Couenne disjunctive cuts are generated.",
00079      -99, 0,
00080      "A frequency of 0 (default) means these cuts are never generated.");
00081 
00082   roptions -> AddLowerBoundedIntegerOption
00083     ("disj_init_number",
00084      "Maximum number of disjunction to consider at each iteration (-1 for unlimited, default 10).",
00085      -1, 10, "");
00086 
00087   roptions -> AddBoundedNumberOption
00088     ("disj_init_perc",
00089      "The maximum fraction of OsiObjects to consider for generating disjunctions",
00090      0., false,
00091      1., false,
00092      0.5, "");
00093 
00094   roptions -> AddLowerBoundedIntegerOption
00095     ("disj_depth_level",
00096      "Depth of the BB tree when to start decreasing the number of objects that generate disjunctions.",
00097      -1, 5, "");
00098 
00099   roptions -> AddLowerBoundedIntegerOption
00100     ("disj_depth_stop",
00101      "Depth of the BB tree where separation is stopped.",
00102      -1, 20, "");
00103 
00104   roptions -> AddStringOption2
00105     ("disj_active_rows",
00106      "Only include active rows in the CGLP.",
00107      "no", 
00108      "yes", "",
00109      "no", "");
00110 
00111   roptions -> AddStringOption2
00112     ("disj_active_cols",
00113      "Only include active cols in the CGLP.",
00114      "no", 
00115      "yes", "",
00116      "no", "");
00117 
00118   roptions -> AddStringOption2
00119     ("disj_cumulative",
00120      "Add previous disj. cut to current CGLP.",
00121      "no", 
00122      "yes", "",
00123      "no", "");
00124 }

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