queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::GenericVectorRealizer< V, M > Class Template Reference

A class for handling sampling from generic probability density distributions. More...

#include <GenericVectorRealizer.h>

Inheritance diagram for QUESO::GenericVectorRealizer< V, M >:
QUESO::BaseVectorRealizer< V, M >

Public Member Functions

Constructor/Destructor methods
 GenericVectorRealizer (const char *prefix, const VectorSet< V, M > &unifiedImageSet, unsigned int subPeriod, double(*routinePtr)(const void *routineDataPtr, V &nextParamValues), const void *routineDataPtr)
 Default constructor. More...
 
 ~GenericVectorRealizer ()
 Destructor. More...
 
Realization-related methods

Draws a realization.

void realization (V &nextValues) const
 
- Public Member Functions inherited from QUESO::BaseVectorRealizer< V, M >
 BaseVectorRealizer (const char *prefix, const VectorSet< V, M > &unifiedImageSet, unsigned int subPeriod)
 Default constructor. More...
 
virtual ~BaseVectorRealizer ()
 Virtual destructor. More...
 
const VectorSet< V, M > & unifiedImageSet () const
 Image set where the realizations lie. Access to protected attribute m_unifiedImageSet. More...
 
unsigned int subPeriod () const
 Sub-period of the realization. Access to protected attribute m_subPeriod. More...
 

Private Attributes

double(* m_routinePtr )(const void *routineDataPtr, V &nextParamValues)
 
const void * m_routineDataPtr
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::BaseVectorRealizer< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_unifiedImageSet
 
unsigned int m_subPeriod
 

Detailed Description

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

A class for handling sampling from generic probability density distributions.

A realizer is an object that, simply put, contains a realization() operation that returns a sample of a vector RV, or, particularly, a generic probability density distribution. This is the class that handles generic sampling, used, for example, to sample, posterior PDFs (the solution of a Bayesian problem).

Definition at line 51 of file GenericVectorRealizer.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::GenericVectorRealizer< V, M >::GenericVectorRealizer ( const char *  prefix,
const VectorSet< V, M > &  unifiedImageSet,
unsigned int  subPeriod,
double(*)(const void *routineDataPtr, V &nextParamValues)  routinePtr,
const void *  routineDataPtr 
)

Default constructor.

Constructs a new object, given a prefix and the image set of the vector realizer, the sub period for the realizations and a pointer to a generic routine.

Definition at line 33 of file GenericVectorRealizer.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseVectorRealizer< V, M >::m_env, QUESO::BaseVectorRealizer< V, M >::m_prefix, and QUESO::BaseEnvironment::subDisplayFile().

39  :
40  BaseVectorRealizer<V,M>(((std::string)(prefix)+"gen").c_str(),unifiedImageSet,subPeriod),
41  m_routinePtr (routinePtr),
42  m_routineDataPtr(routineDataPtr)
43 {
44  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 5)) {
45  *m_env.subDisplayFile() << "Entering GenericVectorRealizer<V,M>::constructor()"
46  << ": prefix = " << m_prefix
47  << std::endl;
48  }
49 
50  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 5)) {
51  *m_env.subDisplayFile() << "Leaving GenericVectorRealizer<V,M>::constructor()"
52  << ": prefix = " << m_prefix
53  << std::endl;
54  }
55 }
const BaseEnvironment & m_env
unsigned int subPeriod() const
Sub-period of the realization. Access to protected attribute m_subPeriod.
double(* m_routinePtr)(const void *routineDataPtr, V &nextParamValues)
const VectorSet< V, M > & unifiedImageSet() const
Image set where the realizations lie. Access to protected attribute m_unifiedImageSet.
unsigned int displayVerbosity() const
Definition: Environment.C:450
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
template<class V , class M >
QUESO::GenericVectorRealizer< V, M >::~GenericVectorRealizer ( )

Destructor.

Definition at line 58 of file GenericVectorRealizer.C.

59 {
60 }

Member Function Documentation

template<class V , class M >
void QUESO::GenericVectorRealizer< V, M >::realization ( V &  nextValues) const
virtual

This function draws a realization of this considering the generic routine m_routinePtr and saves it in nextValues.

Implements QUESO::BaseVectorRealizer< V, M >.

Definition at line 64 of file GenericVectorRealizer.C.

65 {
66  m_routinePtr(m_routineDataPtr,nextValues);
67  return;
68 }
double(* m_routinePtr)(const void *routineDataPtr, V &nextParamValues)

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const void* QUESO::GenericVectorRealizer< V, M >::m_routineDataPtr
private

Definition at line 77 of file GenericVectorRealizer.h.

template<class V = GslVector, class M = GslMatrix>
double(* QUESO::GenericVectorRealizer< V, M >::m_routinePtr)(const void *routineDataPtr, V &nextParamValues)
private

Definition at line 76 of file GenericVectorRealizer.h.


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

Generated on Tue Jun 5 2018 19:49:29 for queso-0.57.1 by  doxygen 1.8.5