14 #include <Eigen/Dense>
16 using namespace shogun;
17 using namespace Eigen;
28 CRealDistance::init(l, r);
29 m_mahalanobis_matrix = m;
32 void CCustomMahalanobisDistance::register_params()
48 return "CustomMahalanobisDistance";
63 REQUIRE(avec.
vlen == bvec.
vlen,
"In CCustomMahalanobisDistance::compute the "
64 "feature vectors must have the same number of elements")
69 const VectorXd dvec = Map<const VectorXd>(avec, avec.
vlen) - Map<const VectorXd>(bvec, bvec.
vlen);
71 Map<const MatrixXd> M(m_mahalanobis_matrix.
matrix, m_mahalanobis_matrix.
num_rows,
74 return dvec.transpose()*M*dvec;