queso-0.56.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 199 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 372 of file MonteCarloSGOptions.C.

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

375  :
376 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
377  m_ov (NULL,NULL),
378  m_pseqStatisticalOptionsObj (NULL),
379  m_qseqStatisticalOptionsObj (NULL),
380 #else
381  m_ov (),
382 #endif
383  m_prefix ((std::string)(prefix) + "mc_"),
384  m_env (env),
385 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
386  m_optionsDesc (new boost::program_options::options_description("Monte Carlo options")),
387 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
388  m_option_help (m_prefix + "help" ),
389  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
390  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
391  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
392  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
393  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
394  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet" ),
395 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
396  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
397 #endif
398  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
399  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
400  m_option_qseq_size (m_prefix + "qseq_size" ),
401  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
402  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
403  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
404  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
405  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
406  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet" )
407 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
408  ,
409  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
410 #endif
411 {
413  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"));
414 }
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:353
#define queso_deprecated()
Definition: Defines.h:134
std::string m_option_qseq_dataOutputAllowedSet
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:74
boost::program_options::options_description * m_optionsDesc
std::string m_option_pseq_dataOutputAllowedSet
const BaseEnvironment & m_env
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 416 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().

420  :
421  m_ov (alternativeOptionsValues),
422 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
423  m_pseqStatisticalOptionsObj (NULL),
424  m_qseqStatisticalOptionsObj (NULL),
425 #endif
426  m_prefix ((std::string)(prefix) + "mc_"),
427  m_env (env),
428 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
429  m_optionsDesc (NULL),
430 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
431  m_option_help (m_prefix + "help" ),
432  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
433  m_option_dataOutputAllowedSet (m_prefix + "dataOutputAllowedSet" ),
434  m_option_pseq_dataOutputPeriod (m_prefix + "pseq_dataOutputPeriod" ),
435  m_option_pseq_dataOutputFileName (m_prefix + "pseq_dataOutputFileName" ),
436  m_option_pseq_dataOutputFileType (m_prefix + "pseq_dataOutputFileType" ),
437  m_option_pseq_dataOutputAllowedSet(m_prefix + "pseq_dataOutputAllowedSet"),
438 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
439  m_option_pseq_computeStats (m_prefix + "pseq_computeStats" ),
440 #endif
441  m_option_qseq_dataInputFileName (m_prefix + "qseq_dataInputFileName" ),
442  m_option_qseq_dataInputFileType (m_prefix + "qseq_dataInputFileType" ),
443  m_option_qseq_size (m_prefix + "qseq_size" ),
444  m_option_qseq_displayPeriod (m_prefix + "qseq_displayPeriod" ),
445  m_option_qseq_measureRunTimes (m_prefix + "qseq_measureRunTimes" ),
446  m_option_qseq_dataOutputPeriod (m_prefix + "qseq_dataOutputPeriod" ),
447  m_option_qseq_dataOutputFileName (m_prefix + "qseq_dataOutputFileName" ),
448  m_option_qseq_dataOutputFileType (m_prefix + "qseq_dataOutputFileType" ),
449  m_option_qseq_dataOutputAllowedSet(m_prefix + "qseq_dataOutputAllowedSet")
450 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
451  ,
452  m_option_qseq_computeStats (m_prefix + "qseq_computeStats" )
453 #endif
454 {
456  queso_require_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"));
457 
458  if (m_env.subDisplayFile() != NULL) {
459  *m_env.subDisplayFile() << "In MonteCarloSGOptions::constructor(2)"
460  << ": after setting values of options with prefix '" << m_prefix
461  << "', state of object is:"
462  << "\n" << *this
463  << std::endl;
464  }
465 
466  // dakota
467 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
468  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
469  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_",m_ov.m_alternativePSsOptionsValues);
470  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
471  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_",m_ov.m_alternativeQSsOptionsValues);
472 #endif
473 }
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:353
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
#define queso_deprecated()
Definition: Defines.h:134
std::string m_option_qseq_dataOutputAllowedSet
boost::program_options::options_description * m_optionsDesc
std::string m_option_pseq_dataOutputAllowedSet
const BaseEnvironment & m_env
QUESO::MonteCarloSGOptions::~MonteCarloSGOptions ( )

Destructor.

Definition at line 475 of file MonteCarloSGOptions.C.

References m_optionsDesc, and queso_deprecated.

