51 const int local_num_options = 5;
61 const char* local_SOptions[local_num_options] = {
62 "rescale_init_identity"
71 namespace MoochoPack {
75 ,
const char opt_grp_name[] )
76 : OptionsFromStreamPack::SetOptionsFromStreamNode(
77 opt_grp_name, local_num_options, local_SOptions )
78 , OptionsFromStreamPack::SetOptionsToTargetBase<
88 case RESCALE_INIT_IDENTITY:
89 target().rescale_init_identity(
90 StringToBool(
"rescale_init_identity", option_value.c_str() ));
98 const std::string &option = option_value.c_str();
99 if( option ==
"DEFAULT" )
100 target().secant_testing( target_t::SECANT_TEST_DEFAULT );
101 else if( option ==
"TEST" )
102 target().secant_testing( target_t::SECANT_TEST_ALWAYS );
103 else if( option ==
"NO_TEST" )
104 target().secant_testing( target_t::SECANT_NO_TEST );
106 throw std::invalid_argument(
"Error, incorrect value for "
107 "\"secant_testing\"." );
110 case SECANT_WARNING_TOL:
111 target().secant_warning_tol(std::fabs(std::atof(option_value.c_str())));
113 case SECANT_ERROR_TOL:
114 target().secant_error_tol(std::fabs(std::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#.
BFGSUpdate_Strategy & target()
BFGSUpdate_StrategySetOptions(BFGSUpdate_Strategy *target=0, const char opt_grp_name[]="BFGSUpdate")
Strategy interface which contains the guts for a dampened BFGS update.
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const std::string & option_value(OptionsGroup::const_iterator &itr)