Ignore:
Timestamp:
Jul 29, 2005 3:11:41 PM (14 years ago)
Author:
andreasw
Message:
  • revised handling of "acceptable level of accuracy" (now in ConvCheck?)
  • fixed uncaught evaluation error exceptions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/Algorithm/IpRestoIpoptNLP.cpp

    r414 r416  
    2222{
    2323  DBG_SET_VERBOSITY(0);
     24
     25  DefineIpoptType(RestoIpoptNLP);
    2426
    2527  RestoIpoptNLP::RestoIpoptNLP(IpoptNLP& orig_ip_nlp,
     
    3941  {}
    4042
     43  void RestoIpoptNLP::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
     44  {
     45    roptions->AddStringOption2(
     46      "evaluate_orig_obj_at_resto_trial",
     47      "Determines if the original objective function should be evalutated at restoration phase trial points.",
     48      "yes",
     49      "no", "skip evaluation",
     50      "yes", "evaluate at every trial point",
     51      "Setting this option to true makes the restoration phase algorithm "
     52      "evaluate the objective function of the original problem at every trial "
     53      "point encountered during the restoration phase, even if this value is "
     54      "not required.  In this way, it is guaranteed that the original "
     55      "objective function can be evaluated without error at all accepted "
     56      "iterates; otherwise the algorithm might fail at a point where the "
     57      "restoration phase accepts an iterate that is good for the restoration "
     58      "phase problem, but not the original problem.  On the other hand, if "
     59      "the evaluation of the original objective is expensive, this might be "
     60      "costly.");
     61  }
     62
    4163  bool RestoIpoptNLP::Initialize(const Journalist& jnlst,
    4264                                 const OptionsList& options,
    4365                                 const std::string& prefix)
    4466  {
     67    options.GetBoolValue("evaluate_orig_obj_at_resto_trial",
     68                         evaluate_orig_obj_at_resto_trial_, prefix);
     69
    4570    initialized_ = true;
    46     return true;
     71    return IpoptNLP::Initialize(jnlst, options, prefix);
    4772  }
    4873
     
    281306    // All remaining blocks are zero'ed out
    282307
     308    SmartPtr<const MatrixSpace> scaled_jac_c_space;
     309    SmartPtr<const MatrixSpace> scaled_jac_d_space;
     310    SmartPtr<const SymMatrixSpace> scaled_h_space;
     311    NLP_scaling()->DetermineScaling(GetRawPtr(x_space_),
     312                                    c_space_, d_space_,
     313                                    GetRawPtr(jac_c_space_),
     314                                    GetRawPtr(jac_d_space_),
     315                                    GetRawPtr(h_space_),
     316                                    scaled_jac_c_space, scaled_jac_d_space,
     317                                    scaled_h_space);
     318    // For now we assume that no scaling is done inside the NLP_Scaling
     319    DBG_ASSERT(scaled_jac_c_space == jac_c_space_);
     320    DBG_ASSERT(scaled_jac_d_space == jac_d_space_);
     321    DBG_ASSERT(scaled_h_space == h_space_);
     322
    283323    ///////////////////////////
    284324    // Create the bound data //
     
    411451
    412452    ret += ret2;
     453
     454    // We evaluate also the objective function for the original
     455    // problem here.  This might be wasteful, but it will detect if
     456    // the original objective function cannot be evaluated at the
     457    // trial point in the restoration phase
     458    if (evaluate_orig_obj_at_resto_trial_) {
     459      Number orig_f = orig_ip_nlp_->f(*x_only);
     460    }
     461
    413462    return ret;
    414463  }
Note: See TracChangeset for help on using the changeset viewer.