queso-0.56.0
MonteCarloSGOptions.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 UQ_MOC_SG_OPTIONS_H
26 #define UQ_MOC_SG_OPTIONS_H
27 
28 #include <queso/Environment.h>
29 #include <queso/SequenceStatisticalOptions.h>
30 
31 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
32 #include <queso/BoostInputOptionsParser.h>
33 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
34 
35 #define UQ_MOC_SG_FILENAME_FOR_NO_FILE "."
36 
37 // _ODV = option default value
38 #define UQ_MOC_SG_HELP ""
39 #define UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
40 #define UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV ""
41 
42 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV 0
43 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
44 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
45 #define UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV ""
46 #define UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV 0
47 
48 #define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
49 #define UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
50 #define UQ_MOC_SG_QSEQ_SIZE_ODV 100
51 #define UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV 500
52 #define UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV 0
53 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV 0
54 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV UQ_MOC_SG_FILENAME_FOR_NO_FILE
55 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
56 #define UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV ""
57 #define UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV 0
58 
59 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
60 namespace boost {
61  namespace program_options {
62  class options_description;
63  }
64 }
65 #endif
66 
67 namespace QUESO {
68 
80 {
81 public:
83 
84 
85 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
86  McOptionsValues (const SsOptionsValues* alternativePSsOptionsValues,
87  const SsOptionsValues* alternativeQSsOptionsValues);
88  McOptionsValues (const SsOptionsValues* alternativePSsOptionsValues,
89  const SsOptionsValues* alternativeQSsOptionsValues,
90  const BaseEnvironment * env, const char * prefix);
91 #else
92 
94  McOptionsValues ();
95 
97  McOptionsValues(const BaseEnvironment * env, const char * prefix);
98 #endif
99 
101  McOptionsValues (const McOptionsValues& src);
102 
104  virtual ~McOptionsValues ();
106 
108 
112 
113  std::string m_prefix;
114 
116  std::string m_help;
117 
118  std::string m_dataOutputFileName;
119  std::set<unsigned int> m_dataOutputAllowedSet;
120 
124  std::set<unsigned int> m_pseqDataOutputAllowedSet;
125 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
126  bool m_pseqComputeStats;
127 #endif
128 
131  unsigned int m_qseqSize;
132  unsigned int m_qseqDisplayPeriod;
137  std::set<unsigned int> m_qseqDataOutputAllowedSet;
138 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
139  bool m_qseqComputeStats;
140 #endif
141 
142 private:
143 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
145 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
146 
147  std::string m_option_help;
150 
155 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
156  std::string m_option_pseq_computeStats;
157 #endif
158 
161  std::string m_option_qseq_size;
168 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
169  std::string m_option_qseq_computeStats;
170 #endif
171 
173  void copy(const McOptionsValues& src);
174 
175  void checkOptions();
176 
177  friend std::ostream & operator<<(std::ostream & os,
178  const McOptionsValues & obj);
179 
180 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
181  friend class MonteCarloSGOptions;
182  SsOptionsValues m_alternativePSsOptionsValues;
183  SsOptionsValues m_alternativeQSsOptionsValues;
184 #endif
185 };
186 
187 // --------------------------------------------------
188 // --------------------------------------------------
189 // --------------------------------------------------
190 
200 {
201 public:
202 
204 
205  MonteCarloSGOptions(const BaseEnvironment& env, const char* prefix);
207 
209 
211  MonteCarloSGOptions(const BaseEnvironment& env, const char* prefix, const McOptionsValues& alternativeOptionsValues);
212 
216 
218 
219  void scanOptionsValues();
221 
223  void print (std::ostream& os) const;
225 
227 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
228  SequenceStatisticalOptions* m_pseqStatisticalOptionsObj;
229  SequenceStatisticalOptions* m_qseqStatisticalOptionsObj;
230 #endif
231  std::string m_prefix;
232 
233 private:
234 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
235  void defineMyOptions (boost::program_options::options_description& optionsDesc) const;
237 
239  void getMyOptionValues(boost::program_options::options_description& optionsDesc);
240 #endif
241 
243 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
244  boost::program_options::options_description* m_optionsDesc;
245 #endif
246 
247  std::string m_option_help;
250 
255 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
256  std::string m_option_pseq_computeStats;
257 #endif
258 
261  std::string m_option_qseq_size;
268 #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
269  std::string m_option_qseq_computeStats;
270 #endif
271 };
272 
274 std::ostream& operator<<(std::ostream& os, const MonteCarloSGOptions& obj);
275 
276 } // End namespace QUESO
277 
278 #endif // UQ_MOC_SG_OPTIONS_H
std::string m_option_qseq_dataOutputFileName
std::string m_option_qseq_dataInputFileType
virtual ~McOptionsValues()
Destructor.
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_option_dataOutputFileName
std::string m_option_pseq_dataOutputAllowedSet
void scanOptionsValues()
It scans the option values from the options input file.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::string m_option_pseq_dataOutputPeriod
McOptionsValues()
Default constructor.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:197
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Defines the options for the Monte Carlo sequence generator as the default options.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the sequence options.
void print(std::ostream &os) const
It prints the option values.
std::string m_option_pseq_dataOutputFileName
std::string m_option_qseq_dataOutputAllowedSet
std::set< unsigned int > m_qseqDataOutputAllowedSet
friend std::ostream & operator<<(std::ostream &os, const McOptionsValues &obj)
std::string m_option_qseq_dataOutputAllowedSet
std::string m_option_dataOutputAllowedSet
std::string m_option_qseq_measureRunTimes
std::string m_option_qseq_dataInputFileName
std::set< unsigned int > m_pseqDataOutputAllowedSet
std::string m_option_qseq_dataOutputPeriod
void copy(const McOptionsValues &src)
Copies the option values from src to this.
std::string m_option_qseq_dataOutputFileType
McOptionsValues & operator=(const McOptionsValues &rhs)
Assignment operator; it copies rhs to this.
boost::program_options::options_description * m_optionsDesc
std::string m_option_pseq_dataOutputAllowedSet
std::string m_option_pseq_dataOutputFileType
BoostInputOptionsParser * m_parser
std::string m_option_qseq_displayPeriod
This class reads the options for the Monte Carlo sequence generator from an input file...
const BaseEnvironment & m_env
This class provides options for the Monte Carlo sequence generator if no input file is available...
MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix)
Constructor: reads options from the input file.
std::string m_help
If non-empty string, print options and values to output file.

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