14 #ifndef __MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
15 #define __MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
32 arma::vec diagonal = covariance.diag();
33 covariance = arma::diagmat(diagonal);
37 template<
typename Archive>
38 static void Serialize(Archive& ,
const unsigned int ) { }
Linear algebra utility functions, generally performed on matrices or vectors.
Force a covariance matrix to be diagonal.
static void ApplyConstraint(arma::mat &covariance)
Force a covariance matrix to be diagonal.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
static void Serialize(Archive &, const unsigned int)
Serialize the constraint (which holds nothing, so, nothing to do).