queso-0.55.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
 
bool m_seedWithMAPEstimator
 
bool m_useOptimizerMonitor
 

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
 
std::string m_option_seedWithMAPEstimator
 
std::string m_option_useOptimizerMonitor
 

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 69 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_"),
46 //m_dataOutputAllowedSet(),
47  m_parser(NULL),
48  m_option_help (m_prefix + "help" ),
49  m_option_computeSolution (m_prefix + "computeSolution" ),
50  m_option_dataOutputFileName (m_prefix + "dataOutputFileName" ),
51  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet"),
52 #ifdef UQ_SIP_READS_SOLVER_OPTION
53  m_option_solver (m_prefix + "solver" ),
54  m_solverString (UQ_SIP_SOLVER_ODV)
55 #endif
56  m_option_seedWithMAPEstimator(m_prefix + "seedWithMAPEstimator"),
57  m_option_useOptimizerMonitor(m_prefix + "useOptimizerMonitor")
58 {
59 }
#define UQ_SIP_COMPUTE_SOLUTION_ODV
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SIP_SEEDWITHMAPESTIMATOR
#define UQ_SIP_USEOPTIMIZERMONITOR
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 61 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_option_seedWithMAPEstimator, m_option_useOptimizerMonitor, m_parser, m_seedWithMAPEstimator, m_useOptimizerMonitor, 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, UQ_SIP_HELP, UQ_SIP_SEEDWITHMAPESTIMATOR, and UQ_SIP_USEOPTIMIZERMONITOR.

63  :
64  m_prefix((std::string)(prefix) + "ip_"),
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_dataOutputFileName (m_prefix + "dataOutputFileName" ),
75  m_option_dataOutputAllowedSet(m_prefix + "dataOutputAllowedSet"),
76 #ifdef UQ_SIP_READS_SOLVER_OPTION
77  m_option_solver (m_prefix + "solver" ),
78  m_solverString (UQ_SIP_SOLVER_ODV)
79 #endif
80  m_option_seedWithMAPEstimator(m_prefix + "seedWithMAPEstimator"),
81  m_option_useOptimizerMonitor(m_prefix + "useOptimizerMonitor")
82 {
83  m_parser->registerOption<std::string>(m_option_help, UQ_SIP_HELP, "produce help message for statistical inverse problem");
84  m_parser->registerOption<bool >(m_option_computeSolution, UQ_SIP_COMPUTE_SOLUTION_ODV , "compute solution process" );
85  m_parser->registerOption<std::string>(m_option_dataOutputFileName, UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV , "name of data output file" );
86  m_parser->registerOption<std::string>(m_option_dataOutputAllowedSet, UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV, "subEnvs that will write to data output file" );
87 #ifdef UQ_SIP_READS_SOLVER_OPTION
88  m_parser->registerOption<std::string>(m_option_solver, UQ_SIP_SOLVER_ODV , "algorithm for calibration" );
89 #endif
90  m_parser->registerOption<bool >(m_option_seedWithMAPEstimator, UQ_SIP_SEEDWITHMAPESTIMATOR , "toggle for seeding chain at MAP" );
91  m_parser->registerOption<bool >(m_option_useOptimizerMonitor, UQ_SIP_USEOPTIMIZERMONITOR , "toggle for using optimizer monitor (prints diagnostics");
92 
94 
95  m_parser->getOption<std::string>(m_option_help, m_help);
99 #ifdef UQ_SIP_READS_SOLVER_OPTION
100  m_parser->getOption<std::string>(m_option_solver, m_solver);
101 #endif
104 
105  checkOptions();
106 }
#define UQ_SIP_COMPUTE_SOLUTION_ODV
#define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV
#define UQ_SIP_SEEDWITHMAPESTIMATOR
void scanInputFile()
This is the method that parses the input file.
#define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV
#define UQ_SIP_USEOPTIMIZERMONITOR
std::string m_help
If this string is non-empty, options are print to the output file.
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
std::set< unsigned int > m_dataOutputAllowedSet
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 108 of file StatisticalInverseProblemOptions.C.

References copy().

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

Destructor.

Definition at line 113 of file StatisticalInverseProblemOptions.C.

114 {
115 }

Member Function Documentation

void QUESO::SipOptionsValues::checkOptions ( )
private

Definition at line 126 of file StatisticalInverseProblemOptions.C.

Referenced by SipOptionsValues().

127 {
128  // Nothing
129 }
void QUESO::SipOptionsValues::copy ( const SipOptionsValues src)
private

Copies the option values from src to this.

Definition at line 132 of file StatisticalInverseProblemOptions.C.

References m_computeSolution, m_dataOutputAllowedSet, m_dataOutputFileName, m_seedWithMAPEstimator, and m_useOptimizerMonitor.

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

133 {
134  m_computeSolution = src.m_computeSolution;
135  m_dataOutputFileName = src.m_dataOutputFileName;
136  m_dataOutputAllowedSet = src.m_dataOutputAllowedSet;
137 #ifdef UQ_SIP_READS_SOLVER_OPTION
138  m_solverString = src.m_solverString;
139 #endif
140  m_seedWithMAPEstimator = src.m_seedWithMAPEstimator;
141  m_useOptimizerMonitor = src.m_useOptimizerMonitor;
142 }
std::set< unsigned int > m_dataOutputAllowedSet
SipOptionsValues & QUESO::SipOptionsValues::operator= ( const SipOptionsValues rhs)

Assignment operator; it copies rhs to this.

Definition at line 119 of file StatisticalInverseProblemOptions.C.

References copy().

120 {
121  this->copy(rhs);
122  return *this;
123 }
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 145 of file StatisticalInverseProblemOptions.C.

146 {
147  os << "\n" << obj.m_option_computeSolution << " = " << obj.m_computeSolution
148  << "\n" << obj.m_option_dataOutputFileName << " = " << obj.m_dataOutputFileName;
149  os << "\n" << obj.m_option_dataOutputAllowedSet << " = ";
150  for (std::set<unsigned int>::iterator setIt = obj.m_dataOutputAllowedSet.begin(); setIt != obj.m_dataOutputAllowedSet.end(); ++setIt) {
151  os << *setIt << " ";
152  }
153 #ifdef UQ_SIP_READS_SOLVER_OPTION
154  << "\n" << obj.m_option_solver << " = " << obj.m_solverString
155 #endif
156  os << std::endl;
157  return os;
158 }

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 96 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 113 of file StatisticalInverseProblemOptions.h.

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

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

Definition at line 115 of file StatisticalInverseProblemOptions.h.

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

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

Definition at line 114 of file StatisticalInverseProblemOptions.h.

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

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

Definition at line 112 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

std::string QUESO::SipOptionsValues::m_option_seedWithMAPEstimator
private

Definition at line 119 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

std::string QUESO::SipOptionsValues::m_option_useOptimizerMonitor
private

Definition at line 120 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

BoostInputOptionsParser* QUESO::SipOptionsValues::m_parser
private

Definition at line 109 of file StatisticalInverseProblemOptions.h.

Referenced by SipOptionsValues().

std::string QUESO::SipOptionsValues::m_prefix
bool QUESO::SipOptionsValues::m_seedWithMAPEstimator
bool QUESO::SipOptionsValues::m_useOptimizerMonitor

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

Generated on Fri Jun 17 2016 14:17:46 for queso-0.55.0 by  doxygen 1.8.5