queso-0.53.0
MonteCarloSG.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_H
26 #define UQ_MOC_SG_H
27 
28 #include <queso/VectorRV.h>
29 #include <queso/VectorFunction.h>
30 #include <queso/VectorFunctionSynchronizer.h>
31 #include <queso/MonteCarloSGOptions.h>
32 
33 namespace QUESO {
34 
35 class GslVector;
36 class GslMatrix;
37 
51 template <class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
53 {
54 public:
56 
57 
63  MonteCarloSG(const char* prefix,
64  const McOptionsValues* alternativeOptionsValues, // dakota
65  const BaseVectorRV <P_V,P_M>& paramRv,
66  const BaseVectorFunction<P_V,P_M,Q_V,Q_M>& qoiFunction);
67 
69  ~MonteCarloSG();
71 
73 
74 
79  BaseVectorSequence<Q_V,Q_M>& workingQSeq);
81 
83 
84  void print (std::ostream& os) const;
86  friend std::ostream& operator<<(std::ostream& os,
87  const MonteCarloSG<P_V,P_M,Q_V,Q_M>& obj) {
88  obj.print(os);
89  return os;
90  }
92 private:
94 
101  BaseVectorSequence<P_V,P_M>& workingPSeq,
102  BaseVectorSequence<Q_V,Q_M>& workingQSeq);
103 
104 
106 
113  BaseVectorSequence<P_V,P_M>& workingPSeq,
114  BaseVectorSequence<Q_V,Q_M>& workingQSeq,
115  unsigned int seqSize);
117  void actualReadSequence (const BaseVectorRV <P_V,P_M>& paramRv,
118  const std::string& dataInputFileName,
119  const std::string& dataInputFileType,
120  BaseVectorSequence<P_V,P_M>& workingPSeq,
121  BaseVectorSequence<Q_V,Q_M>& workingQSeq,
122  unsigned int seqSize);
123 
130  unsigned int m_numPsNotSubWritten;
131  unsigned int m_numQsNotSubWritten;
132 
134 
136 };
137 
138 } // End namespace QUESO
139 
140 #endif // UQ_MOC_SG_H
A templated (base) class for handling vector functions.
const BaseEnvironment & m_env
Definition: MonteCarloSG.h:124
void actualGenerateSequence(const BaseVectorRV< P_V, P_M > &paramRv, BaseVectorSequence< P_V, P_M > &workingPSeq, BaseVectorSequence< Q_V, Q_M > &workingQSeq, unsigned int seqSize)
This method actually generates the QoI sequence.
Definition: MonteCarloSG.C:334
const VectorSpace< Q_V, Q_M > & m_qoiSpace
Definition: MonteCarloSG.h:128
void internGenerateSequence(const BaseVectorRV< P_V, P_M > &paramRv, BaseVectorSequence< P_V, P_M > &workingPSeq, BaseVectorSequence< Q_V, Q_M > &workingQSeq)
Generates the QoI (output) sequence; it calls actualGenerateSequence().
Definition: MonteCarloSG.C:120
const BaseVectorRV< P_V, P_M > & m_paramRv
Definition: MonteCarloSG.h:125
This class provides options for the Monte Carlo sequence generator if no input file is available...
void print(std::ostream &os) const
Prints the sequence.
Definition: MonteCarloSG.C:113
const VectorSpace< P_V, P_M > & m_paramSpace
Definition: MonteCarloSG.h:127
void actualReadSequence(const BaseVectorRV< P_V, P_M > &paramRv, const std::string &dataInputFileName, const std::string &dataInputFileType, BaseVectorSequence< P_V, P_M > &workingPSeq, BaseVectorSequence< Q_V, Q_M > &workingQSeq, unsigned int seqSize)
Reads the sequence.
Definition: MonteCarloSG.C:476
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
unsigned int m_numQsNotSubWritten
Definition: MonteCarloSG.h:131
A templated class for synchronizing the calls of vector-valued functions.
const BaseVectorFunction< P_V, P_M, Q_V, Q_M > & m_qoiFunction
Definition: MonteCarloSG.h:126
MonteCarloSG(const char *prefix, const McOptionsValues *alternativeOptionsValues, const BaseVectorRV< P_V, P_M > &paramRv, const BaseVectorFunction< P_V, P_M, Q_V, Q_M > &qoiFunction)
Constructor.
Definition: MonteCarloSG.C:33
const McOptionsValues * m_optionsObj
Definition: MonteCarloSG.h:133
const VectorFunctionSynchronizer< P_V, P_M, Q_V, Q_M > * m_qoiFunctionSynchronizer
Definition: MonteCarloSG.h:129
~MonteCarloSG()
Destructor.
Definition: MonteCarloSG.C:85
void generateSequence(BaseVectorSequence< P_V, P_M > &workingPSeq, BaseVectorSequence< Q_V, Q_M > &workingQSeq)
Generates the QoI (output) sequence, it calls internGenerateSequence().
Definition: MonteCarloSG.C:96
friend std::ostream & operator<<(std::ostream &os, const MonteCarloSG< P_V, P_M, Q_V, Q_M > &obj)
Definition: MonteCarloSG.h:86
unsigned int m_numPsNotSubWritten
Definition: MonteCarloSG.h:130
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