genomicSimulationC 0.3
Functions
Mathematical functions

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)
 

Detailed Description

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.

Function Documentation

◆ gsc_add_doublematrixvector_product_to_dmatrix()

int gsc_add_doublematrixvector_product_to_dmatrix ( gsc_DecimalMatrix result,
const gsc_DecimalMatrix amat,
const double *  avec,
const gsc_DecimalMatrix bmat,
const double *  bvec 
)

◆ gsc_add_matrixvector_product_to_dmatrix()

int gsc_add_matrixvector_product_to_dmatrix ( gsc_DecimalMatrix result,
const gsc_DecimalMatrix a,
const double *  b 
)

◆ gsc_generate_zero_dmatrix()

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.

Parameters
rthe number of rows/first index for the new matrix.
cthe number of columns/second index for the new matrix.
Returns
a gsc_DecimalMatrix with r rows, c cols, and a matrix of the correct size, with all values zeroed.

Definition at line 4588 of file sim-operations.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsc_randpoi()

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.

Parameters
rngrandom number generator source
lambdathe parameter of the Poisson distribution. Corresponds to both expected value and variance of the distribution.
Returns
a random integer generated from the Poisson distribution with parameter lambda.

Definition at line 201 of file sim-operations.c.

+ Here is the caller graph for this function: