queso-0.53.0
Protected Attributes | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::WignerJointPdf< V, M >:
Collaboration graph
[legend]

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...
 
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
 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

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 49 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, queso_require_greater_msg, 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 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const BaseEnvironment & m_env
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
#define queso_require_greater_msg(expr1, expr2, msg)
Definition: asserts.h:88
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_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:100
const VectorSet< V, M > & m_domainSet
Domain set of the scalar function.
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
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 109 of file WignerJointPdf.C.

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

110 {
111  double value = 0.;
112 
113  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
114  *m_env.subDisplayFile() << "Entering WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
115  << std::endl;
116  }
117  value = BaseJointPdf<V,M>::commonComputeLogOfNormalizationFactor(numSamples, updateFactorInternally);
118  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
119  *m_env.subDisplayFile() << "Leaving WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
120  << ", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
121  << std::endl;
122  }
123 
124  return value;
125 }
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::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.

Implements QUESO::BaseJointPdf< 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 }
const VectorSet< V, M > & m_domainSet
Domain set of the scalar function.
double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
Actual value of the PDF (scalar function).

Member Data Documentation

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

Definition at line 83 of file WignerJointPdf.h.

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

Definition at line 84 of file WignerJointPdf.h.

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


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

Generated on Thu Jun 11 2015 13:52:36 for queso-0.53.0 by  doxygen 1.8.5