Defines | Functions

randpoisson.c File Reference

#include <stdio.h>
#include "f77-fcn.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "lo-math.h"
#include "randmtzig.h"
#include "randpoisson.h"
Include dependency graph for randpoisson.c:

Go to the source code of this file.

Defines

#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 NAN   octave_NaN
#define RNOR   oct_randn()
#define RUNI   oct_randu()
#define TABLESIZE   46

Functions

static double f (double k, double l_nu, double c_pm)
F77_RET_T F77_FUNC (dlgams, DLGAMS) const
static double flogfak (double k)
void oct_fill_randp (double L, octave_idx_type n, double *p)
double oct_randp (double L)
static void poisson_cdf_lookup (double lambda, double *p, size_t n)
static void poisson_rejection (double lambda, double *p, size_t n)
static double pprsc (double my)

Define 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 50 of file randpoisson.c.

Referenced by oct_fill_randp(), and oct_randp().

#define LGAMMA   xlgamma

Definition at line 53 of file randpoisson.c.

Referenced by DDASPK(), DDASRT(), DDASSL(), and poisson_rejection().

#define NAN   octave_NaN

Definition at line 48 of file randpoisson.c.

Referenced by oct_fill_randp().

#define RNOR   oct_randn()

Definition at line 52 of file randpoisson.c.

Referenced by oct_fill_randp(), and oct_randp().

#define RUNI   oct_randu()

Definition at line 51 of file randpoisson.c.

Referenced by poisson_rejection(), and pprsc().

#define TABLESIZE   46

Referenced by poisson_cdf_lookup().


Function Documentation

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

Definition at line 147 of file randpoisson.c.

References flogfak().

F77_RET_T F77_FUNC ( dlgams  ,
DLGAMS   
) const

Definition at line 56 of file randpoisson.c.

References DLGAMS(), F77_XFCN, lo_ieee_isinf, lo_ieee_isnan, and octave_Inf.

static double flogfak ( double  k  )  [static]

Definition at line 81 of file randpoisson.c.

References C0, C1, C3, C5, and C7.

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

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

Definition at line 406 of file randpoisson.c.

References floor(), INFINITE, NAN, poisson_cdf_lookup(), pprsc(), and RNOR.

Referenced by octave_rand::fill().

double oct_randp ( double  L  ) 

Definition at line 438 of file randpoisson.c.

References floor(), INFINITE, poisson_rejection(), and RNOR.

Referenced by octave_rand::do_scalar().

static void poisson_cdf_lookup ( double  lambda,
double p,
size_t  n 
) [static]

Definition at line 303 of file randpoisson.c.

References floor(), and TABLESIZE.

Referenced by oct_fill_randp().

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

Definition at line 373 of file randpoisson.c.

References flogfak(), floor(), LGAMMA, M_PI, and RUNI.

Referenced by oct_randp().

static double pprsc ( double  my  )  [static]

Definition at line 153 of file randpoisson.c.

References ceil(), f, flogfak(), floor(), r1, r2, RUNI, and V.

Referenced by oct_fill_randp().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines