queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::MonteCarloSGOptions Class Reference

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

#include <MonteCarloSGOptions.h>

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
 
SequenceStatisticalOptionsm_pseqStatisticalOptionsObj
 
SequenceStatisticalOptionsm_qseqStatisticalOptionsObj
 
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_pseq_computeStats
 
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
 
std::string m_option_qseq_computeStats
 

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.

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.

QUESO::MonteCarloSGOptions::~MonteCarloSGOptions ( )

Destructor.

Definition at line 479 of file MonteCarloSGOptions.C.

480 {
481  queso_deprecated();
482 
483 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
486 #endif
487 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
488  if (m_optionsDesc ) delete m_optionsDesc;
489 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
490 }
SequenceStatisticalOptions * m_pseqStatisticalOptionsObj
boost::program_options::options_description * m_optionsDesc
SequenceStatisticalOptions * m_qseqStatisticalOptionsObj

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 525 of file MonteCarloSGOptions.C.

526 {
527  queso_deprecated();
528 
529  optionsDesc.add_options()
530  (m_option_help.c_str(), "produce help message for Monte Carlo distribution calculator")
531  (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" )
532  (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" )
533  (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" )
534  (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" )
535  (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" )
536  (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" )
537 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
538  (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" )
539 #endif
540  (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" )
541  (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" )
542  (m_option_qseq_size.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_SIZE_ODV ), "size of qoi sequence" )
543  (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" )
544  (m_option_qseq_measureRunTimes.c_str(), boost::program_options::value<bool >()->default_value(UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV ), "measure run times" )
545  (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" )
546  (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" )
547  (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" )
548  (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" )
549 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
550  (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" )
551 #endif
552  ;
553 
554  return;
555 }
std::string m_option_qseq_dataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::getMyOptionValues ( boost::program_options::options_description &  optionsDesc)
private

Gets the sequence options.

Definition at line 558 of file MonteCarloSGOptions.C.

References QUESO::MiscReadDoublesFromString().

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

It prints the option values.

Definition at line 671 of file MonteCarloSGOptions.C.

Referenced by QUESO::operator<<().

672 {
673  queso_deprecated();
674 
676  << "\n" << m_option_dataOutputAllowedSet << " = ";
677  for (std::set<unsigned int>::iterator setIt = m_ov.m_dataOutputAllowedSet.begin(); setIt != m_ov.m_dataOutputAllowedSet.end(); ++setIt) {
678  os << *setIt << " ";
679  }
683  << "\n" << m_option_pseq_dataOutputAllowedSet << " = ";
684  for (std::set<unsigned int>::iterator setIt = m_ov.m_pseqDataOutputAllowedSet.begin(); setIt != m_ov.m_pseqDataOutputAllowedSet.end(); ++setIt) {
685  os << *setIt << " ";
686  }
687  os
688 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
689  << "\n" << m_option_pseq_computeStats << " = " << m_ov.m_pseqComputeStats
690 #endif
693  << "\n" << m_option_qseq_size << " = " << m_ov.m_qseqSize
699  << "\n" << m_option_qseq_dataOutputAllowedSet << " = ";
700  for (std::set<unsigned int>::iterator setIt = m_ov.m_qseqDataOutputAllowedSet.begin(); setIt != m_ov.m_qseqDataOutputAllowedSet.end(); ++setIt) {
701  os << *setIt << " ";
702  }
703 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
704  os << "\n" << m_option_qseq_computeStats << " = " << m_ov.m_qseqComputeStats;
705 #endif
706 
707  return;
708 }
std::set< unsigned int > m_qseqDataOutputAllowedSet
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_option_pseq_dataOutputAllowedSet
void QUESO::MonteCarloSGOptions::scanOptionsValues ( )

It scans the option values from the options input file.

Definition at line 493 of file MonteCarloSGOptions.C.

494 {
495  queso_deprecated();
496 
497 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
498  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
499 
503 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
504 
505  if (m_env.subDisplayFile() != NULL) {
506  *m_env.subDisplayFile() << "In MonteCarloSGOptions::scanOptionsValues()"
507  << ": after reading values of options with prefix '" << m_prefix
508  << "', state of object is:"
509  << "\n" << *this
510  << std::endl;
511  }
512 
513  // dakota
514 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
519 #endif
520  return;
521 }
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
A templated class that stores statistical options (optionally read from an input file) ...
SequenceStatisticalOptions * m_pseqStatisticalOptionsObj
const BaseEnvironment & m_env
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:397
boost::program_options::options_description * m_optionsDesc
SequenceStatisticalOptions * m_qseqStatisticalOptionsObj
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320

Member Data Documentation

const BaseEnvironment& QUESO::MonteCarloSGOptions::m_env
private

Definition at line 242 of file MonteCarloSGOptions.h.

std::string QUESO::MonteCarloSGOptions::m_option_dataOutputAllowedSet
private

Definition at line 249 of file MonteCarloSGOptions.h.

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

Definition at line 248 of file MonteCarloSGOptions.h.

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

Definition at line 247 of file MonteCarloSGOptions.h.

std::string QUESO::MonteCarloSGOptions::m_option_pseq_computeStats
private

Definition at line 256 of file MonteCarloSGOptions.h.

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

Definition at line 254 of file MonteCarloSGOptions.h.

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

Definition at line 252 of file MonteCarloSGOptions.h.

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

Definition at line 253 of file MonteCarloSGOptions.h.

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

Definition at line 251 of file MonteCarloSGOptions.h.

std::string QUESO::MonteCarloSGOptions::m_option_qseq_computeStats
private

Definition at line 269 of file MonteCarloSGOptions.h.

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

Definition at line 259 of file MonteCarloSGOptions.h.

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

Definition at line 260 of file MonteCarloSGOptions.h.

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

Definition at line 267 of file MonteCarloSGOptions.h.

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

Definition at line 265 of file MonteCarloSGOptions.h.

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

Definition at line 266 of file MonteCarloSGOptions.h.

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

Definition at line 264 of file MonteCarloSGOptions.h.

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

Definition at line 262 of file MonteCarloSGOptions.h.

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

Definition at line 263 of file MonteCarloSGOptions.h.

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

Definition at line 261 of file MonteCarloSGOptions.h.

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

Definition at line 244 of file MonteCarloSGOptions.h.

McOptionsValues QUESO::MonteCarloSGOptions::m_ov

Definition at line 226 of file MonteCarloSGOptions.h.

std::string QUESO::MonteCarloSGOptions::m_prefix

Definition at line 231 of file MonteCarloSGOptions.h.

SequenceStatisticalOptions* QUESO::MonteCarloSGOptions::m_pseqStatisticalOptionsObj

Definition at line 228 of file MonteCarloSGOptions.h.

SequenceStatisticalOptions* QUESO::MonteCarloSGOptions::m_qseqStatisticalOptionsObj

Definition at line 229 of file MonteCarloSGOptions.h.


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

Generated on Tue Jun 5 2018 19:49:34 for queso-0.57.1 by  doxygen 1.8.5