queso-0.51.1
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, class M>
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::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().

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 
51  m_env.worldRank(),
52  "WignerJointPdf<V,M>::constructor()",
53  "invalid radius");
54 
55  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
56  *m_env.subDisplayFile() << "Leaving WignerJointPdf<V,M>::constructor()"
57  << ": prefix = " << m_prefix
58  << std::endl;
59  }
60 }
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
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:436
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
template<class V , class M >
QUESO::WignerJointPdf< V, M >::~WignerJointPdf ( )

Destructor.

Definition at line 63 of file WignerJointPdf.C.

64 {
65  delete m_centerPos;
66 }

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 70 of file WignerJointPdf.C.

References UQ_FATAL_TEST_MACRO.

76 {
77  UQ_FATAL_TEST_MACRO(domainVector.sizeLocal() != this->m_domainSet.vectorSpace().dimLocal(),
78  m_env.worldRank(),
79  "WignerJointPdf<V,M>::actualValue()",
80  "invalid input");
81 
82  if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
83  if (hessianMatrix) *hessianMatrix *= 0.;
84  if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
85 
86  double returnValue = 0.;
87  double distanceRatio = (domainVector - *m_centerPos).norm2()/m_radius;
88  if (distanceRatio < 1.) {
89  returnValue = 2.*m_radius*m_radius*sqrt(1. - distanceRatio*distanceRatio)/M_PI;
90  }
91  returnValue *= exp(m_logOfNormalizationFactor); // [PDF-09]
92 
93  return returnValue;
94 }
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
const VectorSet< V, M > & m_domainSet
Domain set of the scalar function.
double m_logOfNormalizationFactor
Definition: JointPdf.h:104
const BaseEnvironment & m_env
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
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 115 of file WignerJointPdf.C.

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

116 {
117  double value = 0.;
118 
119  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
120  *m_env.subDisplayFile() << "Entering WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
121  << std::endl;
122  }
123  value = BaseJointPdf<V,M>::commonComputeLogOfNormalizationFactor(numSamples, updateFactorInternally);
124  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
125  *m_env.subDisplayFile() << "Leaving WignerJointPdf<V,M>::computeLogOfNormalizationFactor()"
126  << ", m_logOfNormalizationFactor = " << m_logOfNormalizationFactor
127  << std::endl;
128  }
129 
130  return value;
131 }
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
double m_logOfNormalizationFactor
Definition: JointPdf.h:104
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:77
unsigned int displayVerbosity() const
Definition: Environment.C:436
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 98 of file WignerJointPdf.C.

104 {
105  if (gradVector ) *gradVector = m_domainSet.vectorSpace().zeroVector();
106  if (hessianMatrix) *hessianMatrix *= 0.;
107  if (hessianEffect) *hessianEffect = m_domainSet.vectorSpace().zeroVector();
108 
109  // No need to add m_logOfNormalizationFactor because 'actualValue()' is called [PDF-09]
110  return log(this->actualValue(domainVector,domainDirection,gradVector,hessianMatrix,hessianEffect));
111 }
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, class M>
V* QUESO::WignerJointPdf< V, M >::m_centerPos
protected

Definition at line 83 of file WignerJointPdf.h.

template<class V, class M>
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 Apr 23 2015 19:26:19 for queso-0.51.1 by  doxygen 1.8.5