43 CRealDistance::init(l, r);
70 get_feature_vector(idx_b);
85 for (int32_t i=0; i < diff.
vlen; i++)
86 diff[i] = bvec.
vector[i] - diff[i];
89 cblas_dgemv(CblasColMajor, CblasNoTrans,
106 void CMahalanobisDistance::init()
112 m_parameters->
add(&
use_mean,
"use_mean",
"If distance shall be computed between mean vector and vector from rhs or between lhs and rhs.");
Features that support dot products among other operations.
static SGMatrix< float64_t > compute_cov(CDotFeatures *lhs, CDotFeatures *rhs)
void add(bool *param, const char *name, const char *description="")
SGMatrix< float64_t > icov
all of classes and functions are contained in the shogun namespace
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
CFeatures * lhs
feature vectors to occur on the left hand side
The class Features is the base class of all feature objects.
CFeatures * rhs
feature vectors to occur on the right hand side
virtual bool init(CFeatures *l, CFeatures *r)
SGVector< T > clone() const
virtual ~CMahalanobisDistance()
static void inverse(SGMatrix< float64_t > matrix)
inverses square matrix in-place
SGVector< float64_t > mean
static float32_t sqrt(float32_t x)