bi-kappa 3.0.0
Monte Carlo particle samplers for plasma velocity and position distributions
Loading...
Searching...
No Matches
bi_kappa_distribution.H File Reference
#include <array>
#include <algorithm>
#include <cmath>
#include <limits>
#include <random>
#include <stdexcept>

Go to the source code of this file.

Classes

class  bi_kappa_distribution< RealType >
 Bi-Kappa distribution class for sampling 3D velocity vectors. More...
class  bi_kappa_distribution< RealType >::param_type
 The parameters of a bi_kappa_distribution: kappa, theta_perp, theta_par, ub and the velocity cap. More...

Namespaces

namespace  bikappa_detail
 Sampling primitives used to build the bi-Kappa radius.

Macros

#define BI_KAPPA_VERSION_MAJOR   3
 Version of this header, so that code which vendors the file can tell which sampler it has.
#define BI_KAPPA_VERSION_MINOR   0
#define BI_KAPPA_VERSION_PATCH   0
#define BI_KAPPA_VERSION_STRING   "3.0.0"

Functions

template<typename GeneratorType>
int bikappa_detail::engineBits ()
 Whole bits of entropy the engine delivers per call (32 for std::mt19937).
template<typename RealType, typename GeneratorType>
RealType bikappa_detail::openCanonical (GeneratorType &gen)
 Uniform on the open interval (0,1), by an explicit mapping from engine bits.
template<typename RealType, typename GeneratorType>
RealType bikappa_detail::polarNormal (GeneratorType &gen, RealType &cache, bool &cached)
 Standard normal by the Marsaglia polar method.
template<typename RealType, typename GeneratorType>
RealType bikappa_detail::marsagliaTsangGamma (RealType shape, GeneratorType &gen, RealType &ncache, bool &ncached)
 Gamma(shape, 1) for shape >= 1, by Marsaglia and Tsang (2000), ACM TOMS 26(3), 363-372.
template<typename RealType, typename GeneratorType>
RealType bikappa_detail::logGamma (RealType a, GeneratorType &gen, RealType &ncache, bool &ncached)
 log X for X ~ Gamma(a, 1), for every a > 0, without ever forming X.
template<typename RealType>
bool bikappa_detail::materializeComponents (RealType logR, const std::array< RealType, 3 > &g, std::array< RealType, 3 > &point)
 Materialize V_j = R g_j from log R, and report whether any component overflowed.

Macro Definition Documentation

◆ BI_KAPPA_VERSION_MAJOR

#define BI_KAPPA_VERSION_MAJOR   3

Version of this header, so that code which vendors the file can tell which sampler it has.

The major version changes whenever some seed produces different numbers. CHANGELOG.md lists the changes between versions.

Definition at line 7 of file bi_kappa_distribution.H.

◆ BI_KAPPA_VERSION_MINOR

#define BI_KAPPA_VERSION_MINOR   0

Definition at line 8 of file bi_kappa_distribution.H.

◆ BI_KAPPA_VERSION_PATCH

#define BI_KAPPA_VERSION_PATCH   0

Definition at line 9 of file bi_kappa_distribution.H.

◆ BI_KAPPA_VERSION_STRING

#define BI_KAPPA_VERSION_STRING   "3.0.0"

Definition at line 10 of file bi_kappa_distribution.H.