ParM  parm
A molecular dynamics library
Public Member Functions | Protected Attributes | List of all members
BivariateGauss Class Reference

A class for generating two random numbers from a Gaussian distribution, with a given correlation. More...

#include <vecrand.hpp>

Public Member Functions

 BivariateGauss (const flt s1=1, const flt s2=1, const flt corr=0)
 See set() for parameters. More...
 
void set (const flt s1, const flt s2, const flt corr)
 Set the standard deviations and correlations. More...
 
Eigen::Matrix< flt, 1, 2 > generate ()
 Randomly generate two correlated numbers. More...
 
Vec gen_vec ()
 Generate a single Vec. More...
 
VecPair gen_vecs ()
 Randomly generate two correlated Vec objects. More...
 

Protected Attributes

normdistribution distro
 
normgenerator gauss
 
flt x11
 
flt x21
 
flt x22
 

Detailed Description

A class for generating two random numbers from a Gaussian distribution, with a given correlation.

This is used by some of the integrators.

Constructor & Destructor Documentation

BivariateGauss::BivariateGauss ( const flt  s1 = 1,
const flt  s2 = 1,
const flt  corr = 0 
)

See set() for parameters.

Member Function Documentation

Vec BivariateGauss::gen_vec ( )
inline

Generate a single Vec.

VecPair BivariateGauss::gen_vecs ( )

Randomly generate two correlated Vec objects.

Eigen::Matrix< flt, 1, 2 > BivariateGauss::generate ( )

Randomly generate two correlated numbers.

void BivariateGauss::set ( const flt  s1,
const flt  s2,
const flt  corr 
)

Set the standard deviations and correlations.

Parameters
s1Standard deviation of the first vector. s1 > 0.
s2Standard deviation of the second vector. s2 > 0.
corrNormalized correlation between the two vectors, 0 <= corr <= 1.

Member Data Documentation

normdistribution BivariateGauss::distro
protected
normgenerator BivariateGauss::gauss
protected
flt BivariateGauss::x11
protected
flt BivariateGauss::x21
protected
flt BivariateGauss::x22
protected

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