/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:12 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dranus s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_dranus.h" /* program DRDRANUS *>> 1995-10-23 DRDRANUS Krogh Reduced N to work on PC in D.P. *>> 1994-10-19 DRDRANUS Krogh Changes to use M77CON *>> 1992-03-13 DRDRANUS CLL * * Driver to demonstrate use of DRANUS to generate random numbers * from the uniform distribution between A and A+B. * Program computes histogram for N numbers * ------------------------------------------------------------------ *--D replaces "?": DR?RANUS, ?RANUS, ?STAT1, ?STAT2 * ------------------------------------------------------------------ */ /* PARAMETER translations */ #define N 8000 #define NCELLS (10 + 2) /* end of PARAMETER translations */ int main( ) { long int ihist[NCELLS]; double stats[5], ytab[N]; static double a = 20.0e0; static double b = 10.0e0; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const Ihist = &ihist[0] - 1; double *const Stats = &stats[0] - 1; double *const Ytab = &ytab[0] - 1; /* end of OFFSET VECTORS */ /* ------------------------------------------------------------------ */ Stats[1] = 0.0e0; /* Get array of scaled random numbers. * */ dranus( ytab, N, a, b ); /* Compute statistics and histogram. * */ dstat1( ytab, N, stats, ihist, NCELLS, a, a + b ); /* Print the statistics and histogram. * */ printf(" Uniform random numbers from DRANUS\n\n\n"); dstat2( stats, ihist, NCELLS, a, a + b ); exit(0); } /* end of function */