/* nag_random_gamma (g05ffc) Example Program. * * Copyright 1991 Numerical Algorithms Group. * * Mark 2, 1991. */ #include #include #include #include #define N 5 int main(void) { Integer j; double a = 5.0; double b = 1.0; double x[N]; Vprintf("nag_random_gamma (g05ffc) Example Program Results\n"); /* nag_random_init_repeatable (g05cbc). * Initialize random number generating functions to give * repeatable sequence */ nag_random_init_repeatable((Integer)0); Vprintf("Beta Dist --- a=%2.1f, b=%2.1f\n",a,b); /* nag_random_gamma (g05ffc). * Pseudo-random real numbers from the gamma distribution */ nag_random_gamma(a, b, (Integer)N, x, NAGERR_DEFAULT); for (j=0; j<(Integer)N; j++) Vprintf("%10.4f\n", x[j]); return EXIT_SUCCESS; }