14 #ifndef __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
15 #define __MLPACK_CORE_METRICS_MAHALANOBIS_DISTANCE_HPP
54 template<
bool TakeRoot = true>
71 covariance(arma::eye<arma::mat>(dimensionality, dimensionality)) { }
90 template<
typename VecTypeA,
typename VecTypeB>
91 double Evaluate(
const VecTypeA& a,
const VecTypeB& b);
108 template<
typename Archive>
109 void Serialize(Archive& ar,
const unsigned int version);
119 #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.
MahalanobisDistance()
Initialize the Mahalanobis distance with the empty matrix as covariance.
arma::mat covariance
The covariance matrix associated with this distance.
void Serialize(Archive &ar, const unsigned int version)
Serialize the Mahalanobis distance.
const arma::mat & Covariance() const
Access the covariance matrix.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
MahalanobisDistance(const arma::mat &covariance)
Initialize the Mahalanobis distance with the given covariance matrix.
arma::mat & Covariance()
Modify the covariance matrix.
double Evaluate(const VecTypeA &a, const VecTypeB &b)
Evaluate the distance between the two given points using this Mahalanobis distance.
The Mahalanobis distance, which is essentially a stretched Euclidean distance.