queso-0.53.0
Public Attributes | Private Member Functions | Private Attributes | List of all members
QUESO::MonteCarloSGOptions Class Reference

This class reads the options for the Monte Carlo sequence generator from an input file. More...

#include <MonteCarloSGOptions.h>

Collaboration diagram for QUESO::MonteCarloSGOptions:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 MonteCarloSGOptions (const BaseEnvironment &env, const char *prefix)
 Constructor: reads options from the input file. More...
 
 MonteCarloSGOptions (const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues)
 Constructor: with alternative option values. More...
 
 ~MonteCarloSGOptions ()
 Destructor. More...
 
I/O methods
void scanOptionsValues ()
 It scans the option values from the options input file. More...
 
void print (std::ostream &os) const
 It prints the option values. More...
 

Public Attributes

McOptionsValues m_ov
 
std::string m_prefix
 

Private Member Functions

void defineMyOptions (boost::program_options::options_description &optionsDesc) const
 Defines the options for the Monte Carlo sequence generator as the default options. More...
 
void getMyOptionValues (boost::program_options::options_description &optionsDesc)
 Gets the sequence options. More...
 

Private Attributes

const BaseEnvironmentm_env
 
boost::program_options::options_description * m_optionsDesc
 
std::string m_option_help
 
std::string m_option_dataOutputFileName
 
std::string m_option_dataOutputAllowedSet
 
std::string m_option_pseq_dataOutputPeriod
 
std::string m_option_pseq_dataOutputFileName
 
std::string m_option_pseq_dataOutputFileType
 
std::string m_option_pseq_dataOutputAllowedSet
 
std::string m_option_qseq_dataInputFileName
 
std::string m_option_qseq_dataInputFileType
 
std::string m_option_qseq_size
 
std::string m_option_qseq_displayPeriod
 
std::string m_option_qseq_measureRunTimes
 
std::string m_option_qseq_dataOutputPeriod
 
std::string m_option_qseq_dataOutputFileName
 
std::string m_option_qseq_dataOutputFileType
 
std::string m_option_qseq_dataOutputAllowedSet
 

Detailed Description

This class reads the options for the Monte Carlo sequence generator from an input file.

Monte Carlo sequence generator expects options for its methods. This class reads the options for the Monte Carlo sequence generator from an input file provided by the user. The class expects the prefix '<prefix>_mc_'. For instance, if 'prefix' is 'foo_775_fp_', then the constructor will read all options that begin with 'foo_775_fp_mc_'.

Definition at line 192 of file MonteCarloSGOptions.h.

Constructor & Destructor Documentation

QUESO::MonteCarloSGOptions::MonteCarloSGOptions ( const BaseEnvironment env,
const char *  prefix 
)

Constructor: reads options from the input file.

Definition at line 312 of file MonteCarloSGOptions.C.

References m_env, QUESO::BaseEnvironment::optionsInputFileName(), queso_deprecated, and queso_require_not_equal_to_msg.

315  :
316 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
317  m_ov (NULL,NULL),
318  m_pseqStatisticalOptionsObj (NULL),
319  m_qseqStatisticalOptionsObj (NULL),
320 #else
321  m_ov (),
322 #endif
323  m_prefix ((std::string)(prefix) + "mc_"),
324  m_env (env),
325  m_optionsDesc (new boost::program_options::options_description("Monte Carlo options")),
326  m_option_help (m_prefix + "help" ),
327  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
328  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
329  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
330  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
331  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
332  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet" ),
333 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
334  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
335 #endif
336  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
337  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
338  m_option_qseq_size (m_prefix + "qseq_size" ),
339  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
340  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
341  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
342  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
343  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
344  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet" )
345 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
346  ,
347  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
348 #endif
349 {
351  queso_require_not_equal_to_msg(m_env.optionsInputFileName(), "", "this constructor is incompatible with the absence of an options input file");
352 }
std::string m_option_qseq_dataOutputAllowedSet
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:86
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:307
boost::program_options::options_description * m_optionsDesc
const BaseEnvironment & m_env
#define queso_deprecated()
Definition: Defines.h:120
std::string m_option_pseq_dataOutputAllowedSet
QUESO::MonteCarloSGOptions::MonteCarloSGOptions ( const BaseEnvironment env,
const char *  prefix,
const McOptionsValues alternativeOptionsValues 
)

