Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / doc / examples / randpoisson.c
1 #include <stdio.h>
2 #include <gsl/gsl_rng.h>
3 #include <gsl/gsl_randist.h>
4
5 int
6 main (void)
7 {
8   const gsl_rng_type * T;
9   gsl_rng * r;
10
11   int i, n = 10;
12   double mu = 3.0;
13
14   /* create a generator chosen by the 
15      environment variable GSL_RNG_TYPE */
16
17   gsl_rng_env_setup();
18
19   T = gsl_rng_default;
20   r = gsl_rng_alloc (T);
21
22   /* print n random variates chosen from 
23      the poisson distribution with mean 
24      parameter mu */
25
26   for (i = 0; i < n; i++) 
27     {
28       unsigned int k = gsl_ran_poisson (r, mu);
29       printf (" %u", k);
30     }
31
32   printf ("\n");
33   gsl_rng_free (r);
34   return 0;
35 }