Implements a multi-variate normal distribution with zero mean. More...
#include <shark/Statistics/Distributions/MultiVariateNormalDistribution.h>
Public Member Functions | |
MultiVariateNormalDistribution (RealMatrix const &Sigma) | |
Constructor. More... | |
MultiVariateNormalDistribution () | |
Constructor. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const std::size_t version) |
Stores/Restores the distribution from the supplied archive. More... | |
void | resize (std::size_t size) |
Resizes the distribution. Updates both eigenvectors and eigenvalues. More... | |
RealMatrix const & | covarianceMatrix () const |
Accesses the covariance matrix defining the distribution. More... | |
RealMatrix & | covarianceMatrix () |
Accesses a mutable reference to the covariance matrix defining the distribution. Allows for l-value semantics. More... | |
void | setCovarianceMatrix (RealMatrix const &matrix) |
Sets the covariance matrix and updates the internal variables. This is expensive. More... | |
RealMatrix const & | eigenVectors () const |
Accesses an immutable reference to the eigenvectors of the covariance matrix. More... | |
RealVector const & | eigenValues () const |
Accesses an immutable reference to the eigenvalues of the covariance matrix. More... | |
template<class randomType > | |
result_type | operator() (randomType &rng) const |
Samples the distribution. More... | |
void | update () |
Calculates the evd of the current covariance matrix. More... | |
Implements a multi-variate normal distribution with zero mean.
Definition at line 40 of file MultiVariateNormalDistribution.h.
|
inline |
Constructor.
[in] | Sigma | covariance matrix |
Definition at line 51 of file MultiVariateNormalDistribution.h.
References update().
|
inline |
Constructor.
Definition at line 57 of file MultiVariateNormalDistribution.h.
|
inline |
Accesses the covariance matrix defining the distribution.
Definition at line 76 of file MultiVariateNormalDistribution.h.
Referenced by shark::CMA::covarianceMatrix(), and setCovarianceMatrix().
|
inline |
Accesses a mutable reference to the covariance matrix defining the distribution. Allows for l-value semantics.
ATTENTION: If the reference is altered, update needs to be called manually.
Definition at line 84 of file MultiVariateNormalDistribution.h.
|
inline |
Accesses an immutable reference to the eigenvalues of the covariance matrix.
Definition at line 100 of file MultiVariateNormalDistribution.h.
Referenced by shark::CMA::condition(), and shark::CMA::eigenValues().
|
inline |
Accesses an immutable reference to the eigenvectors of the covariance matrix.
Definition at line 95 of file MultiVariateNormalDistribution.h.
Referenced by shark::CMA::eigenVectors().
|
inline |
Samples the distribution.
Definition at line 106 of file MultiVariateNormalDistribution.h.
References shark::random::gauss().
|
inline |
Resizes the distribution. Updates both eigenvectors and eigenvalues.
[in] | size | The new size of the distribution |
Definition at line 70 of file MultiVariateNormalDistribution.h.
References update().
Referenced by main().
|
inline |
Stores/Restores the distribution from the supplied archive.
[in,out] | ar | The archive to read from/write to. |
[in] | version | Currently unused. |
Definition at line 63 of file MultiVariateNormalDistribution.h.
|
inline |
Sets the covariance matrix and updates the internal variables. This is expensive.
Definition at line 89 of file MultiVariateNormalDistribution.h.
References covarianceMatrix(), and update().
Referenced by shark::MultiVariateNormalDistributionCholesky::MultiVariateNormalDistributionCholesky().
|
inline |
Calculates the evd of the current covariance matrix.
Definition at line 118 of file MultiVariateNormalDistribution.h.
Referenced by MultiVariateNormalDistribution(), resize(), and setCovarianceMatrix().