vSMC
vSMC: Scalable Monte Carlo
Classes | Functions
Covariance

Covariance matrix estimation and manipulation. More...

Classes

class  vsmc::Covariance< RealType >
 Covariance. More...
 

Functions

template<typename RealType >
int vsmc::cov_chol (std::size_t dim, const RealType *cov, RealType *chol, MatrixLayout layout=RowMajor, bool upper=false, bool packed=false)
 Compute Cholesky decomposition of the covariance matrix. More...
 

Detailed Description

Covariance matrix estimation and manipulation.

Function Documentation

template<typename RealType >
int vsmc::cov_chol ( std::size_t  dim,
const RealType *  cov,
RealType *  chol,
MatrixLayout  layout = RowMajor,
bool  upper = false,
bool  packed = false 
)
inline

Compute Cholesky decomposition of the covariance matrix.

Parameters
dimThe number of rows of the covariance matrix
covThe covariance matrix
cholThe output lower triangular elements of the Cholesky decomposition, packed row by row. This can be directly used as the input parameter of the NormalMVDistribution constructors.
layoutThe storage layout of the covariance matrix
upperIf true, the upper triangular of the covariance matrix shall be used. Otherwise the lower triangular shall be used.
packedIf the upper or lower triangular of covariance matrix is packed, row by row if layout == RowMajor, or column by column if layout == ColMajor.
Returns
  • 0 If successful
  • Positive value i if the ith minor of the covariance matrix is not psotive-definite.

Definition at line 129 of file covariance.hpp.