12 #ifndef MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP 13 #define MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP 30 arma::vec diagonal = covariance.diag();
31 covariance = arma::diagmat(diagonal);
35 template<
typename Archive>
36 static void Serialize(Archive& ,
const unsigned int ) { }
Linear algebra utility functions, generally performed on matrices or vectors.
Force a covariance matrix to be diagonal.
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void ApplyConstraint(arma::mat &covariance)
Force a covariance matrix to be diagonal.
static void Serialize(Archive &, const unsigned int)
Serialize the constraint (which holds nothing, so, nothing to do).