51 const int local_num_options = 13;
61 NULL_SPACE_JOURNAL_OUTPUT_LEVEL,
66 CALC_MATRIX_INFO_NULL_SPACE_ONLY
69 const char* local_SOptions[local_num_options] = {
76 (
"journal_output_level"),
77 (
"null_space_journal_output_level"),
78 (
"journal_print_digits"),
80 (
"calc_conditioning"),
81 (
"calc_matrix_norms"),
82 (
"calc_matrix_info_null_space_only")
87 namespace MoochoPack {
91 ,
const char opt_grp_name[] )
92 : OptionsFromStreamPack::SetOptionsFromStreamNode(
93 opt_grp_name, local_num_options, local_SOptions )
94 , OptionsFromStreamPack::SetOptionsToTargetBase<
101 namespace ofsp = OptionsFromStreamPack;
110 target().max_run_time(std::fabs(std::atof(option_value.c_str())));
113 target().opt_tol(std::fabs(std::atof(option_value.c_str())));
116 target().feas_tol(std::fabs(std::atof(option_value.c_str())));
119 target().comp_tol(std::fabs(std::atof(option_value.c_str())));
122 target().step_tol(std::fabs(std::atof(option_value.c_str())));
124 case JOURNAL_OUTPUT_LEVEL:
126 if( option_value ==
"PRINT_NOTHING" )
128 else if( option_value ==
"PRINT_BASIC_ALGORITHM_INFO" )
130 else if( option_value ==
"PRINT_ALGORITHM_STEPS" )
132 else if( option_value ==
"PRINT_ACTIVE_SET" )
134 else if( option_value ==
"PRINT_VECTORS" )
136 else if( option_value ==
"PRINT_ITERATION_QUANTITIES" )
140 true,std::invalid_argument
141 ,
"NLPSolverClientInterfaceSetOptions::setOption(...) : "
142 "Error, incorrect value \""<<option_value<<
"\" for \"journal_output_level\"." );
144 target().null_space_journal_output_level(
target().journal_output_level());
147 case NULL_SPACE_JOURNAL_OUTPUT_LEVEL:
149 if( option_value ==
"DEFAULT" )
150 target().null_space_journal_output_level(
target().journal_output_level());
151 else if( option_value ==
"PRINT_ACTIVE_SET" )
153 else if( option_value ==
"PRINT_VECTORS" )
155 else if( option_value ==
"PRINT_ITERATION_QUANTITIES" )
159 true,std::invalid_argument
160 ,
"NLPSolverClientInterfaceSetOptions::setOption(...) : "
161 "Error, incorrect value \""<<option_value<<
"\" for \"null_space_journal_output_level\"." );
164 case JOURNAL_PRINT_DIGITS:
165 target().journal_print_digits(
std::abs(std::atoi(option_value.c_str())));
172 case CALC_CONDITIONING:
173 target().calc_conditioning(
174 StringToBool(
"calc_conditioning", option_value.c_str() )
177 case CALC_MATRIX_NORMS:
178 target().calc_matrix_norms(
179 StringToBool(
"calc_matrix_norms", option_value.c_str() )
182 case CALC_MATRIX_INFO_NULL_SPACE_ONLY:
183 target().calc_matrix_info_null_space_only(
184 StringToBool(
"calc_matrix_info_null_space_only", 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_EXCEPTION(throw_exception_test, Exception, msg)
void abs(DVectorSlice *vs_lhs, const DVectorSlice &vs_rhs)
vs_lhs = abs(vs_rhs)
NLPSolverClientInterface & target()
NLPSolverClientInterfaceSetOptions(NLPSolverClientInterface *target=0, const char opt_grp_name[]="NLPSolverClientInterface")
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
This is the most basic interface that clients use to solve an NLP.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const std::string & option_value(OptionsGroup::const_iterator &itr)