vSMC  v3.0.0
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 1104 of file rng/internal/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 228 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 253 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 249 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 242 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 251 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 237 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 270 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 276 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 282 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 288 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 255 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 257 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 263 of file normal_mv_distribution.hpp.

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

Definition at line 247 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 304 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 311 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 296 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 323 of file normal_mv_distribution.hpp.