queso-0.53.0
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-2015 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 class GslVector;
39 class GslMatrix;
40 
55 template <class V = GslVector, class M = GslMatrix>
56 class BaseJointPdf : public BaseScalarFunction<V,M> {
57 public:
59 
60 
62  BaseJointPdf(const char* prefix,
63  const VectorSet<V,M>& domainSet);
65  virtual ~BaseJointPdf();
67 
69 
70  virtual double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const = 0;
72 
74  virtual double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const = 0;
75 
77  virtual void setNormalizationStyle (unsigned int value) const;
78 
80  void setLogOfNormalizationFactor (double value) const;
81 
83  virtual double computeLogOfNormalizationFactor(unsigned int numSamples, bool m_logOfNormalizationFactor) const = 0;
84 
85  //const BaseScalarPdf<double>& component(unsigned int componentId) const;
87 protected:
89 
93  double commonComputeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const;
94 
98 
99  mutable unsigned int m_normalizationStyle;
101 
102 //std::vector<BaseScalarPdf<double>*> m_components; // FIXME: will need to be a parallel vector in case of a very large number of components
103 //BaseScalarPdf<double> m_dummyComponent;
104 };
105 
106 } // End namespace QUESO
107 
108 #endif // UQ_JOINT_PROB_DENSITY_H
unsigned int m_normalizationStyle
Definition: JointPdf.h:99
BaseJointPdf(const char *prefix, const VectorSet< V, M > &domainSet)
Default constructor.
Definition: JointPdf.C:33
A templated class for handling sets.
Definition: VectorSet.h:52
double m_logOfNormalizationFactor
Definition: JointPdf.h:100
A templated (base) class for handling joint PDFs.
Definition: JointPdf.h:56
virtual double lnValue(const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const =0
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...
Definition: JointPdf.C:77
A templated (base) class for handling scalar functions.
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
virtual double computeLogOfNormalizationFactor(unsigned int numSamples, bool m_logOfNormalizationFactor) const =0
Computes the logarithm of the normalization factor. See template specialization.
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
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

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