- Header:
<vsmc/rng/gammak1.h>
- Distribution: Gamma with scale 1, shape k, \( f(x) = \frac{1}{\Gamma(k)}x^{k-1}e^{-x} \)
- Method:
- k >= 1: Ahrens, J.H. and Dieter, U. (1982). Generating gamma variates by a modified rejection technique. Comm. ACM, 25, 47-54.
- k < 1: Ahrens, J.H. and Dieter, U. (1974). Computer methods for sampling from gamma, beta, poisson and binomial distributions. Computing, 12, 223-246.
Types and functions
gammak1_<N>x<W>_<F>;
void gammak1_<N>x<W>_<F>_init (gammak1_<N>x<W>_<F> *, cburng<N>x<W>_rng_t *, <FT> shape);
<FT> gammak1_<N>x<W>_<F>_init (gammak1_<N>x<W>_<F> *, cburng<N>x<W>_rng_t *);
Macros
GAMMAK1_<N>x<W>
GAMMAK1_<N>x<W>_INIT
GAMMAK1_<N>x<W>_RAND
Examples
#define VSMC_HAS_OPENCL_DOUBLE 1
double shape = 2;