24 #include <queso/config_queso.h>
25 #include <queso/InfiniteDimensionalMCMCSamplerOptions.h>
28 #define UQ_INF_DATA_OUTPUT_DIR_NAME_ODV "chain"
29 #define UQ_INF_DATA_OUTPUT_FILE_NAME_ODV "out.h5"
30 #define UQ_INF_NUM_ITERS_ODV 1000
31 #define UQ_INF_SAVE_FREQ_ODV 1
32 #define UQ_INF_RWMH_STEP_ODV 1e-2
39 : m_prefix((std::string)(prefix) +
"infmcmc_"),
40 m_dataOutputDirName(UQ_INF_DATA_OUTPUT_DIR_NAME_ODV),
42 m_num_iters(UQ_INF_NUM_ITERS_ODV),
43 m_save_freq(UQ_INF_SAVE_FREQ_ODV),
44 m_rwmh_step(UQ_INF_RWMH_STEP_ODV),
45 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
49 m_option_help(m_prefix +
"help"),
50 m_option_dataOutputDirName(m_prefix +
"dataOutputDirName"),
51 m_option_dataOutputFileName(m_prefix +
"dataOutputFileName"),
52 m_option_num_iters(m_prefix +
"num_iters"),
53 m_option_save_freq(m_prefix +
"save_freq"),
54 m_option_rwmh_step(m_prefix +
"rwmh_step")
58 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
79 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
88 queso_require_greater_msg(
m_rwmh_step, 0,
"random-walk Metropolis step size must be positive");
109 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
110 os << (*(obj.
m_parser)) << std::endl;
111 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
116 const BaseEnvironment&
void print(std::ostream &os) const
Prints this to os.
std::string m_option_rwmh_step
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
void getOption(const std::string &name, T &value) const
Get option name from the parser and set value to the parsed value.
std::string m_option_dataOutputDirName
unsigned int m_num_iters
The total number of iterations to do.
std::string m_dataOutputFileName
Name of the HDF5 output file to store chain statistics.
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
std::string m_dataOutputDirName
Name of the output dir to save infinite dimensional output files to.
double m_rwmh_step
The proposal step size.
const GetPot & input() const
The GetPot input file parser.
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix queso_require_not_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the absence of an options input file"))
InfiniteDimensionalMCMCSamplerOptions(const BaseEnvironment &env, const char *prefix)
Given prefix, read the input file for parameters named prefix_*.
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
const BaseEnvironment & env() const
Returns the QUESO environment.
const BaseEnvironment & m_env
void registerOption(const std::string &name, const T &defaultValue, const std::string &description)
Call this to register an option with the parser.
std::string m_option_save_freq
std::string m_option_num_iters
virtual ~InfiniteDimensionalMCMCSamplerOptions()
Destructor.
void scanInputFile()
This is the method that parses the input file.
unsigned int m_save_freq
The frequency at which to save the state of the chain.
BoostInputOptionsParser * m_parser
This class defines the options that specify the behaviour of the MCMC sampler.
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues queso_require_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"))
std::string m_option_help
std::string m_option_dataOutputFileName