queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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/config_queso.h>
26 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
27 #include <queso/BoostInputOptionsParser.h>
28 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
29 
30 #include <queso/Environment.h>
31 
32 #ifndef UQ_SIP_OPTIONS_H
33 #define UQ_SIP_OPTIONS_H
34 
35 #undef UQ_SIP_READS_SOLVER_OPTION
36 
37 #define UQ_SIP_HELP ""
38 #define UQ_SIP_FILENAME_FOR_NO_FILE "."
39 
40 // _ODV = option default value
41 #define UQ_SIP_COMPUTE_SOLUTION_ODV 1
42 #define UQ_SIP_DATA_OUTPUT_FILE_NAME_ODV UQ_SIP_FILENAME_FOR_NO_FILE
43 #define UQ_SIP_DATA_OUTPUT_ALLOWED_SET_ODV ""
44 #ifdef UQ_SIP_READS_SOLVER_OPTION
45 #define UQ_SIP_SOLVER_ODV "bayes_mc" // Bayesian formula + Metropolis-Hastings
46 #endif
47 
48 #define UQ_SIP_SEEDWITHMAPESTIMATOR 0
49 #define UQ_SIP_USEOPTIMIZERMONITOR 1
50 
51 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
52 namespace boost {
53  namespace program_options {
54  class options_description;
55  }
56 }
57 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
58 
59 namespace QUESO {
60 
76 {
77 public:
79 
80 
83  SipOptionsValues(const BaseEnvironment * env, const char * prefix);
84 
86 
88 
90  virtual ~SipOptionsValues ();
92 
94 
98 
99  std::string m_prefix;
100 
102  std::string m_help;
103 
105  std::string m_dataOutputFileName;
106  std::set<unsigned int> m_dataOutputAllowedSet;
107 #ifdef UQ_SIP_READS_SOLVER_OPTION
108  std::string m_solverString;
109 #endif
110 
113 
114 private:
115 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
117 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
118 
119  // The input options as strings so we can parse the input file later
120  std::string m_option_help;
124 #ifdef UQ_SIP_READS_SOLVER_OPTION
125  std::string m_option_solver;
126 #endif
129 
131  void copy(const SipOptionsValues& src);
132 
133  void checkOptions();
134 
135  friend std::ostream & operator<<(std::ostream & os,
136  const SipOptionsValues & obj);
137 };
138 
150 {
151 public:
153 
154  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix);
156 
158 
160  StatisticalInverseProblemOptions(const BaseEnvironment& env, const char* prefix, const SipOptionsValues& alternativeOptionsValues);
161 
165 
167 
168  void scanOptionsValues();
170 
172  void print (std::ostream& os) const;
174 
176  std::string m_prefix;
177 
178 private:
179 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
180  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
183  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
184 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
185 
187 
188 #ifndef QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
190 #endif // QUESO_DISABLE_BOOST_PROGRAM_OPTIONS
191 
192  std::string m_option_help;
196 #ifdef UQ_SIP_READS_SOLVER_OPTION
197  std::string m_option_solver;
198 #endif
201 };
202 
204 std::ostream& operator<<(std::ostream& os, const StatisticalInverseProblemOptions& obj);
205 
206 } // End namespace QUESO
207 
208 #endif // UQ_SIP_OPTIONS_H
void print(std::ostream &os) const
It prints the option values.
ScopedPtr< boost::program_options::options_description >::Type m_optionsDesc
std::unique_ptr< T > Type
Definition: ScopedPtr.h:76
ScopedPtr< BoostInputOptionsParser >::Type m_parser
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
std::string m_help
If this string is non-empty, options are print to the output file.
void copy(const SipOptionsValues &src)
Copies the option values from src to this.
std::set< unsigned int > m_dataOutputAllowedSet
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
StatisticalInverseProblemOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
This class provides options for a Statistical Inverse Problem if no input file is available...
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.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the SIP.
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.
friend std::ostream & operator<<(std::ostream &os, const SipOptionsValues &obj)

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5