GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
randpoisson.cc File Reference
#include "f77-fcn.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "lo-math.h"
#include "lo-slatec-proto.h"
#include "randmtzig.h"
#include "randpoisson.h"
Include dependency graph for randpoisson.cc:

Go to the source code of this file.

Macros

#define C0   9.18938533204672742e-01
 
#define C1   8.33333333333333333e-02
 
#define C3   -2.77777777777777778e-03
 
#define C5   7.93650793650793651e-04
 
#define C7   -5.95238095238095238e-04
 
#define INFINITE   lo_ieee_isinf
 
#define LGAMMA   xlgamma
 
#define RNOR   oct_randn()
 
#define RUNI   oct_randu()
 
#define TABLESIZE   46
 

Functions

static double f (double k, double l_nu, double c_pm)
 
static double flogfak (double k)
 
void oct_fill_float_randp (float FL, octave_idx_type n, float *p)
 
void oct_fill_randp (double L, octave_idx_type n, double *p)
 
float oct_float_randp (float FL)
 
double oct_randp (double L)
 
static void poisson_cdf_lookup (double lambda, double *p, size_t n)
 
static void poisson_cdf_lookup_float (double lambda, float *p, size_t n)
 
static void poisson_rejection (double lambda, double *p, size_t n)
 
static void poisson_rejection_float (double lambda, float *p, size_t n)
 
static double pprsc (double my)
 
static double xlgamma (double x)
 

Macro Definition Documentation

#define C0   9.18938533204672742e-01

Referenced by flogfak().

#define C1   8.33333333333333333e-02

Referenced by flogfak().

#define C3   -2.77777777777777778e-03

Referenced by flogfak().

#define C5   7.93650793650793651e-04

Referenced by flogfak().

#define C7   -5.95238095238095238e-04

Referenced by flogfak().

#define INFINITE   lo_ieee_isinf

Definition at line 47 of file randpoisson.cc.

Referenced by oct_fill_float_randp(), oct_fill_randp(), oct_float_randp(), and oct_randp().

#define LGAMMA   xlgamma

Definition at line 50 of file randpoisson.cc.

Referenced by poisson_rejection(), and poisson_rejection_float().

#define RNOR   oct_randn()

Definition at line 49 of file randpoisson.cc.

Referenced by oct_fill_float_randp(), oct_fill_randp(), oct_float_randp(), and oct_randp().

#define RUNI   oct_randu()
#define TABLESIZE   46

Function Documentation

static double f ( double  k,
double  l_nu,
double  c_pm 
)
static

Definition at line 141 of file randpoisson.cc.

References flogfak().

Referenced by pprsc().

static double flogfak ( double  k)
static

Definition at line 75 of file randpoisson.cc.

References C0, C1, C3, C5, C7, k, and log().

Referenced by f(), poisson_rejection(), poisson_rejection_float(), and pprsc().

void oct_fill_float_randp ( float  FL,
octave_idx_type  n,
float *  p 
)

Definition at line 547 of file randpoisson.cc.

References octave::math::floor(), INFINITE, NaN(), poisson_cdf_lookup_float(), pprsc(), and RNOR.

Referenced by octave_rand::fill().

void oct_fill_randp ( double  L,
octave_idx_type  n,
double p 
)

Definition at line 476 of file randpoisson.cc.

References octave::math::floor(), INFINITE, NaN(), poisson_cdf_lookup(), pprsc(), and RNOR.

Referenced by octave_rand::fill().

float oct_float_randp ( float  FL)

Definition at line 580 of file randpoisson.cc.

References octave::math::floor(), INFINITE, NaN(), poisson_rejection_float(), RNOR, RUNI, and t.

double oct_randp ( double  L)
static void poisson_cdf_lookup ( double  lambda,
double p,
size_t  n 
)
static

Definition at line 296 of file randpoisson.cc.

References octave::math::floor(), k, P, RUNI, t, TABLESIZE, and u.

Referenced by oct_fill_randp().

static void poisson_cdf_lookup_float ( double  lambda,
float *  p,
size_t  n 
)
static

Definition at line 369 of file randpoisson.cc.

References octave::math::floor(), k, P, RUNI, t, TABLESIZE, and u.

Referenced by oct_fill_float_randp().

static void poisson_rejection ( double  lambda,
double p,
size_t  n 
)
static

Definition at line 415 of file randpoisson.cc.

References flogfak(), octave::math::floor(), LGAMMA, log(), RUNI, t, and y.

Referenced by oct_randp().

static void poisson_rejection_float ( double  lambda,
float *  p,
size_t  n 
)
static

Definition at line 441 of file randpoisson.cc.

References flogfak(), octave::math::floor(), LGAMMA, log(), RUNI, t, and y.

Referenced by oct_float_randp().

static double pprsc ( double  my)
static

Definition at line 147 of file randpoisson.cc.

References octave::math::ceil(), f(), flogfak(), octave::math::floor(), log(), m, RUNI, V, W, and Y.

Referenced by oct_fill_float_randp(), and oct_fill_randp().

static double xlgamma ( double  x)
static