queso-0.53.0
StatisticalInverseProblemOptions.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/BoostInputOptionsParser.h>
26 #include <queso/Environment.h>
27 
28 #ifndef UQ_SIP_OPTIONS_H
29 #define UQ_SIP_OPTIONS_H
30 
31 #undef UQ_SIP_READS_SOLVER_OPTION
32 
33 #define UQ_SIP_HELP ""
34 #define UQ_SIP_FILENAME_FOR_NO_FILE "."
35 
36 // _ODV = option default value
37 #define UQ_SIP_COMPUTE_SOLUTION_ODV 1
38 #define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV UQ_SIP_FILENAME_FOR_NO_FILE
39 #define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV ""
40 #ifdef UQ_SIP_READS_SOLVER_OPTION
41 #define UQ_SIP_SOLVER_ODV "bayes_mc" // Bayesian formula + Metropolis-Hastings
42 #endif
43 
44 namespace boost {
45  namespace program_options {
46  class options_description;
47  }
48 }
49 
50 namespace QUESO {
51 
67 {
68 public:
70 
71 
74  SipOptionsValues(const BaseEnvironment * env, const char * prefix);
75 
77 
79 
81  virtual ~SipOptionsValues ();
83 
85 
89 
90  std::string m_prefix;
91 
93  std::string m_help;
94 
96  std::string m_dataOutputFileName;
97  std::set<unsigned int> m_dataOutputAllowedSet;
98 #ifdef UQ_SIP_READS_SOLVER_OPTION
99  std::string m_solverString;
100 #endif
101 
102  //MhOptionsValues m_mhOptionsValues;
103 
104 private:
106 
107  // The input options as strings so we can parse the input file later
108  std::string m_option_help;
112 #ifdef UQ_SIP_READS_SOLVER_OPTION
113  std::string m_option_solver;
114 #endif
115 
117  void copy(const SipOptionsValues& src);
118 
119  void checkOptions();
120 
121  friend std::ostream & operator<<(std::ostream & os,
122  const SipOptionsValues & obj);
123 };
124 
125 // --------------------------------------------------
126 // --------------------------------------------------
127 // --------------------------------------------------
128 
140 {
141 public:
143 
144  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix);
146 
148 
150  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix, const SipOptionsValues& alternativeOptionsValues);
151 
155 
157 
158  void scanOptionsValues();
160 
162  void print (std::ostream& os) const;
164 
166  std::string m_prefix;
167 
168 private:
170  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
171 
173  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
174 
176 
177  boost::program_options::options_description* m_optionsDesc;
178  std::string m_option_help;
182 #ifdef UQ_SIP_READS_SOLVER_OPTION
183  std::string m_option_solver;
184 #endif
185 };
186 
188 std::ostream& operator<<(std::ostream& os, const StatisticalInverseProblemOptions& obj);
189 
190 } // End namespace QUESO
191 
192 #endif // UQ_SIP_OPTIONS_H
This class provides options for a Statistical Inverse Problem if no input file is available...
SipOptionsValues & operator=(const SipOptionsValues &rhs)
Assignment operator; it copies rhs to this.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SIP options as the default options.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
friend std::ostream & operator<<(std::ostream &os, const SipOptionsValues &obj)
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
std::set< unsigned int > m_dataOutputAllowedSet
void print(std::ostream &os) const
It prints the option values.
std::string m_help
If this string is non-empty, options are print to the output file.
void scanOptionsValues()
It scans the option values from the options input file.
This class reads option values for a Statistical Inverse Problem from an input file.
boost::program_options::options_description * m_optionsDesc

Generated on Thu Jun 11 2015 13:52:32 for queso-0.53.0 by  doxygen 1.8.5