queso-0.51.1
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,2009,2010,2011,2012,2013 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 
48 template <class P_V,class P_M,class Q_V,class Q_M>
50 {
51 public:
53 
54 
60  MonteCarloSG(const char* prefix,
61  const McOptionsValues* alternativeOptionsValues, // dakota
62  const BaseVectorRV <P_V,P_M>& paramRv,
63  const BaseVectorFunction<P_V,P_M,Q_V,Q_M>& qoiFunction);
64 
66  ~MonteCarloSG();
68 
70 
71 
76  BaseVectorSequence<Q_V,Q_M>& workingQSeq);
78 
80 
81  void print (std::ostream& os) const;
83  friend std::ostream& operator<<(std::ostream& os,
84  const MonteCarloSG<P_V,P_M,Q_V,Q_M>& obj) {
85  obj.print(os);
86  return os;
87  }
89 private:
91 
98  BaseVectorSequence<P_V,P_M>& workingPSeq,
99  BaseVectorSequence<Q_V,Q_M>& workingQSeq);
100 
101 
103 
110  BaseVectorSequence<P_V,P_M>& workingPSeq,
111  BaseVectorSequence<Q_V,Q_M>& workingQSeq,
112  unsigned int seqSize);
114  void actualReadSequence (const BaseVectorRV <P_V,P_M>& paramRv,
115  const std::string& dataInputFileName,
116  const std::string& dataInputFileType,
117  BaseVectorSequence<P_V,P_M>& workingPSeq,
118  BaseVectorSequence<Q_V,Q_M>& workingQSeq,
119  unsigned int seqSize);
120 
127  unsigned int m_numPsNotSubWritten;
128  unsigned int m_numQsNotSubWritten;
129 
132 };
133 
134 } // End namespace QUESO
135 
136 #endif // UQ_MOC_SG_H
A templated class that implements a Monte Carlo generator of samples.
Definition: MonteCarloSG.h:49
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:338
const BaseEnvironment & m_env
Definition: MonteCarloSG.h:121
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
This class reads the options for the Monte Carlo sequence generator from an input file...
void print(std::ostream &os) const
Prints the sequence.
Definition: MonteCarloSG.C:114
const VectorSpace< P_V, P_M > & m_paramSpace
Definition: MonteCarloSG.h:124
unsigned int m_numQsNotSubWritten
Definition: MonteCarloSG.h:128
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
const VectorSpace< Q_V, Q_M > & m_qoiSpace
Definition: MonteCarloSG.h:125
const VectorFunctionSynchronizer< P_V, P_M, Q_V, Q_M > * m_qoiFunctionSynchronizer
Definition: MonteCarloSG.h:126
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:121
const BaseVectorFunction< P_V, P_M, Q_V, Q_M > & m_qoiFunction
Definition: MonteCarloSG.h:123
MonteCarloSGOptions * m_optionsObj
Definition: MonteCarloSG.h:131
~MonteCarloSG()
Destructor.
Definition: MonteCarloSG.C:83
A templated class for synchronizing the calls of vector-valued functions.
This class provides options for the Monte Carlo sequence generator if no input file is available...
friend std::ostream & operator<<(std::ostream &os, const MonteCarloSG< P_V, P_M, Q_V, Q_M > &obj)
Definition: MonteCarloSG.h:83
McOptionsValues m_alternativeOptionsValues
Definition: MonteCarloSG.h:130
const BaseVectorRV< P_V, P_M > & m_paramRv
Definition: MonteCarloSG.h:122
A templated (base) class for handling vector functions.
unsigned int m_numPsNotSubWritten
Definition: MonteCarloSG.h:127
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:91
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:480

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5