45 #include "ConstrainedOptPack_DecompositionSystemTesterSetOptions.hpp" 46 #include "OptionsFromStreamPack_StringToBool.hpp" 47 #include "Teuchos_Assert.hpp" 52 const int local_num_options = 8;
57 ,TEUCHOS_TEST_FOR_EXCEPTION
65 const char* local_SOptions[local_num_options] = {
82 ,
const char opt_grp_name[] )
84 opt_grp_name, local_num_options, local_SOptions )
90 int option_num,
const std::string& option_value )
92 using OptionsFromStreamPack::StringToBool;
94 switch( (local_EOptions)option_num ) {
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 );
107 TEUCHOS_TEST_FOR_EXCEPTION(
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" );
116 StringToBool(
"dump_all", option_value.c_str() )
119 case TEUCHOS_TEST_FOR_EXCEPTION:
121 StringToBool(
"throw_exception", option_value.c_str() )
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())));
140 TEUCHOS_TEST_FOR_EXCEPT(
true);
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.