/* nag_random_beta (g05fec) Example Program. * * Copyright 1991 Numerical Algorithms Group. * * Mark 2, 1991. */ #include #include #include #include #define N 5 int main(void) { Integer j; double a = 2.0; double b = 2.0; double x[N]; Vprintf("nag_random_beta (g05fec) 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_beta (g05fec). * Pseudo-random real numbers from the beta distribution */ nag_random_beta(a, b, (Integer)N, x, NAGERR_DEFAULT); for (j=0; j<(Integer)N; j++) Vprintf("%10.4f\n", x[j]); return EXIT_SUCCESS; }