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

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

#include <WignerJointPdf.h>

Inheritance diagram for QUESO::WignerJointPdf< V, M >:
QUESO::BaseJointPdf< V, M > QUESO::BaseScalarFunction< V, M >

Public Member Functions

Constructor/Destructor methods
 WignerJointPdf (const char *prefix, const VectorSet< V, M > &domainSet, const V &centerPos, double radius)
 Constructor. More...
 
 ~WignerJointPdf ()
 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
 Computes the logarithm of the value of the function. More...
 
virtual void distributionMean (V &meanVector) const
 Mean value of the underlying random variable. More...
 
virtual void distributionVariance (M &covMatrix) const
 Covariance matrix of the underlying random variable. More...
 
double computeLogOfNormalizationFactor (unsigned int numSamples, bool updateFactorInternally) const
 Computes the logarithm of the normalization factor. 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
 
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

V * m_centerPos
 
double m_radius
 
- 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::WignerJointPdf< V, M >

A class for handling Wigner joint PDFs.

This class allows the mathematical definition of a Wigner Joint PDF.

Definition at line 47 of file WignerJointPdf.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::WignerJointPdf< V, M >::WignerJointPdf ( const char *  prefix,
const VectorSet< V, M > &  domainSet,
const V &  centerPos,
double  radius 
)

Constructor.

Constructs a new object of the class, given a prefix, the domain set of the PDF, the center position centerPos, and a radius radius.

Definition at line 33 of file WignerJointPdf.C.

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

38  :
39  BaseJointPdf<V,M>(((std::string)(prefix)+"uni").c_str(),
40  domainSet),
41  m_centerPos(new V(centerPos)),
42  m_radius (radius)
43 {
44  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
45  *m_env.subDisplayFile() << "Entering WignerJointPdf<V,M>::constructor()"
46  << ": prefix = " << m_prefix
47  << std::endl;
48  }
49 
50  queso_require_greater_msg(m_radius, 0., "invalid radius");
51 
52  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
53  *m_env.subDisplayFile() << "Leaving WignerJointPdf<V,M>::constructor()"
54  << ": prefix = " << m_prefix
55  << std::endl;
56  }
57 }
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
const BaseEnvironment & m_env
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::WignerJointPdf< V, M >::~WignerJointPdf ( )

Destructor.

Definition at line 60 of file WignerJointPdf.C.

61 {
62  delete m_centerPos;
63 }

Member Function Documentation

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

Actual value of the PDF (scalar function).

It depends on the distance of the center position to the domain and on the radius.

Implements QUESO::BaseJointPdf< V, M >.

Definition at line 67 of file WignerJointPdf.C.

References QUESO::queso_require_equal_to_msg.

73 {
74  queso_require_equal_to_msg(domainVector.sizeLocal(), this->m_domainSet.vectorSpace().dimLocal(), "invalid input");
75 
76  if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
77  if (hessianMatrix) *hessianMatrix *= 0.;
78  if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
79 
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;
84  }
85  returnValue *= exp(m_logOfNormalizationFactor); // [PDF-09]
86 
87  return returnValue;
88 }
double m_logOfNormalizationFactor
Definition: JointPdf.h:122
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues queso_require_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"))
const VectorSet< V, M > & m_domainSet
Domain set of the scalar function.
template<class V , class M >
double QUESO::WignerJointPdf< V, M >::computeLogOfNormalizationFactor ( unsigned int  numSamples,
bool  updateFactorInternally 
) const
virtual

Computes the logarithm of the normalization factor.

This routine calls BaseJointPdf::commonComputeLogOfNormalizationFactor().

Implements QUESO::BaseJointPdf< V, M >.

Definition at line 126 of file WignerJointPdf.C.

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

127 {
128  double value = 0.;
129 
130  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
131  *m_env.subDisplayFile() << "Entering WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
132  << std::endl;
133  }
134  value = BaseJointPdf<V,M>::commonComputeLogOfNormalizationFactor(numSamples, updateFactorInternally);
135  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
136  *m_env.subDisplayFile() << "Leaving WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
137  << ", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
138  << std::endl;
139  }
140 
141  return value;
142 }
double m_logOfNormalizationFactor
Definition: JointPdf.h:122
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
const BaseEnvironment & m_env
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 >
void QUESO::WignerJointPdf< V, M >::distributionMean ( V &  meanVector) const
virtual

Mean value of the underlying random variable.

Reimplemented from QUESO::BaseJointPdf< V, M >.

Definition at line 109 of file WignerJointPdf.C.

110 {
111  meanVector = *m_centerPos;
112 }
template<class V , class M >
void QUESO::WignerJointPdf< V, M >::distributionVariance ( M &  covMatrix) const
virtual

Covariance matrix of the underlying random variable.

Reimplemented from QUESO::BaseJointPdf< V, M >.

Definition at line 117 of file WignerJointPdf.C.

118 {
119  queso_not_implemented();
120 }
template<class V , class M >
double QUESO::WignerJointPdf< V, M >::lnValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Computes the logarithm of the value of the function.

This method calls actualValue() and applies the logarithm to its result.

Reimplemented from QUESO::BaseScalarFunction< V, M >.

Definition at line 92 of file WignerJointPdf.C.

98 {
99  if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
100  if (hessianMatrix) *hessianMatrix *= 0.;
101  if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
102 
103  // No need to add m_logOfNormalizationFactor because 'actualValue()' is called [PDF-09]
104  return log(this->actualValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
105 }
double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the PDF (scalar function).
const VectorSet< V, M > & m_domainSet
Domain set of the scalar function.

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
V* QUESO::WignerJointPdf< V, M >::m_centerPos
protected

Definition at line 87 of file WignerJointPdf.h.

template<class V = GslVector, class M = GslMatrix>
double QUESO::WignerJointPdf< V, M >::m_radius
protected

Definition at line 88 of file WignerJointPdf.h.

Referenced by QUESO::WignerJointPdf< V, M >::WignerJointPdf().


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

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