Constructor: with alternative option values.

In this constructor, the input options are given by alternativeOptionsValues, thus, they are not read from an input file.

Definition at line 354 of file MonteCarloSGOptions.C.

References m_env, m_ov, m_prefix, QUESO::BaseEnvironment::optionsInputFileName(), queso_deprecated, queso_require_equal_to_msg, and QUESO::BaseEnvironment::subDisplayFile().

358  :
359  m_ov (alternativeOptionsValues),
360 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
361  m_pseqStatisticalOptionsObj (NULL),
362  m_qseqStatisticalOptionsObj (NULL),
363 #endif
364  m_prefix ((std::string)(prefix) + "mc_"),
365  m_env (env),
366  m_optionsDesc (NULL),
367  m_option_help (m_prefix + "help" ),
368  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
369  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
370  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
371  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
372  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
373  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet"),
374 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
375  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
376 #endif
377  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
378  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
379  m_option_qseq_size (m_prefix + "qseq_size" ),
380  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
381  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
382  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
383  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
384  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
385  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet")
386 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
387  ,
388  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
389 #endif
390 {
392  queso_require_equal_to_msg(m_env.optionsInputFileName(), "", "this constructor is incompatible with the existence of an options input file");
393 
394  if (m_env.subDisplayFile() != NULL) {
395  *m_env.subDisplayFile() << "In MonteCarloSGOptions::constructor(2)"
396  << ": after setting values of options with prefix '" << m_prefix
397  << "', state of object is:"
398  << "\n" << *this
399  << std::endl;
400  }
401 
402  // dakota
403 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
404  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
405  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_",m_ov.m_alternativePSsOptionsValues);
406  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
407  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_",m_ov.m_alternativeQSsOptionsValues);
408 #endif
409 }
std::string m_option_qseq_dataOutputAllowedSet
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:307
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
boost::program_options::options_description * m_optionsDesc
const BaseEnvironment & m_env
#define queso_deprecated()
Definition: Defines.h:120
std::string m_option_pseq_dataOutputAllowedSet
QUESO::MonteCarloSGOptions::~MonteCarloSGOptions ( )

Destructor.

Definition at line 411 of file MonteCarloSGOptions.C.

References m_optionsDesc, and queso_deprecated.

412 {
414 
415 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
416  if (m_pseqStatisticalOptionsObj) delete m_pseqStatisticalOptionsObj; // dakota
417  if (m_qseqStatisticalOptionsObj) delete m_qseqStatisticalOptionsObj; // dakota
418 #endif
419  if (m_optionsDesc ) delete m_optionsDesc;
420 }
boost::program_options::options_description * m_optionsDesc
#define queso_deprecated()
Definition: Defines.h:120

Member Function Documentation

void QUESO::MonteCarloSGOptions::defineMyOptions ( boost::program_options::options_description &  optionsDesc) const
private

Defines the options for the Monte Carlo sequence generator as the default options.

Definition at line 451 of file MonteCarloSGOptions.C.

References m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, queso_deprecated, UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV, UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV, UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV, UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV, UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV, UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV, UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV, UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV, and UQ_MOC_SG_QSEQ_SIZE_ODV.

Referenced by scanOptionsValues().

