2.1.24.8.13 laprnd
Contents
Description
Generates an array of random numbers from a laplace distribution
Syntax
int laprnd( double * v, uint n, double mu, double sigma )
Parameters
- v
- [output] Pointer to a double array, which contain the results
- n
- [input] The number of pseudo-random numbers to be generated. n>=1
- mu
- [input] The location parameter of the Laplace distribution
- sigma
- [input] The scale parameter of the Laplace distribution
Return
Return NE_NOERROR(0) on success, otherwise error
Examples
EX
void test_laprnd() { int n = 10; vector<double> vd(n); int nRet = laprnd(vd, n, 0, 1.0); for (int i = 0; i < n; i++) { printf("%f\t", vd[i]); } printf("\n"); }
Remark
See Also
Header to Include
origin.h