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

This class provides options for a Statistical Forward Problem if no input file is available. More...

#include <StatisticalForwardProblemOptions.h>

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

Public Member Functions

 SfpOptionsValues ()
 Constructor/Destructor methods. More...
 
 SfpOptionsValues (const BaseEnvironment *env, const char *prefix)
 
 SfpOptionsValues (const SfpOptionsValues &src)
 Copy constructor. More...
 
virtual ~SfpOptionsValues ()
 Destructor. More...
 
Set methods
SfpOptionsValuesoperator= (const SfpOptionsValues &rhs)
 Assignment operator; it copies rhs to this. More...
 

Public Attributes

std::string m_prefix
 
std::string m_help
 If non-empty string, options and values are printed to the output file. More...
 
bool m_computeSolution
 
bool m_computeCovariances
 
bool m_computeCorrelations
 
std::string m_dataOutputFileName
 
std::set< unsigned int > m_dataOutputAllowedSet
 

Private Member Functions

void copy (const SfpOptionsValues &src)
 Copies the option values from src to this. More...
 
void checkOptions ()
 

Private Attributes

BoostInputOptionsParserm_parser
 
std::string m_option_help
 
std::string m_option_computeSolution
 
std::string m_option_computeCovariances
 
std::string m_option_computeCorrelations
 
std::string m_option_dataOutputFileName
 
std::string m_option_dataOutputAllowedSet
 

Friends

std::ostream & operator<< (std::ostream &os, const SfpOptionsValues &obj)
 

Detailed Description

This class provides options for a Statistical Forward Problem if no input file is available.

In order to solve a Statistical Forward Problem (SFP), QUESO expects some options for its methods to be fully defined. This class provides default values for such options if no input file is available.

Definition at line 64 of file StatisticalForwardProblemOptions.h.

Constructor & Destructor Documentation

QUESO::SfpOptionsValues::SfpOptionsValues ( )

Constructor/Destructor methods.

Default constructor.

Assigns the default suite of options to the Statistical Forward Problem.

Definition at line 38 of file StatisticalForwardProblemOptions.C.

39  :
40  m_prefix ("fp_"),
46  //m_dataOutputAllowedSet(),
47  m_parser(NULL),
48  m_option_help (m_prefix + "help" ),
49  m_option_computeSolution (m_prefix + "computeSolution" ),
50  m_option_computeCovariances (m_prefix + "computeCovariances" ),
51  m_option_computeCorrelations (m_prefix + "computeCorrelations" ),
52  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
53  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet")
54 #ifdef UQ_SFP_READS_SOLVER_OPTION
55  m_option_solver (m_prefix + "solver" ),
56  m_solverString (UQ_SFP_SOLVER_ODV )
57 #endif
58 {
59 }
#define UQ_SFP_COMPUTE_SOLUTION_ODV
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
std::string m_help
If non-empty string, options and values are printed to the output file.
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
QUESO::SfpOptionsValues::SfpOptionsValues ( const BaseEnvironment env,
const char *  prefix 
)

Definition at line 61 of file StatisticalForwardProblemOptions.C.

References checkOptions(), QUESO::BoostInputOptionsParser::getOption(), m_computeCorrelations, m_computeCovariances, m_computeSolution, m_dataOutputAllowedSet, m_dataOutputFileName, m_help, m_option_computeCorrelations, m_option_computeCovariances, m_option_computeSolution, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_parser, QUESO::BoostInputOptionsParser::registerOption(), QUESO::BoostInputOptionsParser::scanInputFile(), UQ_SFP_COMPUTE_CORRELATIONS_ODV, UQ_SFP_COMPUTE_COVARIANCES_ODV, UQ_SFP_COMPUTE_SOLUTION_ODV, UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV, and UQ_SFP_HELP.

63  :
64  m_prefix ((std::string)(prefix) + "fp_"),
70  //m_dataOutputAllowedSet(),
71  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
72  m_option_help (m_prefix + "help" ),
73  m_option_computeSolution (m_prefix + "computeSolution" ),
74  m_option_computeCovariances (m_prefix + "computeCovariances" ),
75  m_option_computeCorrelations (m_prefix + "computeCorrelations" ),
76  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
77  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet")
78 #ifdef UQ_SFP_READS_SOLVER_OPTION
79  m_option_solver (m_prefix + "solver" ),
80  m_solverString (UQ_SFP_SOLVER_ODV )
81 #endif
82 {
83  m_parser->registerOption<std::string>(m_option_help, UQ_SFP_HELP, "produce help message for statistical forward problem");
84  m_parser->registerOption<bool >(m_option_computeSolution, UQ_SFP_COMPUTE_SOLUTION_ODV , "compute solution process" );
87  m_parser->registerOption<std::string>(m_option_dataOutputFileName, UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV , "name of data output file" );
88  m_parser->registerOption<std::string>(m_option_dataOutputAllowedSet, UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV, "subEnvs that will write to data output file" );
89 #ifdef UQ_SFP_READS_SOLVER_OPTION
90  m_parser->registerOption<std::string>(m_option_solver, UQ_SFP_SOLVER_ODV , "algorithm for propagation" );
91 #endif
92 
94 
95  m_parser->getOption<std::string>(m_option_help, m_help);
101 #ifdef UQ_SFP_READS_SOLVER_OPTION
102  m_parser->getOption<std::string>(m_option_solver, m_solver);
103 #endif
104 
105  checkOptions();
106 }
#define UQ_SFP_COMPUTE_SOLUTION_ODV
#define UQ_SFP_COMPUTE_CORRELATIONS_ODV
#define UQ_SFP_DATA_OUTPUT_ALLOWED_SET_ODV
std::set< unsigned int > m_dataOutputAllowedSet
void scanInputFile()
This is the method that parses the input file.
#define UQ_SFP_DATA_OUTPUT_FILE_NAME_ODV
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
std::string m_help
If non-empty string, options and values are printed to the output file.
#define UQ_SFP_COMPUTE_COVARIANCES_ODV
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
QUESO::SfpOptionsValues::SfpOptionsValues ( const SfpOptionsValues src)