452 {
454 
455  optionsDesc.add_options()
456  (m_option_help.c_str(), "produce help message for Monte Carlo distribution calculator")
457  (m_option_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV ), "name of generic data output file" )
458  (m_option_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to generic data output file" )
459  (m_option_pseq_dataOutputPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during param sequence generation" )
460  (m_option_pseq_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for parameters" )
461  (m_option_pseq_dataOutputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for parameters" )
462  (m_option_pseq_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for parameters" )
463 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
464  (m_option_pseq_computeStats.c_str(), boost::program_options::value<bool >()->default_value(UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of parameter" )
465 #endif
466  (m_option_qseq_dataInputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV ), "name of data input file for qois" )
467  (m_option_qseq_dataInputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV ), "type of data input file for qois" )
468  (m_option_qseq_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_SIZE_ODV ), "size of qoi sequence" )
469  (m_option_qseq_displayPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV ), "period of message display during qoi sequence generation" )
470  (m_option_qseq_measureRunTimes.c_str(), boost::program_options::value<bool >()->default_value(UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV ), "measure run times" )
471  (m_option_qseq_dataOutputPeriod.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during qoi sequence generation" )
472  (m_option_qseq_dataOutputFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for qois" )
473  (m_option_qseq_dataOutputFileType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for qois" )
474  (m_option_qseq_dataOutputAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for qois" )
475 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
476  (m_option_qseq_computeStats.c_str(), boost::program_options::value<bool >()->default_value(UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of qoi" )
477 #endif
478  ;
479 
480  return;
481 }
std::string m_option_qseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV
#define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV
#define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV
#define UQ_MOC_SG_QSEQ_SIZE_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV
#define queso_deprecated()
Definition: Defines.h:120
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV
#define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::getMyOptionValues ( boost::program_options::options_description &  optionsDesc)
private

Gets the sequence options.

Definition at line 484 of file MonteCarloSGOptions.C.

References QUESO::BaseEnvironment::allOptionsMap(), QUESO::McOptionsValues::m_dataOutputAllowedSet, QUESO::McOptionsValues::m_dataOutputFileName, m_env, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, m_ov, QUESO::McOptionsValues::m_pseqDataOutputAllowedSet, QUESO::McOptionsValues::m_pseqDataOutputFileName, QUESO::McOptionsValues::m_pseqDataOutputFileType, QUESO::McOptionsValues::m_pseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDataInputFileName, QUESO::McOptionsValues::m_qseqDataInputFileType, QUESO::McOptionsValues::m_qseqDataOutputAllowedSet, QUESO::McOptionsValues::m_qseqDataOutputFileName, QUESO::McOptionsValues::m_qseqDataOutputFileType, QUESO::McOptionsValues::m_qseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDisplayPeriod, QUESO::McOptionsValues::m_qseqMeasureRunTimes, QUESO::McOptionsValues::m_qseqSize, QUESO::MiscReadDoublesFromString(), queso_deprecated, and QUESO::BaseEnvironment::subDisplayFile().

Referenced by scanOptionsValues().

485 {
487 
488  if (m_env.allOptionsMap().count(m_option_help)) {
489  if (m_env.subDisplayFile()) {
490  *m_env.subDisplayFile() << optionsDesc
491  << std::endl;
492  }
493  }
494 
496  m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
497  }
498 
501  std::vector<double> tmpAllow(0,0.);
502  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
503  MiscReadDoublesFromString(inputString,tmpAllow);
504 
505  if (tmpAllow.size() > 0) {
506  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
507  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
508  }
509  }
510  }
511 
513  m_ov.m_pseqDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputPeriod]).as<unsigned int>();
514  }
515 
517  m_ov.m_pseqDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileName]).as<std::string>();
518  }
519 
521  m_ov.m_pseqDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileType]).as<std::string>();
522  }
523 
526  std::vector<double> tmpAllow(0,0.);
527  std::string inputString = m_env.allOptionsMap()[m_option_pseq_dataOutputAllowedSet].as<std::string>();
528  MiscReadDoublesFromString(inputString,tmpAllow);
529 
530  if (tmpAllow.size() > 0) {
531  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
532  m_ov.m_pseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
533  }
534  }
535  }
536 
537 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
538  if (m_env.allOptionsMap().count(m_option_pseq_computeStats)) {
539  m_ov.m_pseqComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_computeStats]).as<bool>();
540  }
541 #endif
543  m_ov.m_qseqDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileName]).as<std::string>();
544  }
545 
547  m_ov.m_qseqDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileType]).as<std::string>();
548  }
549 
550  if (m_env.allOptionsMap().count(m_option_qseq_size)) {
551  m_ov.m_qseqSize = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_size]).as<unsigned int>();
552  }
553 
555  m_ov.m_qseqDisplayPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_displayPeriod]).as<unsigned int>();
556  }
557 
559  m_ov.m_qseqMeasureRunTimes = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_measureRunTimes]).as<bool>();
560  }
561 
563  m_ov.m_qseqDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputPeriod]).as<unsigned int>();
564  }
565 
567  m_ov.m_qseqDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileName]).as<std::string>();
568  }
569 
571  m_ov.m_qseqDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileType]).as<std::string>();
572  }
573 
576  std::vector<double> tmpAllow(0,0.);
577  std::string inputString = m_env.allOptionsMap()[m_option_qseq_dataOutputAllowedSet].as<std::string>();
578  MiscReadDoublesFromString(inputString,tmpAllow);
579 
580  if (tmpAllow.size() > 0) {
581  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
582  m_ov.m_qseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
583  }
584  }
585  }
586 
587 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
588  if (m_env.allOptionsMap().count(m_option_qseq_computeStats)) {
589  m_ov.m_qseqComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_computeStats]).as<bool>();
590  }
591 #endif
592  return;
593 }
std::string m_option_qseq_dataOutputAllowedSet
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:336
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
const BaseEnvironment & m_env
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
#define queso_deprecated()
Definition: Defines.h:120
std::set< unsigned int > m_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::print ( std::ostream &  os) const

