queso-0.53.0
Private Attributes | List of all members
QUESO::ConcatenatedVectorRV< V, M > Class Template Reference

A class representing concatenated vector RVs. More...

#include <ConcatenatedVectorRV.h>

Inheritance diagram for QUESO::ConcatenatedVectorRV< V, M >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::ConcatenatedVectorRV< V, M >:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 ConcatenatedVectorRV (const char *prefix, const BaseVectorRV< V, M > &rv1, const BaseVectorRV< V, M > &rv2, const VectorSet< V, M > &imageSet)
 Constructor. More...
 
 ConcatenatedVectorRV (const char *prefix, const std::vector< const BaseVectorRV< V, M > * > &rvs, const VectorSet< V, M > &imageSet)
 Constructor. More...
 
virtual ~ConcatenatedVectorRV ()
 Virtual destructor. More...
 
I/O methods
void print (std::ostream &os) const
 TODO: Prints the vector RV. More...
 
- Public Member Functions inherited from QUESO::BaseVectorRV< V, M >
 BaseVectorRV (const char *prefix, const VectorSet< V, M > &imageSet)
 Constructor. More...
 
virtual ~BaseVectorRV ()
 Virtual destructor. More...
 
const BaseEnvironmentenv () const
 QUESO environment; access to private attribute m_env. More...
 
const VectorSet< V, M > & imageSet () const
 Image set of the vector RV; access to private attribute m_imageSet. More...
 
const BaseJointPdf< V, M > & pdf () const
 Posterior Density Function of the vector RV; access to private attribute m_pdf. More...
 
const BaseVectorRealizer< V, M > & realizer () const
 Finds a realization (sample) of the PDF of this vector RV; access to private attribute m_realizer. More...
 
const BaseVectorCdf< V, M > & subCdf () const
 Finds the Cumulative Distribution Function of this vector RV, considering only the sub-sequence of data; access to private attribute m_subCdf. More...
 
const BaseVectorCdf< V, M > & unifiedCdf () const
 Finds the Cumulative Distribution Function of this vector RV, considering the unified sequence of data; access to private attribute m_unifiedCdf. More...
 
const BaseVectorMdf< V, M > & mdf () const
 Finds the Mass Density Function of this vector RV; access to private attribute m_mdf. More...
 

Private Attributes

std::vector< const
BaseVectorRV< V, M > * > 
m_rvs
 
std::vector< const
BaseJointPdf< V, M > * > 
m_pdfs
 
std::vector< const
BaseVectorRealizer< V, M > * > 
m_realizers
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::BaseVectorRV< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_imageSet
 
BaseJointPdf< V, M > * m_pdf
 
BaseVectorRealizer< V, M > * m_realizer
 
const BaseVectorCdf< V, M > * m_subCdf
 
const BaseVectorCdf< V, M > * m_unifiedCdf
 
const BaseVectorMdf< V, M > * m_mdf
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::ConcatenatedVectorRV< V, M >

A class representing concatenated vector RVs.

This class allows the user to concatenate two vector RV of different types and to generate realizations (samples) from this concatenated vector RV. It is used, for instance, to concatenate priors from two or more RVs, where one of them has a uniform distribution whereas the other one(s) has a Gaussian distribution.

Definition at line 55 of file ConcatenatedVectorRV.h.

Constructor & Destructor Documentation

template<class V, class M>
QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV ( const char *  prefix,
const BaseVectorRV< V, M > &  rv1,
const BaseVectorRV< V, M > &  rv2,
const VectorSet< V, M > &  imageSet 
)

Constructor.

Concatenates two RVs: rv1 and rv2 into one vector RV, given a prefix and the image set of the vector RV.

