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 uint32_t ) { }
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
Force a covariance matrix to be diagonal.
Definition: diagonal_constraint.hpp:23
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void ApplyConstraint(arma::mat &covariance)
Force a covariance matrix to be diagonal.
Definition: diagonal_constraint.hpp:27
static void ApplyConstraint(arma::vec &diagCovariance)
Apply the diagonal constraint to the given diagonal covariance matrix (which is represented as a vect...
Definition: diagonal_constraint.hpp:38
static void serialize(Archive &, const uint32_t)
Serialize the constraint (which holds nothing, so, nothing to do).
Definition: diagonal_constraint.hpp:47