MLPACK  1.0.10
diagonal_constraint.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
23 #define __MLPACK_METHODS_GMM_DIAGONAL_CONSTRAINT_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace gmm {
29 
34 {
35  public:
37  static void ApplyConstraint(arma::mat& covariance)
38  {
39  // Save the diagonal only.
40  arma::vec diagonal = covariance.diag();
41  covariance = arma::diagmat(diagonal);
42  }
43 };
44 
45 }; // namespace gmm
46 }; // namespace mlpack
47 
48 #endif