47 #include "MoochoPack_MeritFunc_ModifiedL1LargerSteps_AddedStepSetOptions.hpp"
48 #include "OptionsFromStreamPack_StringToBool.hpp"
53 const int local_num_options = 5;
55 const char options_group_name[] =
"MeritFuncModifiedL1LargerSteps";
59 OBJ_INCREASE_THRESHOLD,
60 MAX_POS_PENALTY_INCREASE,
61 POS_TO_NEG_PENALTY_INCREASE,
65 const char* local_SOptions[local_num_options] = {
67 "obj_increase_threshold",
68 "max_pos_penalty_increase",
69 "pos_to_neg_penalty_increase",
75 namespace MoochoPack {
78 MeritFunc_ModifiedL1LargerSteps_AddedStep* target )
79 : OptionsFromStreamPack::SetOptionsFromStreamNode(
80 options_group_name, local_num_options, local_SOptions )
81 , OptionsFromStreamPack::SetOptionsToTargetBase<
82 MeritFunc_ModifiedL1LargerSteps_AddedStep >( target )
86 int option_num,
const std::string& option_value )
88 switch( (local_EOptions)option_num ) {
90 target().after_k_iter( ::atoi( option_value.c_str() ) );
93 case OBJ_INCREASE_THRESHOLD: {
94 target().obj_increase_threshold( ::atof( option_value.c_str() ) );
97 case MAX_POS_PENALTY_INCREASE: {
98 target().max_pos_penalty_increase( ::fabs( ::atof( option_value.c_str() ) ) );
101 case POS_TO_NEG_PENALTY_INCREASE: {
102 target().pos_to_neg_penalty_increase( ::fabs( ::atof( option_value.c_str() ) ) );
105 case INCR_MULT_FACTOR: {
106 target().incr_mult_factor( ::fabs( ::atof( option_value.c_str() ) ) );
MeritFunc_ModifiedL1LargerSteps_AddedStepSetOptions(MeritFunc_ModifiedL1LargerSteps_AddedStep *target=0)
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)