47 #include "ReducedHessianBFGSStd_StepSetOptions.h"
53 const int local_num_options = 5;
63 const char* local_SOptions[local_num_options] = {
64 "rescale_init_identity"
73 namespace MoochoPack {
75 ReducedHessianBFGSStd_StepSetOptions::ReducedHessianBFGSStd_StepSetOptions(
76 ReducedHessianBFGSStd_Step* target
77 ,
const char opt_grp_name[] )
78 : OptionsFromStreamPack::SetOptionsFromStreamNode(
79 opt_grp_name, local_num_options, local_SOptions )
80 , OptionsFromStreamPack::SetOptionsToTargetBase<
81 ReducedHessianBFGSStd_Step >( target )
84 void ReducedHessianBFGSStd_StepSetOptions::setOption(
88 typedef ReducedHessianBFGSStd_Step target_t;
90 case RESCALE_INIT_IDENTITY:
91 target().rescale_init_identity(
92 StringToBool(
"rescale_init_identity", option_value.c_str() ));
95 target().use_dampening(
100 const std::string &option = option_value.c_str();
101 if( option ==
"DEFAULT" )
102 target().secant_testing( target_t::SECANT_TEST_DEFAULT );
103 else if( option ==
"TEST" )
104 target().secant_testing( target_t::SECANT_TEST_ALWAYS );
105 else if( option ==
"NO_TEST" )
106 target().secant_testing( target_t::SECANT_NO_TEST );
108 throw std::invalid_argument(
"Error, incorrect value for "
109 "\"secant_testing\"." );
112 case SECANT_WARNING_TOL:
113 target().secant_warning_tol(::fabs(::atof(option_value.c_str())));
115 case SECANT_ERROR_TOL:
116 target().secant_error_tol(::fabs(::atof(option_value.c_str())));
bool StringToBool(const char *opt_name, const char *str)
Convert a string "true" or "false" into bool #true# or #false#.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const std::string & option_value(OptionsGroup::const_iterator &itr)