vSMC
vSMC: Scalable Monte Carlo
Classes | Public Types | Public Member Functions | Friends | List of all members
vsmc::NormalMVDistribution< RealType, Dim > Class Template Reference

Multivariate Normal distribution. More...

#include <vsmc/rng/internal/common.hpp>

Classes

class  param_type
 

Public Types

using distribution_type = NormalMVDistribution< RealType, Dim >
 
using result_type = RealType
 

Public Member Functions

 NormalMVDistribution (const result_type *mean=nullptr, const result_type *chol=nullptr)
 Only usable when Dim > 0 More...
 
 NormalMVDistribution (std::size_t dim, const result_type *mean=nullptr, const result_type *chol=nullptr)
 Only usable when Dim == Dynamic More...
 
const result_typechol () const
 
std::size_t dim () const
 
void max (result_type *x) const
 
const result_typemean () const
 
void min (result_type *x) const
 
template<typename RNGType >
void operator() (RNGType &rng, result_type *r)
 
template<typename RNGType >
void operator() (RNGType &rng, result_type *r, const param_type &param)
 
template<typename RNGType >
void operator() (RNGType &rng, std::size_t n, result_type *r)
 
template<typename RNGType >
void operator() (RNGType &rng, std::size_t n, result_type *r, const param_type &param)
 
param_type param () const
 
void param (const param_type &param)
 
void param (param_type &&param)
 
void reset ()
 

Friends

bool operator!= (const distribution_type &dist1, const distribution_type &dist2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const distribution_type &dist)
 
bool operator== (const distribution_type &dist1, const distribution_type &dist2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, distribution_type &dist)
 

Detailed Description

template<typename RealType, std::size_t Dim>
class vsmc::NormalMVDistribution< RealType, Dim >

Multivariate Normal distribution.

The distribution is parameterized by its mean vector and the lower triangular elements of the Cholesky decomposition of the covaraince matrix, packed row by row.

Template Parameters
RealTypeOnly float and double are supported.
DimIf Dim > 0, then the distribution has a static size and does not use dynamic memory. If Dim == Dynamic, then the dimension of the distribution is specified at runtime.

Definition at line 585 of file common.hpp.

Member Typedef Documentation

template<typename RealType, std::size_t Dim>
using vsmc::NormalMVDistribution< RealType, Dim >::distribution_type = NormalMVDistribution<RealType, Dim>

Definition at line 59 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
using vsmc::NormalMVDistribution< RealType, Dim >::result_type = RealType

Definition at line 58 of file normal_mv_distribution.hpp.

Constructor & Destructor Documentation

template<typename RealType, std::size_t Dim>
vsmc::NormalMVDistribution< RealType, Dim >::NormalMVDistribution ( const result_type mean = nullptr,
const result_type chol = nullptr 
)
inlineexplicit

Only usable when Dim > 0

Parameters
meanMean vector, if it is a null pointer, then the mean is a zero vector
cholThe lower triangular elements of the Cholesky decomposition of the covaraince matrix, packed row by row. If it is a nullpointer, then the covariance is the identicy matrix \(I\)

Definition at line 218 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
vsmc::NormalMVDistribution< RealType, Dim >::NormalMVDistribution ( std::size_t  dim,
const result_type mean = nullptr,
const result_type chol = nullptr 
)
inlineexplicit

Only usable when Dim == Dynamic

Definition at line 226 of file normal_mv_distribution.hpp.

Member Function Documentation

template<typename RealType, std::size_t Dim>
const result_type* vsmc::NormalMVDistribution< RealType, Dim >::chol ( ) const
inline

Definition at line 249 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
std::size_t vsmc::NormalMVDistribution< RealType, Dim >::dim ( ) const
inline

Definition at line 245 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
void vsmc::NormalMVDistribution< RealType, Dim >::max ( result_type x) const
inline

Definition at line 238 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
const result_type* vsmc::NormalMVDistribution< RealType, Dim >::mean ( ) const
inline

Definition at line 247 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
void vsmc::NormalMVDistribution< RealType, Dim >::min ( result_type x) const
inline

Definition at line 233 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename RNGType >
void vsmc::NormalMVDistribution< RealType, Dim >::operator() ( RNGType &  rng,
result_type r 
)
inline

Definition at line 266 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename RNGType >
void vsmc::NormalMVDistribution< RealType, Dim >::operator() ( RNGType &  rng,
result_type r,
const param_type param 
)
inline

Definition at line 272 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename RNGType >
void vsmc::NormalMVDistribution< RealType, Dim >::operator() ( RNGType &  rng,
std::size_t  n,
result_type r 
)
inline

Definition at line 278 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename RNGType >
void vsmc::NormalMVDistribution< RealType, Dim >::operator() ( RNGType &  rng,
std::size_t  n,
result_type r,
const param_type param 
)
inline

Definition at line 284 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
param_type vsmc::NormalMVDistribution< RealType, Dim >::param ( ) const
inline

Definition at line 251 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
void vsmc::NormalMVDistribution< RealType, Dim >::param ( const param_type param)
inline

Definition at line 253 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
void vsmc::NormalMVDistribution< RealType, Dim >::param ( param_type &&  param)
inline

Definition at line 259 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
void vsmc::NormalMVDistribution< RealType, Dim >::reset ( )
inline

Definition at line 243 of file normal_mv_distribution.hpp.

Friends And Related Function Documentation

template<typename RealType, std::size_t Dim>
bool operator!= ( const distribution_type dist1,
const distribution_type dist2 
)
friend

Definition at line 300 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const distribution_type dist 
)
friend

Definition at line 307 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
bool operator== ( const distribution_type dist1,
const distribution_type dist2 
)
friend

Definition at line 292 of file normal_mv_distribution.hpp.

template<typename RealType, std::size_t Dim>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
distribution_type dist 
)
friend

Definition at line 319 of file normal_mv_distribution.hpp.