2 #ifndef vpdl_gaussian_indep_h_ 3 #define vpdl_gaussian_indep_h_ 18 # include <vcl_msvc_warnings.h> 27 template<
class T,
unsigned int n=0>
46 :
impl_(mean_val,var) {}
63 return impl_.density(pt);
84 return impl_.gradient_density(pt,g);
92 return impl_.norm_const();
99 return impl_.sqr_mahal_dist(pt);
107 return impl_.cumulative_prob(pt);
129 impl_.compute_covar(covar);
137 #endif // vpdl_gaussian_indep_h_ vpdt_field_traits< field_type >::matrix_type matrix
the data type used for matrices.
vpdl_gaussian_indep(const vector &mean_val, const covar_type &var)
Constructor - from mean and variance.
virtual T prob_density(const vector &pt) const
Evaluate the probability density at a point.
virtual T density(const vector &pt) const
Evaluate the unnormalized density at a point.
virtual T log_prob_density(const vector &pt) const
Evaluate the log probability density at a point.
vpdl_gaussian_indep(unsigned int var_dim=n)
Constructor.
vpdt_gaussian< vector, covar_type > impl_
the Gaussian implementation from vpdt.
The basic functions for probability calculations.
virtual T gradient_density(const vector &pt, vector &g) const
Compute the gradient of the unnormalized density at a point.
vpdt_field_traits< vector >::matrix_type matrix
the data type used for matrices.
virtual void compute_mean(vector &mean_val) const
Compute the mean of the distribution.
virtual T norm_const() const
The normalization constant for the density.
virtual unsigned int dimension() const
Return the run time dimension, which does not equal n when n==0.
virtual vpdl_distribution< T, n > * clone() const
Create a copy on the heap and return base class pointer.
virtual T cumulative_prob(const vector &pt) const
Evaluate the cumulative distribution function at a point.
The abstract base class for Gaussian distributions.
T sqr_mahal_dist(const vector &pt) const
The squared Mahalanobis distance to this point.
virtual ~vpdl_gaussian_indep()
Destructor.
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_covar(matrix &covar) const
Compute the covariance of the distribution.
A Gaussian with variance independent in each dimension.
vpdt_field_default< T, n >::type vector
the data type used for vectors.
const covar_type & covariance() const
Access the vector of variance.
The abstract base class for Gaussian distributions.
A generic Gaussian distribution.
T vpdt_prob_density(const vpdl_distribution< T, n > &d, const typename vpdt_field_default< T, n >::type &pt)
probability density wrapper for vpdt.
vector covar_type
the type used internally for covariance.
void set_covariance(const covar_type &var)
Set the vector of variance.
The field traits class (scalar).
The base class for all probability distributions.
The basic functions for log of probability calculation.
virtual void set_mean(const vector &mean_val)
Set the mean.
virtual const vector & mean() const
Access the mean directly.
A Gaussian with variance independent in each dimension.