51 const int local_num_options = 2;
54 REDUCED_HESSIAN_INPUT_FILE_NAME
55 ,REDUCED_HESSIAN_OUTPUT_FILE_NAME
58 const char* local_SOptions[local_num_options] = {
59 "reduced_hessian_input_file_name"
60 ,
"reduced_hessian_output_file_name"
64 std::string remove_quotes(
const std::string &
option_name,
const std::string &str )
67 str[0]!=
'\"' || str[str.length()-1]!=
'\"', std::logic_error
68 ,
"Error, the option \'" << option_name <<
"\' must have a single set of quotes around it!"
71 return std::string(
"");
72 return str.substr(1,str.length()-2);
77 namespace MoochoPack {
79 ReducedHessianSerialization_StepSetOptions::ReducedHessianSerialization_StepSetOptions(
80 ReducedHessianSerialization_Step* target
81 ,
const char opt_grp_name[] )
82 : OptionsFromStreamPack::SetOptionsFromStreamNode(
83 opt_grp_name, local_num_options, local_SOptions )
84 , OptionsFromStreamPack::SetOptionsToTargetBase<
85 ReducedHessianSerialization_Step >( target )
88 void ReducedHessianSerialization_StepSetOptions::setOption(
93 typedef ReducedHessianSerialization_Step target_t;
95 case REDUCED_HESSIAN_INPUT_FILE_NAME : {
96 target().reduced_hessian_input_file_name(remove_quotes(
"reduced_hessian_input_file_name",option_value));
99 case REDUCED_HESSIAN_OUTPUT_FILE_NAME : {
100 target().reduced_hessian_output_file_name(remove_quotes(
"reduced_hessian_output_file_name",option_value));
bool StringToBool(const char *opt_name, const char *str)
Convert a string "true" or "false" into bool #true# or #false#.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const std::string & option_name(OptionsGroup::const_iterator &itr)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const std::string & option_value(OptionsGroup::const_iterator &itr)