Definition at line 35 of file ConcatenatedVectorRV.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseVectorRV< V, M >::m_env, QUESO::BaseVectorRV< V, M >::m_imageSet, QUESO::BaseVectorRV< V, M >::m_mdf, QUESO::BaseVectorRV< V, M >::m_pdf, QUESO::ConcatenatedVectorRV< V, M >::m_pdfs, QUESO::BaseVectorRV< V, M >::m_prefix, QUESO::BaseVectorRV< V, M >::m_realizer, QUESO::ConcatenatedVectorRV< V, M >::m_realizers, QUESO::ConcatenatedVectorRV< V, M >::m_rvs, QUESO::BaseVectorRV< V, M >::m_subCdf, QUESO::BaseVectorRV< V, M >::m_unifiedCdf, and QUESO::BaseEnvironment::subDisplayFile().

40  :
41  BaseVectorRV<V,M>(((std::string)(prefix)+"concat").c_str(),imageSet),
42  m_rvs (2,(const BaseVectorRV <V,M>*) NULL),
43  m_pdfs (2,(const BaseJointPdf <V,M>*) NULL),
44  m_realizers (2,(const BaseVectorRealizer<V,M>*) NULL)
45 {
46  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
47  *m_env.subDisplayFile() << "Entering ConcatenatedVectorRV<V,M>::constructor(1)"
48  << ": prefix = " << m_prefix
49  << std::endl;
50  }
51 
52  m_rvs[0] = &rv1;
53  m_rvs[1] = &rv2;
54  m_pdfs[0] = &(m_rvs[0]->pdf());
55  m_pdfs[1] = &(m_rvs[1]->pdf());
56  m_realizers[0] = &(m_rvs[0]->realizer());
57  m_realizers[1] = &(m_rvs[1]->realizer());
58 
59  m_pdf = new ConcatenatedJointPdf<V,M>(m_prefix.c_str(),
60  *(m_pdfs[0]),
61  *(m_pdfs[1]),
62  m_imageSet);
63 
64  m_realizer = new ConcatenatedVectorRealizer<V,M>(m_prefix.c_str(),
65  *(m_realizers[0]),
66  *(m_realizers[1]),
67  m_imageSet);
68  m_subCdf = NULL; // FIX ME: complete code
69  m_unifiedCdf = NULL; // FIX ME: complete code
70  m_mdf = NULL; // FIX ME: complete code
71 
72  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
73  *m_env.subDisplayFile() << "Leaving ConcatenatedVectorRV<V,M>::constructor(1)"
74  << ": prefix = " << m_prefix
75  << std::endl;
76  }
77 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const VectorSet< V, M > & m_imageSet
Definition: VectorRV.h:117
std::vector< const BaseVectorRV< V, M > * > m_rvs
std::vector< const BaseJointPdf< V, M > * > m_pdfs
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
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseEnvironment & m_env
Definition: VectorRV.h:115
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:79
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
std::vector< const BaseVectorRealizer< V, M > * > m_realizers
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119
template<class V, class M>
QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV ( const char *  prefix,
const std::vector< const BaseVectorRV< V, M > * > &  rvs,
const VectorSet< V, M > &  imageSet 
)

Constructor.

Concatenates a sequence of RVs, given by: std::vector<const BaseVectorRV<V,M>* >& rvs into one single vector RV, given a prefix and the image set of the resulting vector RV.

Definition at line 80 of file ConcatenatedVectorRV.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseVectorRV< V, M >::m_env, QUESO::BaseVectorRV< V, M >::m_imageSet, QUESO::BaseVectorRV< V, M >::m_mdf, QUESO::BaseVectorRV< V, M >::m_pdf, QUESO::ConcatenatedVectorRV< V, M >::m_pdfs, QUESO::BaseVectorRV< V, M >::m_prefix, QUESO::BaseVectorRV< V, M >::m_realizer, QUESO::ConcatenatedVectorRV< V, M >::m_realizers, QUESO::ConcatenatedVectorRV< V, M >::m_rvs, QUESO::BaseVectorRV< V, M >::m_subCdf, QUESO::BaseVectorRV< V, M >::m_unifiedCdf, and QUESO::BaseEnvironment::subDisplayFile().

