queso-0.56.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 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <queso/BoostInputOptionsParser.h>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
28 
29 #include <queso/Environment.h>
30 
31 #ifndef UQ_SIP_OPTIONS_H
32 #define UQ_SIP_OPTIONS_H
33 
34 #undef UQ_SIP_READS_SOLVER_OPTION
35 
36 #define UQ_SIP_HELP ""
37 #define UQ_SIP_FILENAME_FOR_NO_FILE "."
38 
39 // _ODV = option default value
40 #define UQ_SIP_COMPUTE_SOLUTION_ODV 1
41 #define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV UQ_SIP_FILENAME_FOR_NO_FILE
42 #define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV ""
43 #ifdef UQ_SIP_READS_SOLVER_OPTION
44 #define UQ_SIP_SOLVER_ODV "bayes_mc" // Bayesian formula + Metropolis-Hastings
45 #endif
46 
47 #define UQ_SIP_SEEDWITHMAPESTIMATOR 0
48 #define UQ_SIP_USEOPTIMIZERMONITOR 1
49 
50 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
51 namespace boost {
52  namespace program_options {
53  class options_description;
54  }
55 }
56 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
57 
58 namespace QUESO {
59 
75 {
76 public:
78 
79 
82  SipOptionsValues(const BaseEnvironment * env, const char * prefix);
83 
85 
87 
89  virtual ~SipOptionsValues ();
91 
93 
97 
98  std::string m_prefix;
99 
101  std::string m_help;
102 
104  std::string m_dataOutputFileName;
105  std::set<unsigned int> m_dataOutputAllowedSet;
106 #ifdef UQ_SIP_READS_SOLVER_OPTION
107  std::string m_solverString;
108 #endif
109 
112 
113 private:
114 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
116 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
117 
118  // The input options as strings so we can parse the input file later
119  std::string m_option_help;
123 #ifdef UQ_SIP_READS_SOLVER_OPTION
124  std::string m_option_solver;
125 #endif
128 
130  void copy(const SipOptionsValues& src);
131 
132  void checkOptions();
133 
134  friend std::ostream & operator<<(std::ostream & os,
135  const SipOptionsValues & obj);
136 };
137 
149 {
150 public:
152 
153  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix);
155 
157 
159  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix, const SipOptionsValues& alternativeOptionsValues);
160 
164 
166 
167  void scanOptionsValues();
169 
171  void print (std::ostream& os) const;
173 
175  std::string m_prefix;
176 
177 private:
178 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
179  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
182  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
183 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
184 
186 
187 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
188  boost::program_options::options_description* m_optionsDesc;
189 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
190 
191  std::string m_option_help;
195 #ifdef UQ_SIP_READS_SOLVER_OPTION
196  std::string m_option_solver;
197 #endif
200 };
201 
203 std::ostream& operator<<(std::ostream& os, const StatisticalInverseProblemOptions& obj);
204 
205 } // End namespace QUESO
206 
207 #endif // UQ_SIP_OPTIONS_H
This class provides options for a Statistical Inverse Problem if no input file is available...
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
SipOptionsValues & operator=(const SipOptionsValues &rhs)
Assignment operator; it copies rhs to this.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:197
This class reads option values for a Statistical Inverse Problem from an input file.
boost::program_options::options_description * m_optionsDesc
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::set< unsigned int > m_dataOutputAllowedSet
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my SIP options as the default options.
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.
friend std::ostream & operator<<(std::ostream &os, const SipOptionsValues &obj)
void scanOptionsValues()
It scans the option values from the options input file.

Generated on Tue Nov 29 2016 10:53:11 for queso-0.56.0 by  doxygen 1.8.5