LibRan
0.1
Pseudo-random number distribution generator
|
The LibRan common header file. More...
#include <stdarg.h>
Go to the source code of this file.
Data Structures | |
union | LR_val |
spans the set of allowed value types More... | |
struct | LR_obj |
the fundamental LibRan random variate distribution object More... | |
struct | LR_bin |
the binning object - for tallying results More... | |
struct | LR_pcs |
A special object for defining some of the random variate distributions. More... | |
struct | LR_uinvcdf |
A special object for using a user defined CDF. More... | |
Macros | |
#define | LR_VER_MAJOR 0 |
#define | LR_VER_MINOR 5 |
#define | LR_VER_PATCH 1 |
#define | LR_VERSION LR_VER_MAJOR.LR_VER_MINOR.LR_VER_PATCH |
LibRan Library Version (X.Y.Z) | |
#define | LR_DATE 20191201 |
LibRan Library date (YYYYMMDD) | |
#define | LRerr_OK 0x00 |
#define | LRerr_Unspecified 0x01 |
#define | LRerr_BadDataType 0x03 |
#define | LRerr_BadLRType 0x05 |
#define | LRerr_NoAuxiliaryObject 0x09 |
#define | LRerr_NoAuxNormalizeDone 0x0B |
#define | LRerr_BadAuxSetup 0x0D |
#define | LRerr_BinGeneric 0x11 |
#define | LRerr_TooManyValues 0x13 |
#define | LRerr_InvalidInputValue 0x15 |
#define | LRerr_InvalidRange 0x17 |
#define | LRerr_UnmetPreconditions 0x19 |
#define | LRerr_SuspiciousValues 0x1B |
#define | LRerr_AllocFail 0x1D |
#define | LRerr_InvalidCDF 0x21 |
#define | LR_AUX_NORM 0x01 |
#define | LR_AUX_SET 0x02 |
Typedefs | |
typedef struct LR_obj | LR_obj |
the fundamental LibRan distribution object - the LR_obj struct | |
Enumerations | |
enum | LR_type { poisson = 1, geometric, binomial, unif, piece, lspline, uinvcdf, gausbm, gausmar, gsn2, gsn4, gsn12, logd, nexp, erlang, cauchy, cauchymar } |
an enum of allowed random variate distribution types More... | |
enum | LR_data_type { LR_int = 1, LR_long, LR_float, LR_double } |
an enum of allowed value types More... | |
Functions | |
LR_obj * | LR_new (LR_type t, LR_data_type d) |
LR_new(LR_type t, LR_data_type d) - create the LR object and preset some default parameter values. More... | |
int | LR_rm (LR_obj **o) |
LR_rm(LR_obj **o) - destroy the LR object and release allocated memory. More... | |
int | LR_check (LR_obj *o) |
LR_check(LR_obj *o) - check and fix the LR object parameters if possible. More... | |
int | LR_vset (LR_obj *o, char *x, va_list ap) |
LR_vset(LR_obj *o, char *x, va_list ap) - read and parse options. More... | |
int | LR_set (LR_obj *o, char x,...) |
LR_set(LR_obj *o, char x, ...) - set a single LR object parameter. More... | |
int | LR_set_all (LR_obj *o, char *x,...) |
LR_set_all(LR_obj *o, char *x, ...) - set all given LR object parameters. More... | |
LR_bin * | LR_bin_new (int n) |
LR_bin_new(LR_data_type d, int n) - create new binning object. More... | |
int | LR_bin_rm (LR_bin **b) |
LR_bin_rm(LR_bin **b) - remove binning object. More... | |
int | LR_bin_set (LR_bin *b, double x) |
LR_bin_set(LR_bin *b, double x) - add bin boundary. More... | |
int | LR_bin_add (LR_bin *b, double x) |
LR_bin_add(LR_bin *b, double x) - collect value to be binned. More... | |
char * | LRstrerror (int LRerrno) |
LRstrerror(int LRerrno) - return some explanatory text regarding the given LibRan errno. More... | |
char * | LRstrerrno (int LRerrno) |
LRstrerrno(int LRerrno) - return the errno code string for the given LibRan errno. More... | |
void | LRperror (char *str, int LRerrno) |
LRperror(char *str, int LRerrno) - print out explanatory error message to stderr. More... | |
char * | LRversion (char *str) |
int | LR_irand (LR_obj *) |
LR_irand(LR_obj *) - returns int in range [0,LR_IRAND_IMAX]. More... | |
float | LR_frand (LR_obj *) |
LR_frand(LR_obj *) - returns float in range [0.0,1.0) More... | |
void | LR_isetseed (LR_obj *, int ity) |
LR_isetseed(LR_obj *, int X) - set the seed to X. More... | |
int | LR_igetseed (LR_obj *) |
LR_igetseed(LR_obj *) - get the current seed. More... | |
int | LR_igetrand (LR_obj *) |
LR_igetrand(LR_obj *) - get the current pseudo-random number. More... | |
float | LR_fgetrand (LR_obj *) |
LR_fgetrand(LR_obj *) - get the current pseudo-random number. More... | |
long | LR_lrand (LR_obj *) |
LR_lrand(LR_obj *) - returns long in range [0,LR_IRAND_LMAX]. More... | |
double | LR_drand (LR_obj *) |
LR_drand(LR_obj *) - returns double in range [0.0,1.0) More... | |
void | LR_lsetseed (LR_obj *, long lty) |
LR_lsetseed(LR_obj *, long X) - set the seed to X. More... | |
long | LR_lgetseed (LR_obj *) |
LR_lgetseed(LR_obj *) - get the current seed. More... | |
long | LR_lgetrand (LR_obj *) |
LR_lgetrand(LR_obj *) - get the current pseudo-random number. More... | |
double | LR_dgetrand (LR_obj *) |
LR_dgetrand(LR_obj *) - get the current pseudo-random number. More... | |
int | LR_igetval (char *str) |
LR_igetval(char *val) - return the configure value. More... | |
long | LR_lgetval (char *str) |
LR_lgetval(char *val) - return the configure value. More... | |
float | LR_fgetval (char *str) |
LR_fgetval(char *val) - return the configure value. More... | |
double | LR_dgetval (char *str) |
LR_dgetval(char *val) - return the configure value. More... | |
double | LRd_RAN (LR_obj *o) |
LRd_RAN(LR_obj *o) - random variate generator. More... | |
double | LRd_PDF (LR_obj *o, double x) |
LRd_PDF(LR_obj *o, double x) - probability distribution function. More... | |
double | LRd_CDF (LR_obj *o, double x) |
LRd_CDF(LR_obj *o, double x) - cumulative distribution function. More... | |
float | LRf_RAN (LR_obj *o) |
LRf_RAN(LR_obj *o) - random variate generator. More... | |
float | LRf_PDF (LR_obj *o, float x) |
LRf_PDF(LR_obj *o, float x) - probability distribution function. More... | |
float | LRf_CDF (LR_obj *o, float x) |
LRf_CDF(LR_obj *o, float x) - cumulative distribution function. More... | |
int | LRi_RAN (LR_obj *o) |
LRi_RAN(LR_obj *o) - random variate generator. More... | |
float | LRi_PDF (LR_obj *o, int x) |
LRi_PDF(LR_obj *o, int x) - probability distribution function. More... | |
float | LRi_CDF (LR_obj *o, int x) |
LRi_CDF(LR_obj *o, int x) - cumulative distribution function. More... | |
int | LR_aux_new (LR_obj *o, int n) |
LR_aux_new(LR_obj *o, int n) - initialize a new auxiliary object. More... | |
int | LR_aux_rm (LR_obj *o) |
LR_aux_rm(LR_obj *o) - remove the auxiliary object. More... | |
int | LR_aux_set (LR_obj *o, double x, double p) |
LR_aux_set(LR_obj *o, double x, double p) - add an interval boundary for the underlying distribution. More... | |
int | LR_aux_norm (LR_obj *o) |
LR_aux_norm(LR_obj *o) - process given intervals and normalize values. More... | |
double | LRd_unif_RAN (LR_obj *o) |
LRd_unif_RAN(LR_obj *o) - double random uniform distribution. More... | |
double | LRd_unif_PDF (LR_obj *o, double x) |
LRd_unif_PDF(LR_obj *o, double x) - double uniform probablity distribution function. More... | |
double | LRd_unif_CDF (LR_obj *o, double x) |
LRd_unif_CDF(LR_obj *o, double x) - double uniform cumulative distribution function. More... | |
float | LRf_unif_RAN (LR_obj *o) |
LRf_unif_RAN(LR_obj *o) - float random uniform distribution. More... | |
float | LRf_unif_PDF (LR_obj *o, float x) |
LRf_unif_PDF(LR_obj *o, float x) - float uniform probablity distribution function. More... | |
float | LRf_unif_CDF (LR_obj *o, float x) |
LRf_unif_CDF(LR_obj *o, float x) - float uniform cumulative distribution function. More... | |
int | LR_pcs_new (LR_obj *o, int n) |
LR_pcs_new(LR_obj *o, int n) - create a new piecewise uniform object set of segments. More... | |
int | LR_pcs_rm (LR_obj *o) |
LR_pcs_rm(LR_obj *o) - strip out the LR_pcs object part of LR_obj. More... | |
int | LR_pcs_set (LR_obj *o, double x, double p) |
LR_pcs_set(LR_obj *o, double x) - add interval boundary (will order internally). More... | |
int | LR_pcs_norm (LR_obj *o) |
LR_pcs_norm(LR_obj *o) - normalize the interval scale factors. More... | |
double | LRd_piece_RAN (LR_obj *o) |
LRd_piece_RAN(LR_obj *o) - double random piecewise uniform distribution random variate. More... | |
double | LRd_piece_PDF (LR_obj *o, double x) |
LRd_piece_PDF(LR_obj *o, double x) - double piecewise uniform probablity distribution function. More... | |
double | LRd_piece_CDF (LR_obj *o, double x) |
LRd_piece_CDF(LR_obj *o, double x) - double piecewise uniform cumulative distribution function. More... | |
float | LRf_piece_RAN (LR_obj *o) |
LRf_piece_RAN(LR_obj *o) - float random piecewise uniform distribution. More... | |
float | LRf_piece_PDF (LR_obj *o, float x) |
LRf_piece_PDF(LR_obj *o, float x) - float piecewise uniform probablity distribution function. More... | |
float | LRf_piece_CDF (LR_obj *o, float x) |
LRf_piece_CDF(LR_obj *o, float x) - float piecewise uniform cumulative distribution function. More... | |
int | LR_lspl_new (LR_obj *o, int n) |
LR_lspl_new(LR_obj *o, int n) - create a new linear spline object. More... | |
int | LR_lspl_rm (LR_obj *o) |
LR_lspl_rm(LR_obj *o) - strip out the LR_lspl object part of LR_obj. More... | |
int | LR_lspl_set (LR_obj *o, double x, double p) |
LR_lspl_set(LR_obj *o, double x) - add interval boundary (will order internally). More... | |
int | LR_lspl_norm (LR_obj *o) |
LR_lspl_norm(LR_obj *o) - normalize the interval scale factors. More... | |
double | LRd_lspline_RAN (LR_obj *o) |
LRd_lspline_RAN(LR_obj *o) - double random linear spline distribution random variate. More... | |
double | LRd_lspline_PDF (LR_obj *o, double x) |
LRd_lspline_PDF(LR_obj *o, double x) - double linear spline probablity distribution function. More... | |
double | LRd_lspline_CDF (LR_obj *o, double x) |
LRd_lspline_CDF(LR_obj *o, double x) - double linear spline cumulative distribution function. More... | |
float | LRf_lspline_RAN (LR_obj *o) |
LRf_lspline_RAN(LR_obj *o) - float random linear spline distribution. More... | |
float | LRf_lspline_PDF (LR_obj *o, float x) |
LRf_lspline_PDF(LR_obj *o, float x) - float linear spline probablity distribution function. More... | |
float | LRf_lspline_CDF (LR_obj *o, float x) |
LRf_lspline_CDF(LR_obj *o, float x) - float linear spline cumulative distribution function. More... | |
double | LRd_uinvcdf_RAN (LR_obj *o) |
LRd_uinvcdf_RAN(LR_obj *o) - double random variate via inverse method of the UserCDF() fn. More... | |
double | LRd_uinvcdf_PDF (LR_obj *o, double x) |
LRd_uinvcdf_PDF(LR_obj *o, double x) - double probability distribution function approximated from the user supplied cumulative distribution function. More... | |
double | LRd_uinvcdf_CDF (LR_obj *o, double x) |
LRd_uinvcdf_CDF(LR_obj *o, double x) - double User supplied cumulative distribution function. More... | |
int | LRd_uinvcdf (LR_obj *o, double(*cdf)(double)) |
LRd_uinvcdf() - set the user defined CDF for this variate distribution. More... | |
float | LRf_uinvcdf_RAN (LR_obj *o) |
LRf_uinvcdf_RAN(LR_obj *o) - float random variate via inverse method of the UserCDF() fn. More... | |
float | LRf_uinvcdf_PDF (LR_obj *o, float x) |
LRf_uinvcdf_PDF(LR_obj *o, float x) - float probability distribution function approximated from the user supplied cumulative distribution function. More... | |
float | LRf_uinvcdf_CDF (LR_obj *o, float x) |
LRf_uinvcdf_CDF(LR_obj *o, float x) - float User supplied cumulative distribution function. More... | |
int | LRf_uinvcdf (LR_obj *o, float(*cdf)(float)) |
LRf_uinvcdf() - set the user defined CDF for this variate distribution. More... | |
double | LRd_nexp_RAN (LR_obj *o) |
LRd_nexp_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: peak m = 1. More... | |
double | LRd_nexp_PDF (LR_obj *o, double x) |
LRd_nexp_PDF(LR_obj *o, double x) - double negative exponential probablity distribution function. More... | |
double | LRd_nexp_CDF (LR_obj *o, double x) |
LRd_nexp_CDF(LR_obj *o, double x) - double negative exponential cumulative distribution function. More... | |
float | LRf_nexp_RAN (LR_obj *o) |
LRf_nexp_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: peak m = 1. More... | |
float | LRf_nexp_PDF (LR_obj *o, float x) |
LRf_nexp_PDF(LR_obj *o, float x) - float negative exponential probablity distribution function. More... | |
float | LRf_nexp_CDF (LR_obj *o, float x) |
LRf_nexp_CDF(LR_obj *o, float x) - float negative exponential cumulative distribution function. More... | |
double | LRd_erlang_RAN (LR_obj *o) |
LRd_erlang_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: scale m = 1. More... | |
double | LRd_erlang_PDF (LR_obj *o, double x) |
LRd_erlang_PDF(LR_obj *o, double x) - Erlang distribution probablity distribution function. More... | |
double | LRd_erlang_CDF (LR_obj *o, double x) |
LRd_erlang_CDF(LR_obj *o, double x) - Erlang distribution cumulative distribution function. More... | |
float | LRf_erlang_RAN (LR_obj *o) |
LRf_erlang_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: scale m = 1. More... | |
float | LRf_erlang_PDF (LR_obj *o, float x) |
LRf_erlang_PDF(LR_obj *o, float x) - Erlang distribution probablity distribution function. More... | |
float | LRf_erlang_CDF (LR_obj *o, float x) |
LRf_erlang_CDF(LR_obj *o, float x) - Erlang distribution cumulative distribution function. More... | |
double | LRd_gausbm_RAN (LR_obj *o) |
LRd_gausbm_RAN(LR_obj *o) - double random Gaussian/Normal distribution using the Box-Muller method. More... | |
double | LRd_gausmar_RAN (LR_obj *o) |
LRd_gausmar_RAN(LR_obj *o) - double random Gaussian/Normal distribution using the Marsaglia method with acceptance-rejection. More... | |
double | LRd_gaus_PDF (LR_obj *o, double x) |
LRd_gaus_PDF(LR_obj *o, double x) - double Gaussian/Normal probablity distribution function. More... | |
double | LRd_gaus_CDF (LR_obj *o, double x) |
LRd_gaus_CDF(LR_obj *o, double x) - double Gaussian/Normal cumulative distribution function. More... | |
float | LRf_gausbm_RAN (LR_obj *o) |
LRf_gausbm_RAN(LR_obj *o) - float random Gaussian/Normal distribution using the Box-Muller method. More... | |
float | LRf_gausmar_RAN (LR_obj *o) |
LRf_gausmar_RAN(LR_obj *o) - float random Gaussian/Normal distribution using the Marsaglia method with acceptance-rejection. More... | |
float | LRf_gaus_PDF (LR_obj *o, float x) |
LRf_gaus_PDF(LR_obj *o, float x) - float Gaussian/Normal probablity distribution function. More... | |
float | LRf_gaus_CDF (LR_obj *o, float x) |
LRf_gaus_CDF(LR_obj *o, float x) - float Gaussian/Normal cumulative distribution function. More... | |
double | LRd_gsn2_RAN (LR_obj *o) |
LRd_gsn2_RAN(LR_obj *o) - double random g2 gaussian-like (saw tooth) distribution. More... | |
double | LRd_gsn2_PDF (LR_obj *o, double x) |
LRd_gsn2_PDF(LR_obj *o, double x) - double gaussian-like (saw tooth) probablity distribution function. More... | |
double | LRd_gsn2_CDF (LR_obj *o, double x) |
LRd_gsn2_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function. More... | |
float | LRf_gsn2_RAN (LR_obj *o) |
LRf_gsn2_RAN(LR_obj *o) - float random g2 gaussian-like (saw tooth) distribution. More... | |
float | LRf_gsn2_PDF (LR_obj *o, float x) |
LRf_gsn2_PDF(LR_obj *o, float x) - float gaussian-like (saw tooth) probablity distribution function. More... | |
float | LRf_gsn2_CDF (LR_obj *o, float x) |
LRf_gsn2_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function. More... | |
double | LRd_gsn4_RAN (LR_obj *o) |
LRd_gsn4_RAN(LR_obj *o) - double random g4 gaussian-like (simple bell curve) distribution. More... | |
double | LRd_gsn4_PDF (LR_obj *o, double x) |
LRd_gsn4_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function. More... | |
double | LRd_gsn4_CDF (LR_obj *o, double x) |
LRd_gsn4_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function. More... | |
float | LRf_gsn4_RAN (LR_obj *o) |
LRf_gsn4_RAN(LR_obj *o) - float random g4 gaussian-like (simple bell curve) distribution. More... | |
float | LRf_gsn4_PDF (LR_obj *o, float x) |
LRf_gsn4_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function. More... | |
float | LRf_gsn4_CDF (LR_obj *o, float x) |
LRf_gsn4_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function. More... | |
double | LRd_gsn12_RAN (LR_obj *o) |
LRd_gsn12_RAN(LR_obj *o) - double random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates. More... | |
double | LRd_gsn12_PDF (LR_obj *o, double x) |
LRd_gsn12_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function. More... | |
double | LRd_gsn12_CDF (LR_obj *o, double x) |
LRd_gsn12_CDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) cumulative distribution function. More... | |
double | LRd_xgsn12_PDF (LR_obj *o, double x) |
double | LRd_xgsn12_CDF (LR_obj *o, double x) |
float | LRf_gsn12_RAN (LR_obj *o) |
LRf_gsn12_RAN(LR_obj *o) - float random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates. More... | |
float | LRf_gsn12_PDF (LR_obj *o, float x) |
LRf_gsn12_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function. More... | |
float | LRf_gsn12_CDF (LR_obj *o, float x) |
LRf_gsn12_CDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) cumulative distribution function. More... | |
double | LRd_cauchy_RAN (LR_obj *o) |
LRd_cauchy_RAN(LR_obj *o) - double random Cauchy/Lorentz distribution using the inversion method on the CDF(x). Default values: peak m = 0, half width s = 1. More... | |
double | LRd_cauchymar_RAN (LR_obj *o) |
LRd_cauchymar_RAN(LR_obj *o) - double random Cauchy/Lorentz distribution using the polar method and the Marsagalia method and acceptance/rejection for generating a Gaussian/Normal variate. Default values: peak m = 0, half width s = 1. More... | |
double | LRd_cauchy_PDF (LR_obj *o, double x) |
LRd_cauchy_PDF(LR_obj *o, double x) - double Cauchy/Lorentz probablity distribution function. More... | |
double | LRd_cauchy_CDF (LR_obj *o, double x) |
LRd_cauchy_CDF(LR_obj *o, double x) - double Cauchy/Lorentz cumulative distribution function. More... | |
float | LRf_cauchy_RAN (LR_obj *o) |
LRf_cauchy_RAN(LR_obj *o) - float random Cauchy/Lorentz distribution using the inversion method. Default values: peak m = 0, half width s = 1. More... | |
float | LRf_cauchymar_RAN (LR_obj *o) |
LRf_cauchymar_RAN(LR_obj *o) - float random Cauchy/Lorentz distribution using the polar method and the Marsagalia method and acceptance/rejection for generating a Gaussian/Normal variate. Default values: peak m = 0, half width s = 1. More... | |
float | LRf_cauchy_PDF (LR_obj *o, float x) |
LRf_cauchy_PDF(LR_obj *o, float x) - float Cauchy/Lorentz probablity distribution function. More... | |
float | LRf_cauchy_CDF (LR_obj *o, float x) |
LRf_cauchy_CDF(LR_obj *o, float x) - float Cauchy/Lorentz cumulative distribution function. More... | |
int | LRi_poisson_RAN (LR_obj *o) |
LRi_poisson_RAN(LR_obj *o) - int Poisson distributed variate. Default values: scale m = 1. More... | |
float | LRi_poisson_PDF (LR_obj *o, int x) |
LRi_poisson_PDF(LR_obj *o, int x) - Poisson probablity (or mass) distribution function. More... | |
float | LRi_poisson_CDF (LR_obj *o, int x) |
LRi_poisson_CDF(LR_obj *o, int x) - Poisson distribution cumulative distribution function. More... | |
int | LRi_geometric_RAN (LR_obj *o) |
LRi_geometric_RAN(LR_obj *o) - int Geometric distributed variate. Default values: probability of success p = 1/2. More... | |
float | LRi_geometric_PDF (LR_obj *o, int x) |
LRi_geometric_PDF(LR_obj *o, int x) - Geometric probablity (or mass) distribution function. More... | |
float | LRi_geometric_CDF (LR_obj *o, int x) |
LRi_geometric_CDF(LR_obj *o, int x) - Geometric distribution cumulative distribution function. More... | |
int | LRi_binomial_RAN (LR_obj *o) |
LRi_binomial_RAN(LR_obj *o) - int Binomial distributed variate. Default values: probability of success p = 1/2. More... | |
float | LRi_binomial_PDF (LR_obj *o, int x) |
LRi_binomial_PDF(LR_obj *o, int k) - Binomial probablity (or mass) distribution function. More... | |
float | LRi_binomial_CDF (LR_obj *o, int x) |
LRi_binomial_CDF(LR_obj *o, int k) - Binomial distribution cumulative distribution function. More... | |
The LibRan common header file.
Definition in file libran.h.
#define LRerr_InvalidInputValue 0x15 |
#define LRerr_NoAuxiliaryObject 0x09 |
#define LRerr_NoAuxNormalizeDone 0x0B |
enum LR_data_type |
an enum of allowed value types
This enum value identifies which data type is to be used within the LibRan object. Then the associated type should be used from the given LR_val
attribute.
Enumerator | |
---|---|
LR_int | integer type |
LR_long | long integer type |
LR_float | single precision floating point type |
LR_double | double precision floating type |
enum LR_type |
an enum of allowed random variate distribution types
int LR_aux_new | ( | LR_obj * | o, |
int | n | ||
) |
LR_aux_new(LR_obj *o, int n) - initialize a new auxiliary object.
The generic method for creating a new auxiliary object for those random variate distributions that need it. Can be called otherwise but raises an ignorable error.
o | LR_obj object |
n | maxiumum number of intervals |
int LR_aux_norm | ( | LR_obj * | o | ) |
LR_aux_norm(LR_obj *o) - process given intervals and normalize values.
The generic method for normalizing the given intervals for the auxiliary object for those random variate distributions that need it. Can be called otherwise but raises an ignorable error.
o | LR_obj object |
int LR_aux_rm | ( | LR_obj * | o | ) |
LR_aux_rm(LR_obj *o) - remove the auxiliary object.
The generic method for removing or deallocating an auxiliary object for those random variate distributions that need it. Can be called otherwise but raises an ignorable error.
o | LR_obj object |
int LR_aux_set | ( | LR_obj * | o, |
double | x, | ||
double | p | ||
) |
LR_aux_set(LR_obj *o, double x, double p) - add an interval boundary for the underlying distribution.
The generic method for adding an interval boundary for an auxiliary object for those random variate distributions that need it. Can be called otherwise but raises an ignorable error.
o | LR_obj object |
x | interval boundary to add |
p | relative probablity for interval greater than x |
int LR_bin_add | ( | LR_bin * | b, |
double | x | ||
) |
LR_bin_add(LR_bin *b, double x) - collect value to be binned.
This is the tallying routine, where the value x is compared to the boundary values and the appropriate bin array element tally is incremented.
b | LR_bin object |
x | value to count within the given bin. |
LR_bin* LR_bin_new | ( | int | n | ) |
LR_bin_new(LR_data_type d, int n) - create new binning object.
This routine creates a new LR_bin
object and allocates the necessary memory for the boundaries and tally bins. Must give at least the expected number of bins or the number of boundaries plus one.
t | data type |
n | number of bins |
int LR_bin_rm | ( | LR_bin ** | b | ) |
LR_bin_rm(LR_bin **b) - remove binning object.
Since the LR_bin
object allocates memory this method needs to be called to deallocate the memory to avoid memory leaks.
b | LR_bin object address |
int LR_bin_set | ( | LR_bin * | b, |
double | x | ||
) |
LR_bin_set(LR_bin *b, double x) - add bin boundary.
Include another bin boundary, which will be ordered internally. However, it will not identify or flag repeated boundaries.
b | LR_bin object |
x | bin boundary to add |
int LR_check | ( | LR_obj * | o | ) |
LR_check(LR_obj *o) - check and fix the LR object parameters if possible.
This method finds and addresses fixable errors. For example for those random variate distributions that use the interval end points (a,b) the check method will switch 'a' and 'b' if 'a' > 'b'. The other example is for those distributions that use 's' which generally relates to the width of the peak. This value should be positive and the check will take the absolute value of this value if negative.
However, non-fixable errors will raise an error, such as a=b in the first case or s=0 for the second case.
o | LR_obj pointer |
double LR_dgetrand | ( | LR_obj * | o | ) |
LR_dgetrand(LR_obj *) - get the current pseudo-random number.
Get the current pseudo-random number from this LR_obj
.
o | LR_obj object |
double LR_dgetval | ( | char * | val | ) |
LR_dgetval(char *val) - return the configure value.
Return the value computed from the library configuration step, such as LR_DEPS
, and LR_DSQEPS
.
val | configuration parameter |
double LR_drand | ( | LR_obj * | o | ) |
LR_drand(LR_obj *) - returns double in range [0.0,1.0)
Returns a pseudo-random double in the range [0.0, 1.0)
o | LR_obj object |
float LR_fgetrand | ( | LR_obj * | o | ) |
LR_fgetrand(LR_obj *) - get the current pseudo-random number.
Get the current pseudo-random number from this LR_obj
.
o | LR_obj object |
float LR_fgetval | ( | char * | val | ) |
LR_fgetval(char *val) - return the configure value.
Return the value computed from the library configuration step, such as LR_FEPS
, and LR_FSQEPS
.
val | configuration parameter |
float LR_frand | ( | LR_obj * | o | ) |
LR_frand(LR_obj *) - returns float in range [0.0,1.0)
Returns a pseudo-random float in the range [0.0, 1.0)
o | LR_obj object |
int LR_igetrand | ( | LR_obj * | o | ) |
LR_igetrand(LR_obj *) - get the current pseudo-random number.
Get the current pseudo-random number from this LR_obj
.
o | LR_obj object |
int LR_igetseed | ( | LR_obj * | o | ) |
LR_igetseed(LR_obj *) - get the current seed.
Get the seed from this LR_obj
.
o | LR_obj object |
int LR_igetval | ( | char * | val | ) |
LR_igetval(char *val) - return the configure value.
Return the value computed from the library configuration step, such as LR_IRAND_IMAX2
, LR_IRAND_IMAX
, and LR_IRAND_INOT
.
val | configuration parameter |
int LR_irand | ( | LR_obj * | o | ) |
LR_irand(LR_obj *) - returns int in range [0,LR_IRAND_IMAX].
Returns a pseudo-random int in the range [0,LR_IRAND_MAX]
o | LR_obj object |
void LR_isetseed | ( | LR_obj * | o, |
int | X | ||
) |
LR_isetseed(LR_obj *, int X) - set the seed to X.
Set the seed for this LR_obj
.
o | LR_obj object |
X | int with new seed |
long LR_lgetrand | ( | LR_obj * | o | ) |
LR_lgetrand(LR_obj *) - get the current pseudo-random number.
Get the current pseudo-random number from this LR_obj
.
o | LR_obj object |
long LR_lgetseed | ( | LR_obj * | o | ) |
LR_lgetseed(LR_obj *) - get the current seed.
Get the seed from this LR_obj
.
o | LR_obj object |
long LR_lgetval | ( | char * | val | ) |
LR_lgetval(char *val) - return the configure value.
Return the value computed from the library configuration step, such as LR_IRAND_LMAX2
, LR_IRAND_LMAX
, and LR_IRAND_LNOT
.
val | configuration parameter |
long LR_lrand | ( | LR_obj * | o | ) |
LR_lrand(LR_obj *) - returns long in range [0,LR_IRAND_LMAX].
Returns a pseudo-random int in the range [0,LR_IRAND_LMAX]
o | LR_obj object |
void LR_lsetseed | ( | LR_obj * | o, |
long | X | ||
) |
LR_lsetseed(LR_obj *, long X) - set the seed to X.
Set the seed for this LR_obj
.
o | LR_obj object |
X | long with new seed |
int LR_lspl_new | ( | LR_obj * | o, |
int | n | ||
) |
LR_lspl_new(LR_obj *o, int n) - create a new linear spline object.
This routine must be called after the LR_obj
object is created and it allocates memory for the number of expected segments.
o | LR_obj object |
n | largest number of intervals |
Definition at line 88 of file LRlspline.c.
int LR_lspl_norm | ( | LR_obj * | o | ) |
LR_lspl_norm(LR_obj *o) - normalize the interval scale factors.
The LR_lspl_norm()
function is absolutely required to be called so the integrated probability density equals one. If this routine is not called subsequent calls to the CDF/PDF/RAN functions will raise an error (returning a NAN).
o | LR_obj object |
Definition at line 147 of file LRlspline.c.
int LR_lspl_rm | ( | LR_obj * | o | ) |
LR_lspl_rm(LR_obj *o) - strip out the LR_lspl object part of LR_obj.
Removes the allocated memory for the segment pieces.
o | LR_obj object address |
Definition at line 100 of file LRlspline.c.
int LR_lspl_set | ( | LR_obj * | o, |
double | x, | ||
double | p | ||
) |
LR_lspl_set(LR_obj *o, double x) - add interval boundary (will order internally).
The LR_lspl_set
function defines the set of segments for the probability density function. It adds a new boundary and the value of the probability density at that boundary.
Boundary values can be defined in any order and will be ordered internally by this method.
The outer boundaries are defined through the LR_set_all()
function and the probability density is pinned to zero at these endpoints.
The set of segments and the probability density is relatively defined with LR_lspl_set()
. Once all the segments are defined then the probability density must be normalized with LR_lspl_norm()
such that the total integrated value is equal to one!
o | LR_obj object |
x | interval boundary to add |
p | relative probablity for interval starting at x |
Definition at line 128 of file LRlspline.c.
LR_obj* LR_new | ( | LR_type | t, |
LR_data_type | d | ||
) |
LR_new(LR_type t, LR_data_type d) - create the LR object and preset some default parameter values.
t | LR_type (e.g. LR_gausbm) |
d | LR_data_type (e.g. LR_double) |
int LR_pcs_new | ( | LR_obj * | o, |
int | n | ||
) |
LR_pcs_new(LR_obj *o, int n) - create a new piecewise uniform object set of segments.
This routine must be called after the LR_obj
object is created and it allocates memory for the number of expected segments.
o | LR_obj object |
n | largest number of intervals |
int LR_pcs_norm | ( | LR_obj * | o | ) |
LR_pcs_norm(LR_obj *o) - normalize the interval scale factors.
The LR_pcs_norm()
function is absolutely required to be called so the integrated probability density equals one. If this routine is not called subsequent calls to the CDF/PDF/RAN functions will raise an error (returning a NAN).
o | LR_obj object |
int LR_pcs_rm | ( | LR_obj * | o | ) |
int LR_pcs_set | ( | LR_obj * | o, |
double | x, | ||
double | p | ||
) |
LR_pcs_set(LR_obj *o, double x) - add interval boundary (will order internally).
The LR_pcs_set
function defines the set of segments for the probability density function. It adds a new boundary and the value of the probability density following that boundary.
Boundary values can be defined in any order and will be ordered internally by this method.
The first segment (and boundary) is defined through the LR_set_all()
function, which also defines the last segment end point.
The set of segments and the probability density is relatively defined with LR_pcs_set()
. Once all the segments are defined then the probability density must be normalized with LR_pcs_norm()
such that the total integrated value is equal to one!
o | LR_obj object |
x | interval boundary to add |
p | relative probablity for interval greater than x |
int LR_rm | ( | LR_obj ** | o | ) |
LR_rm(LR_obj **o) - destroy the LR object and release allocated memory.
o | Address of LR_obj pointer |
int LR_set | ( | LR_obj * | o, |
char | x, | ||
... | |||
) |
LR_set(LR_obj *o, char x, ...) - set a single LR object parameter.
This routine is designed to set a single LR_obj
attribute as directed by the format character. See LR_vset()
for allowed list of format characters.
o | LR_obj object |
x | single character format |
... | optional argument |
int LR_set_all | ( | LR_obj * | o, |
char * | x, | ||
... | |||
) |
LR_set_all(LR_obj *o, char *x, ...) - set all given LR object parameters.
Set a collection of LR_obj
attributes. This routine has any number of arguments as defined by the format string (similar to printf() ).
See LR_vset() for list of allowed format string characters.
o | LR_obj object |
x | format string |
... | optional arguments |
int LR_vset | ( | LR_obj * | o, |
char * | x, | ||
va_list | ap | ||
) |
LR_vset(LR_obj *o, char *x, va_list ap) - read and parse options.
This function is similar to vprintf() where the optional arguments are scanned according to format *x. The function accesses additional arguments by using the context information designated by ap
. The program must execute va_start()
before calling this function, and call va_end()
afterward.
Generally there is no need to call this routine. Call LR_set_all()
instead.
However, the list of attributes handled is important - 'k','n', 'p', 'q', 'd', 'a', 'b', 'm', 's', and 'x'. Any other characters are ignored except causing a negative value to be returned representing the number of such ignored characters. A real error will result in a positive return value.
All other characters in the format string are an ignorable error.
The precision of the input values are governed by the LR_obj
LR_data_type
, except for 'k','n' which are int
only, and except for 'p','q' which are float
only.
o | LR_obj object |
x | controlling format string |
ap | additional arguments context information |
double LRd_cauchy_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_cauchy_CDF(LR_obj *o, double x) - double Cauchy/Lorentz cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 117 of file LRcauchy.c.
double LRd_cauchy_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_cauchy_PDF(LR_obj *o, double x) - double Cauchy/Lorentz probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 103 of file LRcauchy.c.
double LRd_cauchy_RAN | ( | LR_obj * | o | ) |
LRd_cauchy_RAN(LR_obj *o) - double random Cauchy/Lorentz distribution using the inversion method on the CDF(x). Default values: peak m = 0, half width s = 1.
o | LR_obj object |
Definition at line 71 of file LRcauchy.c.
double LRd_cauchymar_RAN | ( | LR_obj * | o | ) |
LRd_cauchymar_RAN(LR_obj *o) - double random Cauchy/Lorentz distribution using the polar method and the Marsagalia method and acceptance/rejection for generating a Gaussian/Normal variate. Default values: peak m = 0, half width s = 1.
o | LR_obj object |
Definition at line 84 of file LRcauchy.c.
double LRd_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_CDF(LR_obj *o, double x) - cumulative distribution function.
This method will call the specific random variate cumulative distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
double LRd_erlang_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_erlang_CDF(LR_obj *o, double x) - Erlang distribution cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 118 of file LRerlang.c.
double LRd_erlang_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_erlang_PDF(LR_obj *o, double x) - Erlang distribution probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 87 of file LRerlang.c.
double LRd_erlang_RAN | ( | LR_obj * | o | ) |
LRd_erlang_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: scale m = 1.
o | LR_obj object |
Definition at line 66 of file LRerlang.c.
double LRd_gaus_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gaus_CDF(LR_obj *o, double x) - double Gaussian/Normal cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gaus_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gaus_PDF(LR_obj *o, double x) - double Gaussian/Normal probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gausbm_RAN | ( | LR_obj * | o | ) |
LRd_gausbm_RAN(LR_obj *o) - double random Gaussian/Normal distribution using the Box-Muller method.
Default values: mean m = 0, std.deviation s = 1
o | LR_obj object |
double LRd_gausmar_RAN | ( | LR_obj * | o | ) |
LRd_gausmar_RAN(LR_obj *o) - double random Gaussian/Normal distribution using the Marsaglia method with acceptance-rejection.
Default values: mean m = 0, std.deviation s = 1
o | LR_obj object |
double LRd_gsn12_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn12_CDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn12_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn12_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn12_RAN | ( | LR_obj * | o | ) |
LRd_gsn12_RAN(LR_obj *o) - double random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates.
Default: mean m = 0, std.deviation s = 1
o | LR_obj object |
double LRd_gsn2_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn2_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn2_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn2_PDF(LR_obj *o, double x) - double gaussian-like (saw tooth) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn2_RAN | ( | LR_obj * | o | ) |
LRd_gsn2_RAN(LR_obj *o) - double random g2 gaussian-like (saw tooth) distribution.
Default range: [a,b) = [-1,1)
o | LR_obj object |
double LRd_gsn4_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn4_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn4_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn4_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn4_RAN | ( | LR_obj * | o | ) |
LRd_gsn4_RAN(LR_obj *o) - double random g4 gaussian-like (simple bell curve) distribution.
Default range: [a,b) = [-2,2)
o | LR_obj object |
double LRd_lspline_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_lspline_CDF(LR_obj *o, double x) - double linear spline cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 281 of file LRlspline.c.
double LRd_lspline_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_lspline_PDF(LR_obj *o, double x) - double linear spline probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 247 of file LRlspline.c.
double LRd_lspline_RAN | ( | LR_obj * | o | ) |
LRd_lspline_RAN(LR_obj *o) - double random linear spline distribution random variate.
o | LR_obj object |
Definition at line 209 of file LRlspline.c.
double LRd_nexp_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_nexp_CDF(LR_obj *o, double x) - double negative exponential cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_nexp_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_nexp_PDF(LR_obj *o, double x) - double negative exponential probablity distribution function.
o | LR_obj object |
x | value |
double LRd_nexp_RAN | ( | LR_obj * | o | ) |
LRd_nexp_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: peak m = 1.
o | LR_obj object |
double LRd_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_PDF(LR_obj *o, double x) - probability distribution function.
This method will call the specific random variate probability distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
double LRd_piece_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_piece_CDF(LR_obj *o, double x) - double piecewise uniform cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_piece_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_piece_PDF(LR_obj *o, double x) - double piecewise uniform probablity distribution function.
o | LR_obj object |
x | value |
double LRd_piece_RAN | ( | LR_obj * | o | ) |
LRd_piece_RAN(LR_obj *o) - double random piecewise uniform distribution random variate.
o | LR_obj object |
double LRd_RAN | ( | LR_obj * | o | ) |
LRd_RAN(LR_obj *o) - random variate generator.
This method will call the specific random variate generator as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
int LRd_uinvcdf | ( | LR_obj * | o, |
double(*)(double) | cdf | ||
) |
LRd_uinvcdf() - set the user defined CDF for this variate distribution.
o | LR_obj object |
cdf | User defined CDF |
Definition at line 131 of file LRuinvcdf.c.
double LRd_uinvcdf_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_uinvcdf_CDF(LR_obj *o, double x) - double User supplied cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 384 of file LRuinvcdf.c.
double LRd_uinvcdf_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_uinvcdf_PDF(LR_obj *o, double x) - double probability distribution function approximated from the user supplied cumulative distribution function.
Use the definition of a derivative to approximate the PDF from the given CDF.
o | LR_obj object |
x | value |
Definition at line 329 of file LRuinvcdf.c.
double LRd_uinvcdf_RAN | ( | LR_obj * | o | ) |
LRd_uinvcdf_RAN(LR_obj *o) - double random variate via inverse method of the UserCDF() fn.
o | LR_obj object |
Definition at line 269 of file LRuinvcdf.c.
double LRd_unif_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_unif_CDF(LR_obj *o, double x) - double uniform cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_unif_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_unif_PDF(LR_obj *o, double x) - double uniform probablity distribution function.
o | LR_obj object |
x | value |
double LRd_unif_RAN | ( | LR_obj * | o | ) |
LRd_unif_RAN(LR_obj *o) - double random uniform distribution.
o | LR_obj object |
float LRf_cauchy_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_cauchy_CDF(LR_obj *o, float x) - float Cauchy/Lorentz cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 180 of file LRcauchy.c.
float LRf_cauchy_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_cauchy_PDF(LR_obj *o, float x) - float Cauchy/Lorentz probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 166 of file LRcauchy.c.
float LRf_cauchy_RAN | ( | LR_obj * | o | ) |
LRf_cauchy_RAN(LR_obj *o) - float random Cauchy/Lorentz distribution using the inversion method. Default values: peak m = 0, half width s = 1.
o | LR_obj object |
Definition at line 134 of file LRcauchy.c.
float LRf_cauchymar_RAN | ( | LR_obj * | o | ) |
LRf_cauchymar_RAN(LR_obj *o) - float random Cauchy/Lorentz distribution using the polar method and the Marsagalia method and acceptance/rejection for generating a Gaussian/Normal variate. Default values: peak m = 0, half width s = 1.
o | LR_obj object |
Definition at line 147 of file LRcauchy.c.
float LRf_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_CDF(LR_obj *o, float x) - cumulative distribution function.
This method will call the specific random variate cumulative distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
float LRf_erlang_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_erlang_CDF(LR_obj *o, float x) - Erlang distribution cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 194 of file LRerlang.c.
float LRf_erlang_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_erlang_PDF(LR_obj *o, float x) - Erlang distribution probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 163 of file LRerlang.c.
float LRf_erlang_RAN | ( | LR_obj * | o | ) |
LRf_erlang_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: scale m = 1.
o | LR_obj object |
Definition at line 142 of file LRerlang.c.
float LRf_gaus_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gaus_CDF(LR_obj *o, float x) - float Gaussian/Normal cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gaus_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gaus_PDF(LR_obj *o, float x) - float Gaussian/Normal probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gausbm_RAN | ( | LR_obj * | o | ) |
LRf_gausbm_RAN(LR_obj *o) - float random Gaussian/Normal distribution using the Box-Muller method.
Default values: mean m = 0, std.deviation s = 1
o | LR_obj object |
float LRf_gausmar_RAN | ( | LR_obj * | o | ) |
LRf_gausmar_RAN(LR_obj *o) - float random Gaussian/Normal distribution using the Marsaglia method with acceptance-rejection.
Default values: mean m = 0, std.deviation s = 1
o | LR_obj object |
float LRf_gsn12_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn12_CDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn12_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn12_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn12_RAN | ( | LR_obj * | o | ) |
LRf_gsn12_RAN(LR_obj *o) - float random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates.
Default: mean m = 0, std.deviation s = 1
o | LR_obj object |
float LRf_gsn2_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn2_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn2_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn2_PDF(LR_obj *o, float x) - float gaussian-like (saw tooth) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn2_RAN | ( | LR_obj * | o | ) |
LRf_gsn2_RAN(LR_obj *o) - float random g2 gaussian-like (saw tooth) distribution.
Default range: [a,b) = [-1,1)
o | LR_obj object |
float LRf_gsn4_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn4_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn4_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn4_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn4_RAN | ( | LR_obj * | o | ) |
LRf_gsn4_RAN(LR_obj *o) - float random g4 gaussian-like (simple bell curve) distribution.
Default range: [a,b) = [-2,2)
o | LR_obj object |
float LRf_lspline_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_lspline_CDF(LR_obj *o, float x) - float linear spline cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 390 of file LRlspline.c.
float LRf_lspline_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_lspline_PDF(LR_obj *o, float x) - float linear spline probablity distribution function.
o | LR_obj object |
x | value |
Definition at line 356 of file LRlspline.c.
float LRf_lspline_RAN | ( | LR_obj * | o | ) |
LRf_lspline_RAN(LR_obj *o) - float random linear spline distribution.
o | LR_obj object |
Definition at line 318 of file LRlspline.c.
float LRf_nexp_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_nexp_CDF(LR_obj *o, float x) - float negative exponential cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_nexp_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_nexp_PDF(LR_obj *o, float x) - float negative exponential probablity distribution function.
o | LR_obj object |
x | value |
float LRf_nexp_RAN | ( | LR_obj * | o | ) |
LRf_nexp_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: peak m = 1.
o | LR_obj object |
float LRf_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_PDF(LR_obj *o, float x) - probability distribution function.
This method will call the specific random variate probability distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
float LRf_piece_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_piece_CDF(LR_obj *o, float x) - float piecewise uniform cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_piece_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_piece_PDF(LR_obj *o, float x) - float piecewise uniform probablity distribution function.
o | LR_obj object |
x | value |
float LRf_piece_RAN | ( | LR_obj * | o | ) |
LRf_piece_RAN(LR_obj *o) - float random piecewise uniform distribution.
o | LR_obj object |
float LRf_RAN | ( | LR_obj * | o | ) |
LRf_RAN(LR_obj *o) - random variate generator.
This method will call the specific random variate generator as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
int LRf_uinvcdf | ( | LR_obj * | o, |
float(*)(float) | cdf | ||
) |
LRf_uinvcdf() - set the user defined CDF for this variate distribution.
o | LR_obj object |
cdf | User defined CDF |
Definition at line 413 of file LRuinvcdf.c.
float LRf_uinvcdf_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_uinvcdf_CDF(LR_obj *o, float x) - float User supplied cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 666 of file LRuinvcdf.c.
float LRf_uinvcdf_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_uinvcdf_PDF(LR_obj *o, float x) - float probability distribution function approximated from the user supplied cumulative distribution function.
Use the definition of a derivative to approximate the PDF from the given CDF.
o | LR_obj object |
x | value |
Definition at line 611 of file LRuinvcdf.c.
float LRf_uinvcdf_RAN | ( | LR_obj * | o | ) |
LRf_uinvcdf_RAN(LR_obj *o) - float random variate via inverse method of the UserCDF() fn.
o | LR_obj object |
Definition at line 551 of file LRuinvcdf.c.
float LRf_unif_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_unif_CDF(LR_obj *o, float x) - float uniform cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_unif_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_unif_PDF(LR_obj *o, float x) - float uniform probablity distribution function.
o | LR_obj object |
x | value |
float LRf_unif_RAN | ( | LR_obj * | o | ) |
float LRi_binomial_CDF | ( | LR_obj * | o, |
int | k | ||
) |
LRi_binomial_CDF(LR_obj *o, int k) - Binomial distribution cumulative distribution function.
o | LR_obj object |
x | value |
float LRi_binomial_PDF | ( | LR_obj * | o, |
int | k | ||
) |
LRi_binomial_PDF(LR_obj *o, int k) - Binomial probablity (or mass) distribution function.
o | LR_obj object |
x | value |
int LRi_binomial_RAN | ( | LR_obj * | o | ) |
LRi_binomial_RAN(LR_obj *o) - int Binomial distributed variate. Default values: probability of success p = 1/2.
The random variate is generated using the waiting time property - Generate a number of exponential variates until the waited sum exceeds some value.
o | LR_obj object |
float LRi_CDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_CDF(LR_obj *o, int x) - cumulative distribution function.
This method will call the specific random variate cumulative distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
float LRi_geometric_CDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_geometric_CDF(LR_obj *o, int x) - Geometric distribution cumulative distribution function.
o | LR_obj object |
x | value |
float LRi_geometric_PDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_geometric_PDF(LR_obj *o, int x) - Geometric probablity (or mass) distribution function.
o | LR_obj object |
x | value |
int LRi_geometric_RAN | ( | LR_obj * | o | ) |
LRi_geometric_RAN(LR_obj *o) - int Geometric distributed variate. Default values: probability of success p = 1/2.
The random variate is generated using inversion and truncation.
o | LR_obj object |
float LRi_PDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_PDF(LR_obj *o, int x) - probability distribution function.
This method will call the specific random variate probability distribution function as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
x | value |
float LRi_poisson_CDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_poisson_CDF(LR_obj *o, int x) - Poisson distribution cumulative distribution function.
o | LR_obj object |
x | value |
Definition at line 116 of file LRpoisson.c.
float LRi_poisson_PDF | ( | LR_obj * | o, |
int | x | ||
) |
LRi_poisson_PDF(LR_obj *o, int x) - Poisson probablity (or mass) distribution function.
o | LR_obj object |
x | value |
Definition at line 91 of file LRpoisson.c.
int LRi_poisson_RAN | ( | LR_obj * | o | ) |
LRi_poisson_RAN(LR_obj *o) - int Poisson distributed variate. Default values: scale m = 1.
o | LR_obj object |
Definition at line 66 of file LRpoisson.c.
int LRi_RAN | ( | LR_obj * | o | ) |
LRi_RAN(LR_obj *o) - random variate generator.
This method will call the specific random variate generator as determined by the object's LR_type
and LR_data_type
. Note that using the wrong data type will return a NAN and raise an error.
o | LR_obj object |
void LRperror | ( | char * | str, |
int | LRerrno | ||
) |
LRperror(char *str, int LRerrno) - print out explanatory error message to stderr.
If the char str
string is not NULL then prepend this string to the LibRan error message with a " : " delimiter and sent to stderr .
str | String to prepend to error message |
LRerrno | LibRan error number |
char* LRstrerrno | ( | int | LRerrno | ) |
LRstrerrno(int LRerrno) - return the errno code string for the given LibRan errno.
LRerrno | LibRan error number |
char* LRstrerror | ( | int | LRerrno | ) |
LRstrerror(int LRerrno) - return some explanatory text regarding the given LibRan errno.
LRerrno | LibRan error number |