52 const int local_num_options = 8;
65 const char* local_SOptions[local_num_options] = {
78 namespace ConstrainedOptPack {
82 ,
const char opt_grp_name[] )
83 : OptionsFromStreamPack::SetOptionsFromStreamNode(
84 opt_grp_name, local_num_options, local_SOptions )
85 , OptionsFromStreamPack::SetOptionsToTargetBase<
97 const std::string &option = option_value.c_str();
98 if( option ==
"PRINT_NONE" )
99 target().print_tests( target_t::PRINT_NONE );
100 else if( option ==
"PRINT_BASIC" )
101 target().print_tests( target_t::PRINT_BASIC );
102 else if( option ==
"PRINT_MORE" )
103 target().print_tests( target_t::PRINT_MORE );
104 else if( option ==
"PRINT_ALL" )
105 target().print_tests( target_t::PRINT_ALL );
108 true, std::invalid_argument
109 ,
"Error, incorrect value for "
110 "\"print_tests\". Only the options "
111 "PRINT_NONE, PRINT_BASIS, PRINT_MORE and PRINT_ALL are allowed" );
124 case NUM_RANDOM_TESTS:
125 target().num_random_tests(
std::abs(std::atoi(option_value.c_str())));
127 case MULT_WARNING_TOL:
128 target().mult_warning_tol(std::fabs(std::atof(option_value.c_str())));
131 target().mult_error_tol(std::fabs(std::atof(option_value.c_str())));
133 case SOLVE_WARNING_TOL:
134 target().solve_warning_tol(std::fabs(std::atof(option_value.c_str())));
136 case SOLVE_ERROR_TOL:
137 target().solve_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#.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void abs(DVectorSlice *vs_lhs, const DVectorSlice &vs_rhs)
vs_lhs = abs(vs_rhs)
DecompositionSystemTester & target()
DecompositionSystemTesterSetOptions(DecompositionSystemTester *target=0, const char opt_grp_name[]="DecompositionSystemTester")
Testing class for DecompositionSystem interface.
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)