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

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

#include <StatisticalInverseProblemOptions.h>

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

Public Member Functions

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

Public Attributes

std::string m_prefix
 
std::string m_help
 If this string is non-empty, options are print to the output file. More...
 
bool m_computeSolution
 
std::string m_dataOutputFileName
 
std::set< unsigned int > m_dataOutputAllowedSet
 

Private Member Functions

void copy (const SipOptionsValues &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_dataOutputFileName
 
std::string m_option_dataOutputAllowedSet
 

Friends

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

Detailed Description

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

In order to solve a Statistical Inverse Problem (SIP), 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 66 of file StatisticalInverseProblemOptions.h.

Constructor & Destructor Documentation

QUESO::SipOptionsValues::SipOptionsValues ( )

Default constructor.

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

Definition at line 38 of file StatisticalInverseProblemOptions.C.

39  :
40  m_prefix("ip_"),
44 //m_dataOutputAllowedSet(),
45  m_parser(NULL),
46  m_option_help (m_prefix + "help" ),
47  m_option_computeSolution (m_prefix + "computeSolution" ),
48  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
49  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet")
50 #ifdef UQ_SIP_READS_SOLVER_OPTION
51  m_option_solver (m_prefix + "solver" ),
52  m_solverString (UQ_SIP_SOLVER_ODV)
53 #endif
54 {
55 }
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SIP_COMPUTE_SOLUTION_ODV
std::string m_help
If this string is non-empty, options are print to the output file.
QUESO::SipOptionsValues::SipOptionsValues ( const BaseEnvironment env,
const char *  prefix 
)

Definition at line 57 of file StatisticalInverseProblemOptions.C.

References checkOptions(), QUESO::BoostInputOptionsParser::getOption(), m_computeSolution, m_dataOutputAllowedSet, m_dataOutputFileName, m_help, m_option_computeSolution, m_option_dataOutputAllowedSet, m_option_dataOutputFileName, m_option_help, m_parser, QUESO::BoostInputOptionsParser::registerOption(), QUESO::BoostInputOptionsParser::scanInputFile(), UQ_SIP_COMPUTE_SOLUTION_ODV, UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV, UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV, and UQ_SIP_HELP.

59  :
60  m_prefix((std::string)(prefix) + "ip_"),
64 //m_dataOutputAllowedSet(),
65  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
66  m_option_help (m_prefix + "help" ),
67  m_option_computeSolution (m_prefix + "computeSolution" ),
68  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
69  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet")
70 #ifdef UQ_SIP_READS_SOLVER_OPTION
71  m_option_solver (m_prefix + "solver" ),
72  m_solverString (UQ_SIP_SOLVER_ODV)
73 #endif
74 {
75  m_parser->registerOption<std::string>(m_option_help, UQ_SIP_HELP, "produce help message for statistical inverse problem");
76  m_parser->registerOption<bool >(m_option_computeSolution, UQ_SIP_COMPUTE_SOLUTION_ODV , "compute solution process" );
77  m_parser->registerOption<std::string>(m_option_dataOutputFileName, UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV , "name of data output file" );
78  m_parser->registerOption<std::string>(m_option_dataOutputAllowedSet, UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV, "subEnvs that will write to data output file" );
79 #ifdef UQ_SIP_READS_SOLVER_OPTION
80  m_parser->registerOption<std::string>(m_option_solver, UQ_SIP_SOLVER_ODV , "algorithm for calibration" );
81 #endif
82 
84 
85  m_parser->getOption<std::string>(m_option_help, m_help);
89 #ifdef UQ_SIP_READS_SOLVER_OPTION
90  m_parser->getOption<std::string>(m_option_solver, m_solver);
91 #endif
92 
93  checkOptions();
94 }
#define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
void scanInputFile()
This is the method that parses the input file.
#define UQ_SIP_COMPUTE_SOLUTION_ODV
std::set< unsigned int > m_dataOutputAllowedSet
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
std::string m_help
If this string is non-empty, options are print to the output file.
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
QUESO::SipOptionsValues::SipOptionsValues ( const SipOptionsValues src)

Copy constructor.

It assigns the same options values from src to this.

Definition at line 96 of file StatisticalInverseProblemOptions.C.

References copy().

97 {
98  this->copy(src);
99 }
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
QUESO::SipOptionsValues::~SipOptionsValues ( )
virtual

Destructor.

Definition at line 101 of file StatisticalInverseProblemOptions.C.

102 {
103 }

Member Function Documentation

void QUESO::SipOptionsValues::checkOptions ( )
private

Definition at line 114 of file StatisticalInverseProblemOptions.C.

Referenced by SipOptionsValues().

115 {
116  // Nothing
117 }
void QUESO::SipOptionsValues::copy ( const SipOptionsValues src)
private

Copies the option values from src to this.

Definition at line 120 of file StatisticalInverseProblemOptions.C.

References m_computeSolution, m_dataOutputAllowedSet, and m_dataOutputFileName.

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

121 {
122  m_computeSolution = src.m_computeSolution;
123  m_dataOutputFileName = src.m_dataOutputFileName;
124  m_dataOutputAllowedSet = src.m_dataOutputAllowedSet;
125 #ifdef UQ_SIP_READS_SOLVER_OPTION
126  m_solverString = src.m_solverString;
127 #endif
128 //m_mhOptionsValues = src.m_mhOptionsValues;
129 
130  return;
131 }
std::set< unsigned int > m_dataOutputAllowedSet
SipOptionsValues & QUESO::SipOptionsValues::operator= ( const SipOptionsValues rhs)

Assignment operator; it copies rhs to this.

Definition at line 107 of file StatisticalInverseProblemOptions.C.

References copy().

108 {
109  this->copy(rhs);
110  return *this;
111 }
void copy(const SipOptionsValues &src)
Copies the option values from src to this.

Friends And Related Function Documentation

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

Definition at line 134 of file StatisticalInverseProblemOptions.C.

135 {
136  os << "\n" << obj.m_option_computeSolution << " = " << obj.m_computeSolution
137  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
138  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
139  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
140  os << *setIt << " ";
141  }
142 #ifdef UQ_SIP_READS_SOLVER_OPTION
143  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
144 #endif
145  os << std::endl;
146  return os;
147 }

Member Data Documentation

bool QUESO::SipOptionsValues::m_computeSolution
std::set<unsigned int> QUESO::SipOptionsValues::m_dataOutputAllowedSet
std::string QUESO::SipOptionsValues::m_dataOutputFileName
std::string QUESO::SipOptionsValues::m_help

If this string is non-empty, options are print to the output file.

Definition at line 93 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues(), and QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem().

std::string QUESO::SipOptionsValues::m_option_computeSolution
private

Definition at line 109 of file StatisticalInverseProblemOptions.h.

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

std::string QUESO::SipOptionsValues::m_option_dataOutputAllowedSet
private

Definition at line 111 of file StatisticalInverseProblemOptions.h.

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

std::string QUESO::SipOptionsValues::m_option_dataOutputFileName
private

Definition at line 110 of file StatisticalInverseProblemOptions.h.

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

std::string QUESO::SipOptionsValues::m_option_help
private

Definition at line 108 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

BoostInputOptionsParser* QUESO::SipOptionsValues::m_parser
private

Definition at line 105 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

std::string QUESO::SipOptionsValues::m_prefix

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