It prints the option values.

Definition at line 596 of file MonteCarloSGOptions.C.

References QUESO::McOptionsValues::m_dataOutputAllowedSet, QUESO::McOptionsValues::m_dataOutputFileName, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_pseq_dataOutputAllowedSet, m_option_pseq_dataOutputFileName, m_option_pseq_dataOutputFileType, m_option_pseq_dataOutputPeriod, m_option_qseq_dataInputFileName, m_option_qseq_dataInputFileType, m_option_qseq_dataOutputAllowedSet, m_option_qseq_dataOutputFileName, m_option_qseq_dataOutputFileType, m_option_qseq_dataOutputPeriod, m_option_qseq_displayPeriod, m_option_qseq_measureRunTimes, m_option_qseq_size, m_ov, QUESO::McOptionsValues::m_pseqDataOutputAllowedSet, QUESO::McOptionsValues::m_pseqDataOutputFileName, QUESO::McOptionsValues::m_pseqDataOutputFileType, QUESO::McOptionsValues::m_pseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDataInputFileName, QUESO::McOptionsValues::m_qseqDataInputFileType, QUESO::McOptionsValues::m_qseqDataOutputAllowedSet, QUESO::McOptionsValues::m_qseqDataOutputFileName, QUESO::McOptionsValues::m_qseqDataOutputFileType, QUESO::McOptionsValues::m_qseqDataOutputPeriod, QUESO::McOptionsValues::m_qseqDisplayPeriod, QUESO::McOptionsValues::m_qseqMeasureRunTimes, QUESO::McOptionsValues::m_qseqSize, and queso_deprecated.

Referenced by QUESO::operator<<().

