queso-0.53.0
StatisticalForwardProblem.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_SFP_H
26 #define UQ_SFP_H
27 
28 #include <queso/StatisticalForwardProblemOptions.h>
29 #include <queso/VectorFunction.h>
30 #include <queso/MonteCarloSG.h>
31 #include <queso/VectorRV.h>
32 #include <queso/GenericVectorRV.h>
33 #include <queso/SequenceOfVectors.h>
34 
35 namespace QUESO {
36 
37 class GslVector;
38 class GslMatrix;
39 
79 template <class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
81 {
82 public:
84 
85 
93  StatisticalForwardProblem(const char* prefix,
94  const SfpOptionsValues* alternativeOptionsValues, // dakota
95  const BaseVectorRV <P_V,P_M>& paramRv,
96  const BaseVectorFunction<P_V,P_M,Q_V,Q_M>& qoiFunction,
98 
102 
104 
105  bool computeSolutionFlag() const;
107 
109 
121 //<item> computes the CDFs of the components of 'm_qoiRv' as instances of 'SampledVectorCdf<Q_V,Q_M>'
122  void solveWithMonteCarlo(const McOptionsValues* alternativeOptionsValues); // dakota
123 
125  const GenericVectorRV<Q_V,Q_M>& qoiRv () const;
126 
129 
130 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
131 
132  //<item> CDFs of QoI components through the operation 'qoiRv().unifiedCdf()',
133  // which returns an instance of the class 'BaseVectorCdf<Q_V,Q_M>'
134  const BaseVectorCdf <Q_V,Q_M>& qoiRv_unifiedCdf () const;
135 
136 #endif
137 
138 
140 
141 
143  void print(std::ostream& os) const;
144  friend std::ostream& operator<<(std::ostream& os,
146  obj.print(os);
147  return os;
148  }
150 
151 private:
153 
154  void commonConstructor();
155 
157 
160  GenericVectorRV <Q_V,Q_M>& m_qoiRv; // FIX ME: Maybe not always generic ?
161 
165 
167 
169 
171 
172 #ifdef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
173  ArrayOfOneDGrids <Q_V,Q_M>* m_subMdfGrids;
174  ArrayOfOneDTables <Q_V,Q_M>* m_subMdfValues;
175 #endif
176 #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
177  BaseVectorMdf <Q_V,Q_M>* m_subSolutionMdf;
178  ArrayOfOneDGrids <Q_V,Q_M>* m_subCdfGrids;
179  ArrayOfOneDTables <Q_V,Q_M>* m_subCdfValues;
180  BaseVectorCdf <Q_V,Q_M>* m_subSolutionCdf;
181 
182  ArrayOfOneDGrids <Q_V,Q_M>* m_unifiedCdfGrids;
183  ArrayOfOneDTables <Q_V,Q_M>* m_unifiedCdfValues;
184  BaseVectorCdf <Q_V,Q_M>* m_unifiedSolutionCdf;
185 #endif
186 
188 };
189 
190 } // End namespace QUESO
191 
192 #endif // UQ_SFP_H
BaseVectorRealizer< Q_V, Q_M > * m_solutionRealizer
Class to accommodate arrays of one-dimensional grid.
friend std::ostream & operator<<(std::ostream &os, const StatisticalForwardProblem< P_V, P_M, Q_V, Q_M > &obj)
A templated (base) class for handling vector functions.
bool computeSolutionFlag() const
Whether or not compute the solution.
BaseJointPdf< Q_V, Q_M > * m_solutionPdf
const BaseVectorFunction< P_V, P_M, Q_V, Q_M > & m_qoiFunction
void commonConstructor()
TODO: Common constructor.
StatisticalForwardProblem(const char *prefix, const SfpOptionsValues *alternativeOptionsValues, const BaseVectorRV< P_V, P_M > &paramRv, const BaseVectorFunction< P_V, P_M, Q_V, Q_M > &qoiFunction, GenericVectorRV< Q_V, Q_M > &qoiRv)
Constructor.
void print(std::ostream &os) const
TODO: Prints the sequence.
BaseVectorSequence< Q_V, Q_M > * m_paramChain
This class provides options for a Statistical Forward Problem if no input file is available...
This class provides options for the Monte Carlo sequence generator if no input file is available...
const BaseVectorRV< P_V, P_M > & m_paramRv
const BaseVectorSequence< Q_V, Q_M > & getParamChain() const
Returns the parameter chain; access to private attribute m_paramChain.
BaseVectorSequence< Q_V, Q_M > * m_qoiChain
This templated class represents a Statistical Forward Problem.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
Class to accommodate arrays of one-dimensional tables.
const GenericVectorRV< Q_V, Q_M > & qoiRv() const
Returns the QoI RV; access to private attribute m_qoiRv.
GenericVectorRV< Q_V, Q_M > & m_qoiRv
void solveWithMonteCarlo(const McOptionsValues *alternativeOptionsValues)
Solves the problem through Monte Carlo algorithm.
MonteCarloSG< P_V, P_M, Q_V, Q_M > * m_mcSeqGenerator
A templated class that implements a Monte Carlo generator of samples.
Definition: MonteCarloSG.h:52

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