476 {
478 
479 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
480  if (m_pseqStatisticalOptionsObj) delete m_pseqStatisticalOptionsObj; // dakota
481  if (m_qseqStatisticalOptionsObj) delete m_qseqStatisticalOptionsObj; // dakota
482 #endif
483 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
484  if (m_optionsDesc ) delete m_optionsDesc;
485 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
486 }
#define queso_deprecated()
Definition: Defines.h:134
boost::program_options::options_description * m_optionsDesc

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 521 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().

522 {
524 
525  optionsDesc.add_options()
526  (m_option_help.c_str(), "produce help message for Monte Carlo distribution calculator")
527  (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" )
528  (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" )
529  (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" )
530  (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" )
531  (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" )
532  (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" )
533 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
534  (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" )
535 #endif
536  (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" )
537  (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" )
538  (m_option_qseq_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_SIZE_ODV ), "size of qoi sequence" )
539  (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" )
540  (m_option_qseq_measureRunTimes.c_str(), boost::program_options::value<bool >()->default_value(UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV ), "measure run times" )
541  (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" )
542  (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" )
543  (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" )
544  (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" )
545 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
546  (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" )
547 #endif
548  ;
549 
550  return;
551 }
#define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV
#define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_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_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV
#define queso_deprecated()
Definition: Defines.h:134
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV
std::string m_option_qseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV
#define UQ_MOC_SG_QSEQ_SIZE_ODV
#define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV
std::string m_option_pseq_dataOutputAllowedSet
#define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV
void QUESO::MonteCarloSGOptions::getMyOptionValues ( boost::program_options::options_description &  optionsDesc)
private

Gets the sequence options.

Definition at line 554 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().

555 {
557 
558  if (m_env.allOptionsMap().count(m_option_help)) {
559  if (m_env.subDisplayFile()) {
560  *m_env.subDisplayFile() << optionsDesc
561  << std::endl;
562  }
563  }
564 
566  m_ov.m_dataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_dataOutputFileName]).as<std::string>();
567  }
568 
571  std::vector<double> tmpAllow(0,0.);
572  std::string inputString = m_env.allOptionsMap()[m_option_dataOutputAllowedSet].as<std::string>();
573  MiscReadDoublesFromString(inputString,tmpAllow);
574 
575  if (tmpAllow.size() > 0) {
576  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
577  m_ov.m_dataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
578  }
579  }
580  }
581 
583  m_ov.m_pseqDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputPeriod]).as<unsigned int>();
584  }
585 
587  m_ov.m_pseqDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileName]).as<std::string>();
588  }
589 
591  m_ov.m_pseqDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_dataOutputFileType]).as<std::string>();
592  }
593 
596  std::vector<double> tmpAllow(0,0.);
597  std::string inputString = m_env.allOptionsMap()[m_option_pseq_dataOutputAllowedSet].as<std::string>();
598  MiscReadDoublesFromString(inputString,tmpAllow);
599 
600  if (tmpAllow.size() > 0) {
601  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
602  m_ov.m_pseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
603  }
604  }
605  }
606 
607 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
608  if (m_env.allOptionsMap().count(m_option_pseq_computeStats)) {
609  m_ov.m_pseqComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_pseq_computeStats]).as<bool>();
610  }
611 #endif
613  m_ov.m_qseqDataInputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileName]).as<std::string>();
614  }
615 
617  m_ov.m_qseqDataInputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataInputFileType]).as<std::string>();
618  }
619 
620  if (m_env.allOptionsMap().count(m_option_qseq_size)) {
621  m_ov.m_qseqSize = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_size]).as<unsigned int>();
622  }
623 
625  m_ov.m_qseqDisplayPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_displayPeriod]).as<unsigned int>();
626  }
627 
629  m_ov.m_qseqMeasureRunTimes = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_measureRunTimes]).as<bool>();
630  }
631 
633  m_ov.m_qseqDataOutputPeriod = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputPeriod]).as<unsigned int>();
634  }
635 
637  m_ov.m_qseqDataOutputFileName = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileName]).as<std::string>();
638  }
639 
641  m_ov.m_qseqDataOutputFileType = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_dataOutputFileType]).as<std::string>();
642  }
643 
646  std::vector<double> tmpAllow(0,0.);
647  std::string inputString = m_env.allOptionsMap()[m_option_qseq_dataOutputAllowedSet].as<std::string>();
648  MiscReadDoublesFromString(inputString,tmpAllow);
649 
650  if (tmpAllow.size() > 0) {
651  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
652  m_ov.m_qseqDataOutputAllowedSet.insert((unsigned int) tmpAllow[i]);
653  }
654  }
655  }
656 
657 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
658  if (m_env.allOptionsMap().count(m_option_qseq_computeStats)) {
659  m_ov.m_qseqComputeStats = ((const boost::program_options::variable_value&) m_env.allOptionsMap()[m_option_qseq_computeStats]).as<bool>();
660  }
661 #endif
662  return;
663 }
std::set< unsigned int > m_dataOutputAllowedSet
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
Definition: Miscellaneous.C:40
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:385
#define queso_deprecated()
Definition: Defines.h:134
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
const BaseEnvironment & m_env
void QUESO::MonteCarloSGOptions::print ( std::ostream &  os) const

