queso-0.51.1
JointPdf.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_JOINT_PROB_DENSITY_H
26 #define UQ_JOINT_PROB_DENSITY_H
27 
28 #include <cmath>
29 
30 #include <boost/math/special_functions.hpp> // for Boost isnan. Note parentheses are important in function call.
31 
32 #include <queso/Environment.h>
33 #include <queso/ScalarFunction.h>
34 #include <queso/BoxSubset.h>
35 
36 namespace QUESO {
37 
38 //*****************************************************
39 // Classes to accommodate a probability density.
40 //*****************************************************
41 
42 //*****************************************************
43 // Base class [PDF-00]
44 //*****************************************************
59 template<class V, class M>
60 class BaseJointPdf : public BaseScalarFunction<V,M> {
61 public:
63 
64 
66  BaseJointPdf(const char* prefix,
67  const VectorSet<V,M>& domainSet);
69  virtual ~BaseJointPdf();
71 
73 
74  virtual double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const = 0;
76 
78  virtual double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const = 0;
79 
81  virtual void setNormalizationStyle (unsigned int value) const;
82 
84  void setLogOfNormalizationFactor (double value) const;
85 
87  virtual double computeLogOfNormalizationFactor(unsigned int numSamples, bool m_logOfNormalizationFactor) const = 0;
88 
89  //const BaseScalarPdf<double>& component(unsigned int componentId) const;
91 protected:
93 
97  double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const;
98 
102 
103  mutable unsigned int m_normalizationStyle;
105 
106 //std::vector<BaseScalarPdf<double>*> m_components; // FIXME: will need to be a parallel vector in case of a very large number of components
107 //BaseScalarPdf<double> m_dummyComponent;
108 };
109 
110 } // End namespace QUESO
111 
112 #endif // UQ_JOINT_PROB_DENSITY_H
A templated class for handling sets.
Definition: VectorSet.h:49
virtual double computeLogOfNormalizationFactor(unsigned int numSamples, bool m_logOfNormalizationFactor) const =0
Computes the logarithm of the normalization factor. See template specialization.
unsigned int m_normalizationStyle
Definition: JointPdf.h:103
double m_logOfNormalizationFactor
Definition: JointPdf.h:104
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
virtual double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0
Logarithm of the value of the function.
BaseJointPdf(const char *prefix, const VectorSet< V, M > &domainSet)
Default constructor.
Definition: JointPdf.C:33
A templated (base) class for handling scalar functions.
Definition: GslOptimizer.h:48
void setLogOfNormalizationFactor(double value) const
Sets a logarithmic value to be used in the normalization factor (stored in the protected attribute m_...
Definition: JointPdf.C:69
virtual ~BaseJointPdf()
Destructor.
Definition: JointPdf.C:55
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
virtual double actualValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0
Actual value of the PDF (scalar function).
virtual void setNormalizationStyle(unsigned int value) const
Sets a value to be used in the normalization style (stored in the protected attribute m_normalization...
Definition: JointPdf.C:61
A templated (base) class for handling joint PDFs.
Definition: JointPdf.h:60

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5