genomicSimulationC 0.3
|
For mathematical and statistical operations as required by the package. More...
Functions | |
int | gsc_randpoi (rnd_pcg_t *rng, double lambda) |
Generates randomly a number from the Poisson distribution with parameter lambda , using the Knuth approach. More... | |
gsc_DecimalMatrix | gsc_generate_zero_dmatrix (const size_t r, const size_t c) |
Generates a matrix of c columns, r rows with all 0. More... | |
int | gsc_add_matrixvector_product_to_dmatrix (gsc_DecimalMatrix *result, const gsc_DecimalMatrix *a, const double *b) |
int | gsc_add_doublematrixvector_product_to_dmatrix (gsc_DecimalMatrix *result, const gsc_DecimalMatrix *amat, const double *avec, const gsc_DecimalMatrix *bmat, const double *bvec) |
For mathematical and statistical operations as required by the package.
Includes matrix operations defined on a gsc_DecimalMatrix struct, and draws from certain random distributions.
int gsc_add_doublematrixvector_product_to_dmatrix | ( | gsc_DecimalMatrix * | result, |
const gsc_DecimalMatrix * | amat, | ||
const double * | avec, | ||
const gsc_DecimalMatrix * | bmat, | ||
const double * | bvec | ||
) |
int gsc_add_matrixvector_product_to_dmatrix | ( | gsc_DecimalMatrix * | result, |
const gsc_DecimalMatrix * | a, | ||
const double * | b | ||
) |
gsc_DecimalMatrix gsc_generate_zero_dmatrix | ( | const size_t | r, |
const size_t | c | ||
) |
Generates a matrix of c columns, r rows with all 0.
r | the number of rows/first index for the new matrix. |
c | the number of columns/second index for the new matrix. |
Definition at line 4588 of file sim-operations.c.
int gsc_randpoi | ( | rnd_pcg_t * | rng, |
double | lambda | ||
) |
Generates randomly a number from the Poisson distribution with parameter lambda
, using the Knuth approach.
Returns 0 if parameter is invalid (<= 0)
This approach is known to run slow for larger values of lambda.
rng | random number generator source |
lambda | the parameter of the Poisson distribution. Corresponds to both expected value and variance of the distribution. |
Definition at line 201 of file sim-operations.c.