25 #include <queso/WignerJointPdf.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
32 template<
class V,
class M>
41 m_centerPos(new V(centerPos)),
59 template<
class V,
class M>
65 template<
class V,
class M>
68 const V& domainVector,
69 const V* domainDirection,
72 V* hessianEffect)
const
76 if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
77 if (hessianMatrix) *hessianMatrix *= 0.;
78 if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
80 double returnValue = 0.;
81 double distanceRatio = (domainVector - *m_centerPos).norm2()/m_radius;
82 if (distanceRatio < 1.) {
83 returnValue = 2.*m_radius*m_radius*sqrt(1. - distanceRatio*distanceRatio)/M_PI;
85 returnValue *= exp(m_logOfNormalizationFactor);
90 template<
class V,
class M>
93 const V& domainVector,
94 const V* domainDirection,
97 V* hessianEffect)
const
99 if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
100 if (hessianMatrix) *hessianMatrix *= 0.;
101 if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
104 return log(this->actualValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
107 template<
class V,
class M>
113 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
114 *m_env.subDisplayFile() <<
"Entering WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
118 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
119 *m_env.subDisplayFile() <<
"Leaving WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
120 <<
", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
unsigned int displayVerbosity() const
double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the PDF (scalar function).
~WignerJointPdf()
Destructor.
A templated class for handling sets.
A templated (base) class for handling joint PDFs.
A class for handling Wigner joint PDFs.
double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Computes the 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...
#define queso_require_equal_to_msg(expr1, expr2, msg)
const BaseEnvironment & m_env
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const
Computes the logarithm of the normalization factor.
WignerJointPdf(const char *prefix, const VectorSet< V, M > &domainSet, const V ¢erPos, double radius)
Constructor.
#define queso_require_greater_msg(expr1, expr2, msg)