mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
EigenvalueRatioConstraint Class Reference

Given a vector of eigenvalue ratios, ensure that the covariance matrix always has those eigenvalue ratios. More...

Public Member Functions

 EigenvalueRatioConstraint (const arma::vec &ratios)
 Create the EigenvalueRatioConstraint object with the given vector of eigenvalue ratios. More...
 
void ApplyConstraint (arma::mat &covariance) const
 Apply the eigenvalue ratio constraint to the given covariance matrix. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the constraint. More...
 

Detailed Description

Given a vector of eigenvalue ratios, ensure that the covariance matrix always has those eigenvalue ratios.

When you create this object, make sure that the vector of ratios that you pass does not go out of scope, because this object holds a reference to that vector instead of copying it. (This doesn't apply if you are deserializing the object from a file.)

Definition at line 27 of file eigenvalue_ratio_constraint.hpp.

Constructor & Destructor Documentation

EigenvalueRatioConstraint ( const arma::vec &  ratios)
inline

Create the EigenvalueRatioConstraint object with the given vector of eigenvalue ratios.

These ratios are with respect to the first eigenvalue, which is the largest eigenvalue, so the first element of the vector should be 1. In addition, all other elements should be less than or equal to 1.

Definition at line 36 of file eigenvalue_ratio_constraint.hpp.

References Log::Fatal, and Log::Warn.

Member Function Documentation

void ApplyConstraint ( arma::mat &  covariance) const
inline

Apply the eigenvalue ratio constraint to the given covariance matrix.

Definition at line 62 of file eigenvalue_ratio_constraint.hpp.

void Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the constraint.

Definition at line 81 of file eigenvalue_ratio_constraint.hpp.

References mlpack::data::CreateNVP().


The documentation for this class was generated from the following file: