12#ifndef MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
13#define MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
30 covariance = arma::diagmat(arma::clamp(covariance.diag(), 1e-10, DBL_MAX));
42 diagCovariance = arma::clamp(diagCovariance, 1e-10, DBL_MAX);
46 template<
typename Archive>
47 static void serialize(Archive& ,
const unsigned int ) { }
Force a covariance matrix to be diagonal.
static void ApplyConstraint(arma::mat &covariance)
Force a covariance matrix to be diagonal.
static void ApplyConstraint(arma::vec &diagCovariance)
Apply the diagonal constraint to the given diagonal covariance matrix (which is represented as a vect...
static void serialize(Archive &, const unsigned int)
Serialize the constraint (which holds nothing, so, nothing to do).
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.