queso-0.53.0
GenericVectorRV.C
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 #include <queso/GenericVectorRV.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
28 
29 namespace QUESO {
30 
31 // Default constructor -----------------------------
32 template<class V, class M>
34  const char* prefix,
35  const VectorSet <V,M>& imageSet)
36  :
37  BaseVectorRV<V,M>(((std::string)(prefix)+"gen").c_str(),imageSet)
38 {
39  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
40  *m_env.subDisplayFile() << "Entering GenericVectorRV<V,M>::constructor() [1]"
41  << ": prefix = " << m_prefix
42  << std::endl;
43  }
44 
45  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
46  *m_env.subDisplayFile() << "Leaving GenericVectorRV<V,M>::constructor() [1]"
47  << ": prefix = " << m_prefix
48  << std::endl;
49  }
50 }
51 // Constructor -------------------------------------
52 template<class V, class M>
54  const char* prefix,
55  const VectorSet <V,M>& imageSet,
56  BaseJointPdf <V,M>& pdf,
57  BaseVectorRealizer<V,M>& realizer,
58  const BaseVectorCdf <V,M>& subCdf,
59  const BaseVectorCdf <V,M>& unifiedCdf,
60  const BaseVectorMdf <V,M>& mdf)
61  :
62  BaseVectorRV<V,M>(((std::string)(prefix)+"gen").c_str(),imageSet)
63 {
64  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
65  *m_env.subDisplayFile() << "Entering GenericVectorRV<V,M>::constructor() [2]"
66  << ": prefix = " << m_prefix
67  << std::endl;
68  }
69 
70  m_pdf = &pdf;
72  m_subCdf = &subCdf;
74  m_mdf = &mdf;
75 
76  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
77  *m_env.subDisplayFile() << "Leaving GenericVectorRV<V,M>::constructor() [2]"
78  << ": prefix = " << m_prefix
79  << std::endl;
80  }
81 }
82 // Destructor --------------------------------------
83 template<class V, class M>
85 {
86 }
87 // Random variable-handling methods ----------------
88 template<class V, class M>
89 void
91 {
92  m_pdf = &pdf;
93  return;
94 }
95 //--------------------------------------------------
96 template<class V, class M>
97 void
99 {
100  m_realizer = &realizer;
101  return;
102 }
103 //--------------------------------------------------
104 template<class V, class M>
105 void
107 {
108  m_subCdf = &subCdf;
109  return;
110 }
111 //--------------------------------------------------
112 template<class V, class M>
113 void
115 {
116  m_unifiedCdf = &unifiedCdf;
117  return;
118 }
119 //--------------------------------------------------
120 template<class V, class M>
121 void
123 {
124  m_mdf = &mdf;
125  return;
126 }
127 //--------------------------------------------------
128 template <class V, class M>
129 void
130 GenericVectorRV<V,M>::print(std::ostream& os) const
131 {
132  os << "GenericVectorRV<V,M>::print() says, 'Please implement me.'" << std::endl;
133  return;
134 }
135 
136 } // End namespace QUESO
137 
unsigned int displayVerbosity() const
Definition: Environment.C:396
const BaseVectorRealizer< V, M > & realizer() const
Finds a realization (sample) of the PDF of this vector RV; access to private attribute m_realizer...
Definition: VectorRV.C:95
A templated class for handling sets.
Definition: VectorSet.h:52
void print(std::ostream &os) const
TODO: Prints the vector RV.
A templated base class for handling vector RV.
Definition: VectorRV.h:54
A templated (base) class for handling joint PDFs.
Definition: JointPdf.h:56
A templated (base) class for handling CDFs of vector functions.
Definition: VectorCdf.h:53
virtual ~GenericVectorRV()
Virtual destructor.
const BaseVectorCdf< V, M > & unifiedCdf() const
Finds the Cumulative Distribution Function of this vector RV, considering the unified sequence of dat...
Definition: VectorRV.C:113
const BaseVectorCdf< V, M > & subCdf() const
Finds the Cumulative Distribution Function of this vector RV, considering only the sub-sequence of da...
Definition: VectorRV.C:104
BaseJointPdf< V, M > * m_pdf
Definition: VectorRV.h:118
std::string m_prefix
Definition: VectorRV.h:116
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
A templated (base) class for handling sampling from vector RVs.
const BaseJointPdf< V, M > & pdf() const
Posterior Density Function of the vector RV; access to private attribute m_pdf.
Definition: VectorRV.C:86
void setPdf(BaseJointPdf< V, M > &pdf)
Sets the PDF of this vector RV to pdf.
A templated class for handling generic vector RVs.
void setMdf(BaseVectorMdf< V, M > &mdf)
Sets the MDF of this vector RV to Mdf.
GenericVectorRV(const char *prefix, const VectorSet< V, M > &imageSet)
Default constructor.
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseEnvironment & m_env
Definition: VectorRV.h:115
A templated (base) class for handling MDFs of vector functions.
Definition: VectorMdf.h:52
void setRealizer(BaseVectorRealizer< V, M > &realizer)
Sets the realizer of this vector RV to realizer.
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
void setUnifiedCdf(BaseVectorCdf< V, M > &unifiedCdf)
Sets the CDF of the unified sequence of this vector RV to unifiedCdf.
const BaseVectorMdf< V, M > & mdf() const
Finds the Mass Density Function of this vector RV; access to private attribute m_mdf.
Definition: VectorRV.C:122
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
void setSubCdf(BaseVectorCdf< V, M > &subCdf)
Sets the CDF of the sub-sequence of this vector RV to subCdf.
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119

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