Changeset 251


Ignore:
Timestamp:
Aug 22, 2009 9:03:41 AM (12 years ago)
Author:
stefan
Message:

merge changeset 250 from trunk into stable: allow init of options after CouenneProblem? has been constructed

Location:
stable/0.2/Couenne/src/problem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/0.2/Couenne/src/problem/CouenneProblem.hpp

    r159 r251  
    194194  CouenneProblem  (const CouenneProblem &); ///< Copy constructor
    195195  ~CouenneProblem ();                       ///< Destructor
     196
     197  /// initializes parameters like doOBBT
     198  void initOptions(SmartPtr<OptionsList> options);
    196199
    197200  /// Clone method (for use within CouenneCutGenerator::clone)
  • stable/0.2/Couenne/src/problem/CouenneProblemConstructors.cpp

    r159 r251  
    8585  auxSet_ = new std::set <exprAux *, compExpr>;
    8686
    87   if (base) {
    88     std::string s;
    89     base -> options() -> GetStringValue ("use_quadratic", s, "couenne.");
    90     useQuadratic_ = (s == "yes");
    91   }
    92 
    93   if (base) {
    94 
    95     std::string s;
    96 
    97     base -> options() -> GetStringValue ("feasibility_bt",  s, "couenne."); doFBBT_ = (s == "yes");
    98     base -> options() -> GetStringValue ("redcost_bt",      s, "couenne."); doRCBT_ = (s == "yes");
    99     base -> options() -> GetStringValue ("optimality_bt",   s, "couenne."); doOBBT_ = (s == "yes");
    100     base -> options() -> GetStringValue ("aggressive_fbbt", s, "couenne."); doABT_  = (s == "yes");
    101 
    102     base -> options() -> GetIntegerValue ("log_num_obbt_per_level", logObbtLev_, "couenne.");
    103     base -> options() -> GetIntegerValue ("log_num_abt_per_level",  logAbtLev_,  "couenne.");
    104 
    105     base -> options() -> GetNumericValue ("feas_tolerance",  feas_tolerance_, "couenne.");
    106     base -> options() -> GetNumericValue ("opt_window",      opt_window_,     "couenne.");
    107   }
     87  if (base)
     88        initOptions(base -> options());
    10889}
    10990
     
    224205    free (unusedOriginalsIndices_);
    225206}
     207
     208/// initializes parameters like doOBBT
     209void CouenneProblem::initOptions(SmartPtr<OptionsList> options)
     210{
     211        assert(IsValid(options));
     212
     213  std::string s;
     214  options -> GetStringValue ("use_quadratic",   s, "couenne."); useQuadratic_ = (s == "yes");
     215  options -> GetStringValue ("feasibility_bt",  s, "couenne."); doFBBT_ = (s == "yes");
     216  options -> GetStringValue ("redcost_bt",      s, "couenne."); doRCBT_ = (s == "yes");
     217  options -> GetStringValue ("optimality_bt",   s, "couenne."); doOBBT_ = (s == "yes");
     218  options -> GetStringValue ("aggressive_fbbt", s, "couenne."); doABT_  = (s == "yes");
     219
     220  options -> GetIntegerValue ("log_num_obbt_per_level", logObbtLev_, "couenne.");
     221  options -> GetIntegerValue ("log_num_abt_per_level",  logAbtLev_,  "couenne.");
     222
     223  options -> GetNumericValue ("feas_tolerance",  feas_tolerance_, "couenne.");
     224  options -> GetNumericValue ("opt_window",      opt_window_,     "couenne.");
     225}
Note: See TracChangeset for help on using the changeset viewer.