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

A class for handling generic joint PDFs. More...

#include <GenericJointPdf.h>

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

Public Member Functions

Constructor/Destructor methods
 GenericJointPdf (const char *prefix, const BaseScalarFunction< V, M > &scalarFunction)
 Default constructor. More...
 
 ~GenericJointPdf ()
 Destructor. More...
 
Math methods
double actualValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Actual value of the PDF (scalar function). More...
 
double lnValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Logarithm of the value of the function. More...
 
double computeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const
 Computes the logarithm of the normalization factor. See template specialization. More...
 
- Public Member Functions inherited from QUESO::BaseJointPdf< V, M >
 BaseJointPdf (const char *prefix, const VectorSet< V, M > &domainSet)
 Default constructor. More...
 
virtual ~BaseJointPdf ()
 Destructor. More...
 
virtual void setNormalizationStyle (unsigned int value) const
 Sets a value to be used in the normalization style (stored in the protected attribute m_normalizationStyle.) More...
 
void setLogOfNormalizationFactor (double value) const
 Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_normalizationStyle.) More...
 
- Public Member Functions inherited from QUESO::BaseScalarFunction< V, M >
 BaseScalarFunction (const char *prefix, const VectorSet< V, M > &domainSet)
 Default constructor. More...
 
virtual ~BaseScalarFunction ()
 Destructor. More...
 
const VectorSet< V, M > & domainSet () const
 Access to the protected attribute m_domainSet: domain set of the scalar function. More...
 

Protected Attributes

const BaseScalarFunction< V, M > & m_scalarFunction
 
- Protected Attributes inherited from QUESO::BaseJointPdf< V, M >
unsigned int m_normalizationStyle
 
double m_logOfNormalizationFactor
 
- Protected Attributes inherited from QUESO::BaseScalarFunction< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_domainSet
 Domain set of the scalar function. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QUESO::BaseJointPdf< V, M >
double commonComputeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const
 Common method (to the derived classes) to compute the logarithm of the normalization factor. More...
 

Detailed Description

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

A class for handling generic joint PDFs.

This class allows the mathematical definition of a generic Joint PDF, such as the posterior PDF.

Definition at line 52 of file GenericJointPdf.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::GenericJointPdf< V, M >::GenericJointPdf ( const char *  prefix,
const BaseScalarFunction< V, M > &  scalarFunction 
)

Default constructor.

Instantiates an object of this class given a prefix and a scalar function. The domain of the scalar function is assigned to the protected attribute m_domainSet, and the scalar function is also itself copied to the protected attribute m_scalarFunction.

Definition at line 33 of file GenericJointPdf.C.

36  :
37  BaseJointPdf<V,M>(((std::string)(prefix)+"gen").c_str(),scalarFunction.domainSet()),
38  m_scalarFunction(scalarFunction)
39 {
40 }
const BaseScalarFunction< V, M > & m_scalarFunction
template<class V , class M >
QUESO::GenericJointPdf< V, M >::~GenericJointPdf ( )

Destructor.

Definition at line 43 of file GenericJointPdf.C.

44 {
45 }

Member Function Documentation

template<class V , class M >
double QUESO::GenericJointPdf< V, M >::actualValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Actual value of the PDF (scalar function).

Implements QUESO::BaseJointPdf< V, M >.

Definition at line 49 of file GenericJointPdf.C.

55 {
56  return ((exp(m_logOfNormalizationFactor))*m_scalarFunction.actualValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect)); // [PDF-01]
57 }
double m_logOfNormalizationFactor
Definition: JointPdf.h:100
const BaseScalarFunction< V, M > & m_scalarFunction
template<class V , class M >
double QUESO::GenericJointPdf< V, M >::computeLogOfNormalizationFactor ( unsigned int  numSamples,
bool  m_logOfNormalizationFactor 
) const
virtual

Computes the logarithm of the normalization factor. See template specialization.

Implements QUESO::BaseJointPdf< V, M >.

Definition at line 73 of file GenericJointPdf.C.

References QUESO::BaseJointPdf< V, M >::commonComputeLogOfNormalizationFactor().

74 {
75  double value = 0.;
76 
77  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
78  *m_env.subDisplayFile() << "Entering GenericJointPdf<V,M>::computeLogOfNormalizationFactor()"
79  << std::endl;
80  }
81  value = BaseJointPdf<V,M>::commonComputeLogOfNormalizationFactor(numSamples, updateFactorInternally);
82  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
83  *m_env.subDisplayFile() << "Leaving GenericJointPdf<V,M>::computeLogOfNormalizationFactor()"
84  << ", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
85  << std::endl;
86  }
87 
88  return value;
89 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
double m_logOfNormalizationFactor
Definition: JointPdf.h:100
double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Common method (to the derived classes) to compute the logarithm of the normalization factor...
Definition: JointPdf.C:77
const BaseEnvironment & m_env
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
template<class V , class M >
double QUESO::GenericJointPdf< V, M >::lnValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Logarithm of the value of the function.

Implements QUESO::BaseJointPdf< V, M >.

Definition at line 61 of file GenericJointPdf.C.

67 {
68  return (m_logOfNormalizationFactor + m_scalarFunction.lnValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect)); // [PDF-01]
69 }
double m_logOfNormalizationFactor
Definition: JointPdf.h:100
const BaseScalarFunction< V, M > & m_scalarFunction

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const BaseScalarFunction<V,M>& QUESO::GenericJointPdf< V, M >::m_scalarFunction
protected

Definition at line 80 of file GenericJointPdf.h.


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