2 #ifndef vpdl_distribution_h_ 3 #define vpdl_distribution_h_ 19 # include <vcl_msvc_warnings.h> 32 template<
class T,
unsigned int n=0>
47 virtual unsigned int dimension()
const = 0;
124 template<
class T,
unsigned int n>
132 template<
class T,
unsigned int n>
141 template<
class T,
unsigned int n>
145 return d.log_density(pt);
149 template<
class T,
unsigned int n>
157 #endif // vpdl_distribution_h_ vpdt_field_traits< field_type >::matrix_type matrix
the data type used for matrices.
virtual T prob_density(const vector &pt) const
Evaluate the probability density at a point.
virtual T norm_const() const =0
The normalization constant for the density.
virtual T log_prob_density(const vector &pt) const
Evaluate the log probability density at a point.
virtual T box_prob(const vector &min_pt, const vector &max_pt) const
The probability of being in an axis-aligned box.
virtual void compute_covar(matrix &covar) const =0
Compute the covariance of the distribution.
A type generator for the default types (those used in vpdl)
vpdt_field_default< T, n >::type field_type
the data type used for vectors.
virtual vector inverse_cdf(const T &p) const
Compute the inverse of the cumulative_prob() function.
virtual T density(const vector &pt) const =0
Evaluate the unnormalized density at a point.
vpdt_field_default< T, n >::type vector
the data type used for vectors.
T vpdt_box_prob(const vpdl_distribution< T, n > &d, const typename vpdt_field_default< T, n >::type &min_pt, const typename vpdt_field_default< T, n >::type &max_pt)
The box probability wrapper for vpdt.
virtual vpdl_distribution< T, n > * clone() const =0
Create a copy on the heap and return base class pointer.
virtual unsigned int dimension() const =0
Return the run time dimension, which does not equal n when n==0.
T vpdt_log_prob_density(const vpdl_distribution< T, n > &d, const typename vpdt_field_default< T, n >::type &pt)
The log probability density wrapper for vpdt.
virtual void compute_mean(vector &mean) const =0
Compute the mean of the distribution.
virtual T cumulative_prob(const vector &pt) const =0
Evaluate the cumulative distribution function at a point.
T vpdt_prob_density(const vpdl_distribution< T, n > &d, const typename vpdt_field_default< T, n >::type &pt)
probability density wrapper for vpdt.
specialized template trait classes for properties of a field type
The field traits class (scalar).
The base class for all probability distributions.
T vpdt_log_density(const vpdl_distribution< T, n > &d, const typename vpdt_field_default< T, n >::type &pt)
The log density wrapper for vpdt.
virtual ~vpdl_distribution()
T vpdl_compute_inverse_cdf(const vpdl_distribution< T, 1 > &dist, double p)
Default implementation of numerical CDF inverse computation.
virtual T gradient_density(const vector &pt, vector &g) const =0
Compute the gradient of the unnormalized density at a point.