It prints the option values.

Definition at line 667 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<<().

668 {
670 
672  << "\n" << m_option_dataOutputAllowedSet << " = ";
673  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
674  os << *setIt << " ";
675  }
679  << "\n" << m_option_pseq_dataOutputAllowedSet << " = ";
680  for (std::set<unsigned int>::iterator setIt = m_ov.m_pseqDataOutputAllowedSet.begin(); setIt != m_ov.m_pseqDataOutputAllowedSet.end(); ++setIt) {
681  os << *setIt << " ";
682  }
683  os
684 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
685  << "\n" << m_option_pseq_computeStats << " = " << m_ov.m_pseqComputeStats
686 #endif
689  << "\n" << m_option_qseq_size << " = " << m_ov.m_qseqSize
695  << "\n" << m_option_qseq_dataOutputAllowedSet << " = ";
696  for (std::set<unsigned int>::iterator setIt = m_ov.m_qseqDataOutputAllowedSet.begin(); setIt != m_ov.m_qseqDataOutputAllowedSet.end(); ++setIt) {
697  os << *setIt << " ";
698  }
699 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
700  os << "\n" << m_option_qseq_computeStats << " = " << m_ov.m_qseqComputeStats;
701 #endif
702 
703  return;
704 }
std::set< unsigned int > m_dataOutputAllowedSet
#define queso_deprecated()
Definition: Defines.h:134
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::scanOptionsValues ( )

It scans the option values from the options input file.

Definition at line 489 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().

490 {
492 
493 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
494  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
495 
499 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
500 
501  if (m_env.subDisplayFile() != NULL) {
502  *m_env.subDisplayFile() << "In MonteCarloSGOptions::scanOptionsValues()"
503  << ": after reading values of options with prefix '" << m_prefix
504  << "', state of object is:"
505  << "\n" << *this
506  << std::endl;
507  }
508 
509  // dakota
510 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
511  if (m_ov.m_pseqComputeStats) m_pseqStatisticalOptionsObj =
512  new SequenceStatisticalOptions(m_env,m_prefix + "pseq_");
513  if (m_ov.m_qseqComputeStats) m_qseqStatisticalOptionsObj =
514  new SequenceStatisticalOptions(m_env,m_prefix + "qseq_");
515 #endif
516  return;
517 }
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
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.
#define queso_deprecated()
Definition: Defines.h:134
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:396
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
boost::program_options::options_description * m_optionsDesc
const BaseEnvironment & m_env

Member Data Documentation

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

Definition at line 249 of file MonteCarloSGOptions.h.

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

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

Definition at line 248 of file MonteCarloSGOptions.h.

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

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

Definition at line 247 of file MonteCarloSGOptions.h.

Referenced by defineMyOptions(), and getMyOptionValues().

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

Definition at line 254 of file MonteCarloSGOptions.h.

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

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

Definition at line 252 of file MonteCarloSGOptions.h.

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

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

Definition at line 253 of file MonteCarloSGOptions.h.

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

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

Definition at line 251 of file MonteCarloSGOptions.h.

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

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

Definition at line 259 of file MonteCarloSGOptions.h.

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

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

Definition at line 260 of file MonteCarloSGOptions.h.

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

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

Definition at line 267 of file MonteCarloSGOptions.h.

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

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

Definition at line 265 of file MonteCarloSGOptions.h.

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

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

Definition at line 266 of file MonteCarloSGOptions.h.

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

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

Definition at line 264 of file MonteCarloSGOptions.h.

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

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

Definition at line 262 of file MonteCarloSGOptions.h.

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

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

Definition at line 263 of file MonteCarloSGOptions.h.

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

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

Definition at line 261 of file MonteCarloSGOptions.h.

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

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

Definition at line 244 of file MonteCarloSGOptions.h.

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

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

Definition at line 231 of file MonteCarloSGOptions.h.

Referenced by MonteCarloSGOptions(), and scanOptionsValues().


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

Generated on Tue Nov 29 2016 10:53:16 for queso-0.56.0 by  doxygen 1.8.5