597 {
599 
601  << "\n" << m_option_dataOutputAllowedSet << " = ";
602  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
603  os << *setIt << " ";
604  }
608  << "\n" << m_option_pseq_dataOutputAllowedSet << " = ";
609  for (std::set<unsigned int>::iterator setIt = m_ov.m_pseqDataOutputAllowedSet.begin(); setIt != m_ov.m_pseqDataOutputAllowedSet.end(); ++setIt) {
610  os << *setIt << " ";
611  }
612  os
613 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
614  << "\n" << m_option_pseq_computeStats << " = " << m_ov.m_pseqComputeStats
615 #endif
618  << "\n" << m_option_qseq_size << " = " << m_ov.m_qseqSize
624  << "\n" << m_option_qseq_dataOutputAllowedSet << " = ";
625  for (std::set<unsigned int>::iterator setIt = m_ov.m_qseqDataOutputAllowedSet.begin(); setIt != m_ov.m_qseqDataOutputAllowedSet.end(); ++setIt) {
626  os << *setIt << " ";
627  }
628 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
629  os << "\n" << m_option_qseq_computeStats << " = " << m_ov.m_qseqComputeStats;
630 #endif
631 
632  return;
633 }
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_pseqDataOutputAllowedSet
#define queso_deprecated()
Definition: Defines.h:120
std::set< unsigned int > m_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::scanOptionsValues ( )

It scans the option values from the options input file.

Definition at line 423 of file MonteCarloSGOptions.C.

References defineMyOptions(), getMyOptionValues(), m_env, m_optionsDesc, m_ov, m_prefix, queso_deprecated, queso_require_msg, QUESO::BaseEnvironment::scanInputFileForMyOptions(), and QUESO::BaseEnvironment::subDisplayFile().

424 {
426  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
427 
431 
432  if (m_env.subDisplayFile() != NULL) {
433  *m_env.subDisplayFile() << "In MonteCarloSGOptions::scanOptionsValues()"
434  << ": after reading values of options with prefix '" << m_prefix
435  << "', state of object is:"
436  << "\n" << *this
437  << std::endl;
438  }
439 
440  // dakota
441 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
442  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
443  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_");
444  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
445  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_");
446 #endif
447  return;
448 }
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
Definition: Environment.C:345
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
boost::program_options::options_description * m_optionsDesc
const BaseEnvironment & m_env
#define queso_deprecated()
Definition: Defines.h:120
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options.

Member Data Documentation

const BaseEnvironment& QUESO::MonteCarloSGOptions::m_env
private
std::string QUESO::MonteCarloSGOptions::m_option_dataOutputAllowedSet
private

Definition at line 238 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_dataOutputFileName
private

Definition at line 237 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_help
private

Definition at line 236 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), and getMyOptionValues().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputAllowedSet
private

Definition at line 243 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputFileName
private

Definition at line 241 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputFileType
private

Definition at line 242 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_pseq_dataOutputPeriod
private

Definition at line 240 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataInputFileName
private

Definition at line 248 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataInputFileType
private

Definition at line 249 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputAllowedSet
private

Definition at line 256 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputFileName
private

Definition at line 254 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputFileType
private

Definition at line 255 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_dataOutputPeriod
private

Definition at line 253 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_displayPeriod
private

Definition at line 251 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_measureRunTimes
private

Definition at line 252 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

std::string QUESO::MonteCarloSGOptions::m_option_qseq_size
private

Definition at line 250 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), getMyOptionValues(), and print().

boost::program_options::options_description* QUESO::MonteCarloSGOptions::m_optionsDesc
private

Definition at line 234 of file MonteCarloSGOptions.h.

Referenced by scanOptionsValues(), and ~MonteCarloSGOptions().

McOptionsValues QUESO::MonteCarloSGOptions::m_ov
std::string QUESO::MonteCarloSGOptions::m_prefix

Definition at line 224 of file MonteCarloSGOptions.h.

Referenced by MonteCarloSGOptions(), and scanOptionsValues().


The documentation for this class was generated from the following files:

Generated on Thu Jun 11 2015 13:52:36 for queso-0.53.0 by  doxygen 1.8.5