Function
NumCosmoMathRNGDiscretenew
Declaration [src]
NcmRNGDiscrete*
ncm_rng_discrete_new (
const gdouble* weights,
const guint n
)
Description [src]
Creates a new NcmRNGDiscrete. This object is used to generate random numbers
from a discrete distribution for the given set of weights.
Parameters
weights-
Type: An array of
gdoubleArray of weights.
The length of the array is specified in the nargument.The data is owned by the caller of the function. n-
Type:
const guintNumber of elements in
weights.
Return value
Type: NcmRNGDiscrete
A new NcmRNGDiscrete.
| The caller of the function takes ownership of the data, and is responsible for freeing it. |