2 #ifndef vpdt_mog_fitness_h_ 3 #define vpdt_mog_fitness_h_ 14 # include <vcl_msvc_warnings.h> 20 template <
class gaussian_type,
class Disambiguate =
void>
23 typedef typename gaussian_type::metric_type
Metric;
26 static bool order (
const gaussian_type& g1,
const T& w1,
27 const gaussian_type& g2,
const T& w2)
29 const unsigned int d = g1.dimension();
30 assert(d == g2.dimension());
31 T w1_2 = w1*w1, w2_2 = w2*w2;
32 T v1 = w1_2, v2 = w2_2;
33 for (
unsigned int i=1; i<d; ++i){
37 return v1/Metric::covar_det(g1.mean,g1.covar) >
38 v2/Metric::covar_det(g2.mean,g2.covar);
44 template <
class T1,
class T2>
53 template <
class gaussian_type>
56 typename gaussian_type::covar_type>::type >
60 static bool order (
const gaussian_type& g1,
const T& w1,
61 const gaussian_type& g2,
const T& w2)
63 return w1*w1/g1.covar > w2*w2/g2.covar;
68 #endif // vpdt_mog_fitness_h_ vpdt_dist_traits< gaussian_type >::scalar_type T
The distribution traits class.
static bool order(const gaussian_type &g1, const T &w1, const gaussian_type &g2, const T &w2)
helper class to check that two types are equal.
The Stauffer-Grimson ordering function of mixture component fitness.
static bool order(const gaussian_type &g1, const T &w1, const gaussian_type &g2, const T &w2)
A generic Gaussian distribution.
gaussian_type::metric_type Metric
specialized template trait classes for properties of a field type
vpdt_dist_traits< gaussian_type >::scalar_type T
vpdt_field_traits< field_type >::scalar_type scalar_type
The type used for scalar operations.