Copy constructor.

It assigns the same options values from src to this.

Definition at line 109 of file StatisticalForwardProblemOptions.C.

References copy().

110 {
111  this->copy(src);
112 }
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.
QUESO::SfpOptionsValues::~SfpOptionsValues ( )
virtual

Destructor.

Definition at line 114 of file StatisticalForwardProblemOptions.C.

115 {
116 }

Member Function Documentation

void QUESO::SfpOptionsValues::checkOptions ( )
private

Definition at line 126 of file StatisticalForwardProblemOptions.C.

Referenced by SfpOptionsValues().

127 {
128  // Do nothing
129 }
void QUESO::SfpOptionsValues::copy ( const SfpOptionsValues src)
private

Copies the option values from src to this.

Definition at line 133 of file StatisticalForwardProblemOptions.C.

References m_computeCorrelations, m_computeCovariances, m_computeSolution, m_dataOutputAllowedSet, and m_dataOutputFileName.

Referenced by operator=(), and SfpOptionsValues().

134 {
135  m_computeSolution = src.m_computeSolution;
136  m_computeCovariances = src.m_computeCovariances;
137  m_computeCorrelations = src.m_computeCorrelations;
138  m_dataOutputFileName = src.m_dataOutputFileName;
139  m_dataOutputAllowedSet = src.m_dataOutputAllowedSet;
140 #ifdef UQ_SFP_READS_SOLVER_OPTION
141  m_solverString = src.m_solverString;
142 #endif
143 
144  //m_mcOptionsValues = src.m_mcOptionsValues;
145 
146  return;
147 }
std::set< unsigned int > m_dataOutputAllowedSet
SfpOptionsValues & QUESO::SfpOptionsValues::operator= ( const SfpOptionsValues rhs)

Assignment operator; it copies rhs to this.

Definition at line 119 of file StatisticalForwardProblemOptions.C.

References copy().

120 {
121  this->copy(rhs);
122  return *this;
123 }
void copy(const SfpOptionsValues &src)
Copies the option values from src to this.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SfpOptionsValues obj 
)
friend

Definition at line 150 of file StatisticalForwardProblemOptions.C.

151 {
152  os << (*(obj.m_parser)) << std::endl;
153 
154  os << obj.m_option_computeSolution << " = " << obj.m_computeSolution
155  << "\n" << obj.m_option_computeCovariances << " = " << obj.m_computeCovariances
156  << "\n" << obj.m_option_computeCorrelations << " = " << obj.m_computeCorrelations
157  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
158  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
159  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
160  os << *setIt << " ";
161  }
162 #ifdef UQ_SFP_READS_SOLVER_OPTION
163  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
164 #endif
165  os << std::endl;
166  return os;
167 }

Member Data Documentation

bool QUESO::SfpOptionsValues::m_computeCorrelations
bool QUESO::SfpOptionsValues::m_computeCovariances
bool QUESO::SfpOptionsValues::m_computeSolution
std::set<unsigned int> QUESO::SfpOptionsValues::m_dataOutputAllowedSet
std::string QUESO::SfpOptionsValues::m_dataOutputFileName
std::string QUESO::SfpOptionsValues::m_help

If non-empty string, options and values are printed to the output file.

Definition at line 91 of file StatisticalForwardProblemOptions.h.

Referenced by SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeCorrelations
private

Definition at line 111 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeCovariances
private

Definition at line 110 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_computeSolution
private

Definition at line 109 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_dataOutputAllowedSet
private

Definition at line 113 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_dataOutputFileName
private

Definition at line 112 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_option_help
private

Definition at line 108 of file StatisticalForwardProblemOptions.h.

Referenced by SfpOptionsValues().

BoostInputOptionsParser* QUESO::SfpOptionsValues::m_parser
private

Definition at line 105 of file StatisticalForwardProblemOptions.h.

Referenced by QUESO::operator<<(), and SfpOptionsValues().

std::string QUESO::SfpOptionsValues::m_prefix

Definition at line 88 of file StatisticalForwardProblemOptions.h.


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