25 #include <boost/program_options.hpp>
27 #include <queso/Defines.h>
28 #include <queso/StatisticalInverseProblemOptions.h>
29 #include <queso/Miscellaneous.h>
48 m_option_help (m_prefix +
"help" ),
49 m_option_computeSolution (m_prefix +
"computeSolution" ),
50 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
51 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
52 #ifdef UQ_SIP_READS_SOLVER_OPTION
53 m_option_solver (m_prefix +
"solver" ),
54 m_solverString (UQ_SIP_SOLVER_ODV)
56 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
57 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
64 m_prefix((std::string)(prefix) +
"ip_"),
72 m_option_help (m_prefix +
"help" ),
73 m_option_computeSolution (m_prefix +
"computeSolution" ),
74 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
75 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
76 #ifdef UQ_SIP_READS_SOLVER_OPTION
77 m_option_solver (m_prefix +
"solver" ),
78 m_solverString (UQ_SIP_SOLVER_ODV)
80 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
81 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
87 #ifdef UQ_SIP_READS_SOLVER_OPTION
99 #ifdef UQ_SIP_READS_SOLVER_OPTION
137 #ifdef UQ_SIP_READS_SOLVER_OPTION
138 m_solverString = src.m_solverString;
153 #ifdef UQ_SIP_READS_SOLVER_OPTION
154 <<
"\n" << obj.m_option_solver <<
" = " << obj.m_solverString
170 m_prefix ((std::string)(prefix) +
"ip_"),
172 m_optionsDesc (new boost::program_options::options_description(
"Statistical Inverse Problem options")),
173 m_option_help (m_prefix +
"help" ),
174 m_option_computeSolution (m_prefix +
"computeSolution" ),
175 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
176 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
177 #ifdef UQ_SIP_READS_SOLVER_OPTION
178 m_option_solver (m_prefix +
"solver" )
180 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
181 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
193 m_ov (alternativeOptionsValues),
194 m_prefix ((std::string)(prefix) +
"ip_"),
196 m_optionsDesc (NULL),
197 m_option_help (m_prefix +
"help" ),
198 m_option_computeSolution (m_prefix +
"computeSolution" ),
199 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
200 m_option_dataOutputAllowedSet(m_prefix +
"dataOutputAllowedSet"),
201 #ifdef UQ_SIP_READS_SOLVER_OPTION
202 m_option_solver (m_prefix +
"solver" )
204 m_option_seedWithMAPEstimator(m_prefix +
"seedWithMAPEstimator"),
205 m_option_useOptimizerMonitor(m_prefix +
"useOptimizerMonitor")
213 <<
": after setting values of options with prefix '" <<
m_prefix
214 <<
"', state of object is:"
238 <<
": after reading values of options with prefix '" <<
m_prefix
239 <<
"', state of object is:"
259 #ifdef UQ_SIP_READS_SOLVER_OPTION
260 <<
"\n" << m_option_solver <<
" = " <<
m_ov.m_solverString
274 optionsDesc.add_options()
275 (
m_option_help.c_str(),
"produce help message for statistical inverse problem")
279 #ifdef UQ_SIP_READS_SOLVER_OPTION
280 (m_option_solver.c_str(), boost::program_options::value<std::string>()->default_value(UQ_SIP_SOLVER_ODV ),
"algorithm for calibration" )
309 std::vector<double> tmpAllow(0,0.);
313 if (tmpAllow.size() > 0) {
314 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
320 #ifdef UQ_SIP_READS_SOLVER_OPTION
322 m_ov.m_solverString = ((
const boost::program_options::variable_value&)
m_env.
allOptionsMap()[m_option_solver]).as<std::string>();
#define UQ_SIP_COMPUTE_SOLUTION_ODV
std::string m_option_dataOutputFileName
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
std::string m_option_seedWithMAPEstimator
std::string m_option_help
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
BoostInputOptionsParser * m_parser
void print(std::ostream &os) const
It prints the option values.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SIP options as the default options.
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
#define queso_deprecated()
std::string m_option_dataOutputAllowedSet
boost::program_options::variables_map & allOptionsMap() const
#define queso_require_msg(asserted, msg)
#define queso_require_equal_to_msg(expr1, expr2, msg)
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
#define UQ_SIP_SEEDWITHMAPESTIMATOR
std::string m_option_help
virtual ~SipOptionsValues()
Destructor.
SipOptionsValues()
Default constructor.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
bool m_seedWithMAPEstimator
void scanInputFile()
This is the method that parses the input file.
SipOptionsValues & operator=(const SipOptionsValues &rhs)
Assignment operator; it copies rhs to this.
#define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::string m_option_dataOutputFileName
#define UQ_SIP_USEOPTIMIZERMONITOR
std::string m_help
If this string is non-empty, options are print to the output file.
This class provides options for a Statistical Inverse Problem if no input file is available...
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::string m_option_dataOutputAllowedSet
std::string m_option_useOptimizerMonitor
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
void scanOptionsValues()
It scans the option values from the options input file.
std::string m_option_computeSolution
std::string m_option_useOptimizerMonitor
This class reads option values for a Statistical Inverse Problem from an input file.
std::set< unsigned int > m_dataOutputAllowedSet
~StatisticalInverseProblemOptions()
Destructor.
std::string m_dataOutputFileName
bool m_useOptimizerMonitor
const BaseEnvironment & m_env
boost::program_options::options_description * m_optionsDesc
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_option_computeSolution
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
std::string m_option_seedWithMAPEstimator
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)