45 #include "MoochoPack_InitFinDiffReducedHessian_StepSetOptions.hpp"
46 #include "OptionsFromStreamPack_StringToBool.hpp"
51 const int local_num_options = 4;
54 INITIALIZATION_METHOD,
60 const char* local_SOptions[local_num_options] = {
61 "initialization_method",
69 namespace MoochoPack {
73 ,
const char opt_grp_name[] )
74 : OptionsFromStreamPack::SetOptionsFromStreamNode(
75 opt_grp_name, local_num_options, local_SOptions )
76 , OptionsFromStreamPack::SetOptionsToTargetBase<
81 int option_num,
const std::string& option_value )
84 switch( (local_EOptions)option_num ) {
85 case INITIALIZATION_METHOD:
87 const std::string &option = option_value.c_str();
88 if( option ==
"SCALE_IDENTITY" )
89 target().initialization_method( target_t::SCALE_IDENTITY );
90 else if( option ==
"SCALE_DIAGONAL" )
91 target().initialization_method( target_t::SCALE_DIAGONAL );
92 else if( option ==
"SCALE_DIAGONAL_ABS" )
93 target().initialization_method( target_t::SCALE_DIAGONAL_ABS );
95 throw std::invalid_argument(
"Error, incorrect value for "
96 "\"initialization_method\"." );
100 target().max_cond(std::fabs(std::atof(option_value.c_str())));
103 target().min_diag(std::abs(std::atoi(option_value.c_str())));
106 target().step_scale(std::fabs(std::atof(option_value.c_str())));
InitFinDiffReducedHessian_StepSetOptions(InitFinDiffReducedHessian_Step *target=0, const char opt_grp_name[]="InitFinDiffReducedHessian")
Initializes the reduced hessian using a single finite difference along the null space of the constrai...
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)