2 #ifndef vpdt_log_probability_h_ 3 #define vpdt_log_probability_h_ 23 # include <vcl_msvc_warnings.h> 33 T density = d.density(pt);
35 return std::numeric_limits<T>::infinity();
37 return static_cast<T>(std::log(density));
48 T norm = d.norm_const();
50 return -std::numeric_limits<T>::infinity();
64 T density = d.gradient_density(pt,g);
65 if (density <= T(0)) {
67 return std::numeric_limits<T>::infinity();
71 return static_cast<T>(std::log(density));
75 #endif // vpdt_log_probability_h_ vpdt_field_traits< typename dist::field_type >::field_type field_type
the data type to represent a point in the field.
vpdt_dist_traits< dist >::scalar_type vpdt_log_density(const dist &d, const typename vpdt_dist_traits< dist >::field_type &pt)
Compute the log of the unnormalized density.
vpdt_dist_traits< dist >::scalar_type vpdt_log_prob_density(const dist &d, const typename vpdt_dist_traits< dist >::field_type &pt)
Compute the log of the normalized probability density.
vpdt_field_traits< field_type >::vector_type vector_type
the data type used for vectors (difference between points).
vpdt_dist_traits< dist >::scalar_type vpdt_gradient_log_density(const dist &d, const typename vpdt_dist_traits< dist >::field_type &pt, const typename vpdt_dist_traits< dist >::vector_type &g)
Compute the gradient of the log of the unnormalized density.
specialized template trait classes for properties of a distribution type
vpdt_field_traits< field_type >::scalar_type scalar_type
The type used for scalar operations.
void vpdt_fill(vnl_vector< T > &v, const T &val)
Fill a vnl_vector.