22 #ifndef __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
23 #define __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
60 template<
bool TakeRoot = false>
77 covariance(arma::eye<arma::mat>(dimensionality, dimensionality)) { }
99 template<
typename VecType1,
typename VecType2>
100 double Evaluate(
const VecType1& a,
const VecType2& b);
123 #include "mahalanobis_distance_impl.hpp"
MahalanobisDistance(const size_t dimensionality)
Initialize the Mahalanobis distance with the identity matrix of the given dimensionality.
Linear algebra utility functions, generally performed on matrices or vectors.
std::string ToString() const
Evaluate the distance between the two given points using this Mahalanobis distance.
MahalanobisDistance()
Initialize the Mahalanobis distance with the empty matrix as covariance.
arma::mat covariance
The covariance matrix associated with this distance.
double Evaluate(const VecType1 &a, const VecType2 &b)
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.
The Mahalanobis distance, which is essentially a stretched Euclidean distance.