84  :
85  BaseVectorRV<V,M>(((std::string)(prefix)+"concat").c_str(),imageSet),
86  m_rvs (rvs.size(),(const BaseVectorRV <V,M>*) NULL),
87  m_pdfs (rvs.size(),(const BaseJointPdf <V,M>*) NULL),
88  m_realizers (rvs.size(),(const BaseVectorRealizer<V,M>*) NULL)
89 {
90  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
91  *m_env.subDisplayFile() << "Entering ConcatenatedVectorRV<V,M>::constructor(2)"
92  << ": prefix = " << m_prefix
93  << std::endl;
94  }
95 
96  for (unsigned int i = 0; i < m_rvs.size(); ++i) {
97  m_rvs [i] = rvs[i];
98  m_pdfs[i] = &(m_rvs[i]->pdf());
99  m_realizers[i] = &(m_rvs[i]->realizer());
100  }
101 
102  m_pdf = new ConcatenatedJointPdf<V,M>(m_prefix.c_str(),
103  m_pdfs,
104  m_imageSet);
105 
106  unsigned int minPeriod = m_realizers[0]->subPeriod();
107  for (unsigned int i = 0; i < m_realizers.size(); ++i) {
108  if (minPeriod > m_realizers[i]->subPeriod()) {
109  minPeriod = m_realizers[i]->subPeriod();
110  }
111  }
112 
113  m_realizer = new ConcatenatedVectorRealizer<V,M>(m_prefix.c_str(),
114  m_realizers,
115  minPeriod,
116  m_imageSet);
117  m_subCdf = NULL; // FIX ME: complete code
118  m_unifiedCdf = NULL; // FIX ME: complete code
119  m_mdf = NULL; // FIX ME: complete code
120 
121  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
122  *m_env.subDisplayFile() << "Leaving ConcatenatedVectorRV<V,M>::constructor(2)"
123  << ": prefix = " << m_prefix
124  << std::endl;
125  }
126 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const VectorSet< V, M > & m_imageSet
Definition: VectorRV.h:117
std::vector< const BaseVectorRV< V, M > * > m_rvs
std::vector< const BaseJointPdf< V, M > * > m_pdfs
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
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseEnvironment & m_env
Definition: VectorRV.h:115
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:79
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
std::vector< const BaseVectorRealizer< V, M > * > m_realizers
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119
template<class V , class M >
QUESO::ConcatenatedVectorRV< V, M >::~ConcatenatedVectorRV ( )
virtual

Virtual destructor.

Definition at line 129 of file ConcatenatedVectorRV.C.

130 {
131  delete m_mdf;
132  delete m_unifiedCdf;
133  delete m_subCdf;
134  delete m_realizer;
135  delete m_pdf;
136 }
BaseJointPdf< V, M > * m_pdf
Definition: VectorRV.h:118
const BaseVectorCdf< V, M > * m_unifiedCdf
Definition: VectorRV.h:121
const BaseVectorMdf< V, M > * m_mdf
Definition: VectorRV.h:122
const BaseVectorCdf< V, M > * m_subCdf
Definition: VectorRV.h:120
BaseVectorRealizer< V, M > * m_realizer
Definition: VectorRV.h:119

Member Function Documentation

template<class V , class M >
void QUESO::ConcatenatedVectorRV< V, M >::print ( std::ostream &  os) const
virtual

TODO: Prints the vector RV.

Todo:
: implement me!

Implements QUESO::BaseVectorRV< V, M >.

Definition at line 140 of file ConcatenatedVectorRV.C.

141 {
142  os << "ConcatenatedVectorRV<V,M>::print() says, 'Please implement me.'" << std::endl;
143  return;
144 }

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
std::vector<const BaseJointPdf <V,M>* > QUESO::ConcatenatedVectorRV< V, M >::m_pdfs
private
template<class V = GslVector, class M = GslMatrix>
std::vector<const BaseVectorRealizer<V,M>* > QUESO::ConcatenatedVectorRV< V, M >::m_realizers
private
template<class V = GslVector, class M = GslMatrix>
std::vector<const BaseVectorRV <V,M>* > QUESO::ConcatenatedVectorRV< V, M >::m_rvs
private

The documentation for this class was generated from the following files:

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