22 #ifndef __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
23 #define __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
60 template<
bool t_take_root = false>
77 covariance(arma::eye<arma::mat>(dimensionality, dimensionality)) { }
96 template<
typename VecType1,
typename VecType2>
97 double Evaluate(
const VecType1& a,
const VecType2& b);
121 #include "mahalanobis_distance_impl.hpp"
double Evaluate(const VecType1 &a, const VecType2 &b)
Evaluate the distance between the two given points using this Mahalanobis distance.
const arma::mat & Covariance() const
Access the covariance matrix.
MahalanobisDistance(const arma::mat &covariance)
Initialize the Mahalanobis distance with the given covariance matrix.
arma::mat & Covariance()
Modify the covariance matrix.
arma::mat covariance
The covariance matrix associated with this distance.
MahalanobisDistance()
Initialize the Mahalanobis distance with the empty matrix as covariance.
MahalanobisDistance(const size_t dimensionality)
Initialize the Mahalanobis distance with the identity matrix of the given dimensionality.
The Mahalanobis distance, which is essentially a stretched Euclidean distance.