queso-0.57.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 scalar function. Deprecated. 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 distributionMean (V &meanVector) const
 
virtual void distributionVariance (M &covMatrix) const
 
virtual void setNormalizationStyle (unsigned int value) const
 
void setLogOfNormalizationFactor (double value) const
 Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_normalizationStyle.) More...
 
virtual void print (std::ostream &os) const
 Print method. Non-pure for backwards compatibility. More...
 
- Public Member Functions inherited from QUESO::BaseScalarFunction< V, M >
void setFiniteDifferenceStepSize (double fdStepSize)
 Sets the step size for finite differencing gradients. More...
 
void setFiniteDifferenceStepSize (unsigned int i, double fdStepSize)
 
 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...
 
virtual double lnValue (const V &domainVector) const
 Returns the logarithm of the function at domainVector. More...
 
virtual double lnValue (const V &domainVector, V &gradVector) const
 Returns the logarithm of the function and its gradient at domainVector. More...
 
virtual double lnValue (const V &domainVector, V &gradVector, const V &domainDirection, V &hessianEffect) const
 

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 50 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 }
const BaseScalarFunction< V, M > & m_scalarFunction
double m_logOfNormalizationFactor
Definition: JointPdf.h:122
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 }
const BaseEnvironment & m_env
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:115
double m_logOfNormalizationFactor
Definition: JointPdf.h:122
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
unsigned int displayVerbosity() const
Definition: Environment.C:450
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 scalar function. Deprecated.

Pointers will be NULL if derivative information is not required by QUESO.

Default implementation throws an exception.

Reimplemented from QUESO::BaseScalarFunction< 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 }
const BaseScalarFunction< V, M > & m_scalarFunction
double m_logOfNormalizationFactor
Definition: JointPdf.h:122

Member Data Documentation

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

Definition at line 78 of file GenericJointPdf.h.


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

Generated on Sat Apr 22 2017 14:04:40 for queso-0.57.0 by  doxygen 1.8.5