25 #include <queso/MonteCarloSGOptions.h>
26 #include <queso/Miscellaneous.h>
36 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
37 const SsOptionsValues* alternativePSsOptionsValues,
38 const SsOptionsValues* alternativeQSsOptionsValues
48 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
60 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
63 m_alternativePSsOptionsValues(),
64 m_alternativeQSsOptionsValues()
67 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
68 if (alternativePSsOptionsValues) m_alternativePSsOptionsValues = *alternativePSsOptionsValues;
69 if (alternativeQSsOptionsValues) m_alternativeQSsOptionsValues = *alternativeQSsOptionsValues;
98 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
99 m_pseqComputeStats = src.m_pseqComputeStats;
110 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
111 m_qseqComputeStats = src.m_qseqComputeStats;
114 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
115 m_alternativePSsOptionsValues = src.m_alternativePSsOptionsValues;
116 m_alternativeQSsOptionsValues = src.m_alternativeQSsOptionsValues;
131 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
133 m_pseqStatisticalOptionsObj (NULL),
134 m_qseqStatisticalOptionsObj (NULL),
138 m_prefix ((std::string)(prefix) +
"mc_"),
140 m_optionsDesc (new po::options_description(
"Monte Carlo options")),
141 m_option_help (m_prefix +
"help" ),
142 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
143 m_option_dataOutputAllowedSet (m_prefix +
"dataOutputAllowedSet" ),
144 m_option_pseq_dataOutputPeriod (m_prefix +
"pseq_dataOutputPeriod" ),
145 m_option_pseq_dataOutputFileName (m_prefix +
"pseq_dataOutputFileName" ),
146 m_option_pseq_dataOutputFileType (m_prefix +
"pseq_dataOutputFileType" ),
147 m_option_pseq_dataOutputAllowedSet(m_prefix +
"pseq_dataOutputAllowedSet" ),
148 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
149 m_option_pseq_computeStats (m_prefix +
"pseq_computeStats" ),
151 m_option_qseq_dataInputFileName (m_prefix +
"qseq_dataInputFileName" ),
152 m_option_qseq_dataInputFileType (m_prefix +
"qseq_dataInputFileType" ),
153 m_option_qseq_size (m_prefix +
"qseq_size" ),
154 m_option_qseq_displayPeriod (m_prefix +
"qseq_displayPeriod" ),
155 m_option_qseq_measureRunTimes (m_prefix +
"qseq_measureRunTimes" ),
156 m_option_qseq_dataOutputPeriod (m_prefix +
"qseq_dataOutputPeriod" ),
157 m_option_qseq_dataOutputFileName (m_prefix +
"qseq_dataOutputFileName" ),
158 m_option_qseq_dataOutputFileType (m_prefix +
"qseq_dataOutputFileType" ),
159 m_option_qseq_dataOutputAllowedSet(m_prefix +
"qseq_dataOutputAllowedSet" )
160 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
162 m_option_qseq_computeStats (m_prefix +
"qseq_computeStats" )
167 "MonteCarloSGOptions::constructor(1)",
168 "this constructor is incompatible with the absence of an options input file");
176 m_ov (alternativeOptionsValues),
177 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
178 m_pseqStatisticalOptionsObj (NULL),
179 m_qseqStatisticalOptionsObj (NULL),
181 m_prefix ((std::string)(prefix) +
"mc_"),
183 m_optionsDesc (NULL),
184 m_option_help (m_prefix +
"help" ),
185 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
186 m_option_dataOutputAllowedSet (m_prefix +
"dataOutputAllowedSet" ),
187 m_option_pseq_dataOutputPeriod (m_prefix +
"pseq_dataOutputPeriod" ),
188 m_option_pseq_dataOutputFileName (m_prefix +
"pseq_dataOutputFileName" ),
189 m_option_pseq_dataOutputFileType (m_prefix +
"pseq_dataOutputFileType" ),
190 m_option_pseq_dataOutputAllowedSet(m_prefix +
"pseq_dataOutputAllowedSet"),
191 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
192 m_option_pseq_computeStats (m_prefix +
"pseq_computeStats" ),
194 m_option_qseq_dataInputFileName (m_prefix +
"qseq_dataInputFileName" ),
195 m_option_qseq_dataInputFileType (m_prefix +
"qseq_dataInputFileType" ),
196 m_option_qseq_size (m_prefix +
"qseq_size" ),
197 m_option_qseq_displayPeriod (m_prefix +
"qseq_displayPeriod" ),
198 m_option_qseq_measureRunTimes (m_prefix +
"qseq_measureRunTimes" ),
199 m_option_qseq_dataOutputPeriod (m_prefix +
"qseq_dataOutputPeriod" ),
200 m_option_qseq_dataOutputFileName (m_prefix +
"qseq_dataOutputFileName" ),
201 m_option_qseq_dataOutputFileType (m_prefix +
"qseq_dataOutputFileType" ),
202 m_option_qseq_dataOutputAllowedSet(m_prefix +
"qseq_dataOutputAllowedSet")
203 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
205 m_option_qseq_computeStats (m_prefix +
"qseq_computeStats" )
210 "MonteCarloSGOptions::constructor(2)",
211 "this constructor is incompatible with the existence of an options input file");
215 <<
": after setting values of options with prefix '" <<
m_prefix
216 <<
"', state of object is:"
222 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
223 if (
m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
224 new SequenceStatisticalOptions(
m_env,
m_prefix +
"pseq_",
m_ov.m_alternativePSsOptionsValues);
225 if (
m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
226 new SequenceStatisticalOptions(
m_env,
m_prefix +
"qseq_",
m_ov.m_alternativeQSsOptionsValues);
232 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
233 if (m_pseqStatisticalOptionsObj)
delete m_pseqStatisticalOptionsObj;
234 if (m_qseqStatisticalOptionsObj)
delete m_qseqStatisticalOptionsObj;
244 "MonteCarloSGOptions::scanOptionsValues()",
245 "m_optionsDesc variable is NULL");
253 <<
": after reading values of options with prefix '" <<
m_prefix
254 <<
"', state of object is:"
260 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
261 if (
m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
263 if (
m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
272 optionsDesc.add_options()
273 (
m_option_help.c_str(),
"produce help message for Monte Carlo distribution calculator")
280 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
292 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
316 std::vector<double> tmpAllow(0,0.);
320 if (tmpAllow.size() > 0) {
321 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
341 std::vector<double> tmpAllow(0,0.);
345 if (tmpAllow.size() > 0) {
346 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
352 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
354 m_ov.m_pseqComputeStats = ((
const po::variable_value&)
m_env.
allOptionsMap()[m_option_pseq_computeStats]).as<bool>();
391 std::vector<double> tmpAllow(0,0.);
395 if (tmpAllow.size() > 0) {
396 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
402 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
404 m_ov.m_qseqComputeStats = ((
const po::variable_value&)
m_env.
allOptionsMap()[m_option_qseq_computeStats]).as<bool>();
426 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
427 <<
"\n" << m_option_pseq_computeStats <<
" = " <<
m_ov.m_pseqComputeStats
441 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
442 os <<
"\n" << m_option_qseq_computeStats <<
" = " <<
m_ov.m_qseqComputeStats;
#define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV
std::set< unsigned int > m_pseqDataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV
std::string m_qseqDataInputFileType
std::string m_option_qseq_dataOutputPeriod
std::string m_option_qseq_measureRunTimes
std::string m_option_pseq_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_qseq_dataOutputFileName
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV
std::string m_qseqDataOutputFileType
int worldRank() const
Returns the process world rank.
void getMyOptionValues(po::options_description &optionsDesc)
Gets the sequence options.
McOptionsValues & operator=(const McOptionsValues &rhs)
Assignment operator; it copies rhs to this.
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::string m_option_pseq_dataOutputFileName
This class reads the options for the Monte Carlo sequence generator from an input file...
unsigned int m_qseqDataOutputPeriod
std::string m_option_qseq_dataInputFileName
std::string m_option_qseq_dataOutputFileType
void defineMyOptions(po::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
const BaseEnvironment & m_env
void copy(const McOptionsValues &src)
Copies the option values from src to this.
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV
po::variables_map & allOptionsMap() const
std::string m_dataOutputFileName
std::string m_qseqDataInputFileName
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
unsigned int m_qseqDisplayPeriod
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::string m_option_qseq_displayPeriod
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV
void scanOptionsValues()
It scans the option values from the options input file.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
unsigned int m_pseqDataOutputPeriod
std::string m_pseqDataOutputFileType
std::string m_option_pseq_dataOutputFileType
std::string m_option_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV
std::string m_option_dataOutputFileName
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV
MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_option_qseq_dataInputFileType
std::string m_option_qseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV
std::set< unsigned int > m_dataOutputAllowedSet
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV
#define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV
McOptionsValues()
Default constructor.
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV
po::options_description * m_optionsDesc
This class provides options for the Monte Carlo sequence generator if no input file is available...
~MonteCarloSGOptions()
Destructor.
~McOptionsValues()
Destructor.
void print(std::ostream &os) const
It prints the option values.
#define UQ_MOC_SG_QSEQ_SIZE_ODV
#define UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV
std::string m_qseqDataOutputFileName
std::string m_option_pseq_dataOutputPeriod
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
std::string m_option_qseq_size
std::string m_option_help
std::string m_pseqDataOutputFileName
#define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV
bool m_qseqMeasureRunTimes
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.