25 #include <queso/GenericJointPdf.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
32 template<
class V,
class M>
37 BaseJointPdf<V,M>(((std::string)(prefix)+
"gen").c_str(),scalarFunction.domainSet()),
38 m_scalarFunction(scalarFunction)
42 template<
class V,
class M>
47 template<
class V,
class M>
50 const V& domainVector,
51 const V* domainDirection,
54 V* hessianEffect)
const
56 return ((exp(m_logOfNormalizationFactor))*m_scalarFunction.actualValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
59 template<
class V,
class M>
62 const V& domainVector,
63 const V* domainDirection,
66 V* hessianEffect)
const
68 return (m_logOfNormalizationFactor + m_scalarFunction.lnValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
71 template<
class V,
class M>
77 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
78 *m_env.subDisplayFile() <<
"Entering GenericJointPdf<V,M>::computeLogOfNormalizationFactor()"
82 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
83 *m_env.subDisplayFile() <<
"Leaving GenericJointPdf<V,M>::computeLogOfNormalizationFactor()"
84 <<
", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
A templated (base) class for handling joint PDFs.
double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Logarithm of the value of the function.
double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Common method (to the derived classes) to compute the logarithm of the normalization factor...
double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the PDF (scalar function).
A templated (base) class for handling scalar functions.
A class for handling generic joint PDFs.
double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Computes the logarithm of the normalization factor. See template specialization.
GenericJointPdf(const char *prefix, const BaseScalarFunction< V, M > &scalarFunction)
Default constructor.
~GenericJointPdf()
Destructor.