/* tbran2.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: bran2 setbran2 Input parameters: s -> unsigned integer: pseudorandom generator seed n -> integer parameter m -> sample size */ #include "ccmath.h" void main(int na,char **av) { unsigned int s; int n,m,i,k,*nh; if(na!=4){ printf("para: seed(hex) argument num_out\n"); exit(-1);} sscanf(*++av,"%x",&s); n=atoi(*++av); m=atoi(*++av); printf(" seed= %x\n",s); printf(" arg: n= %d\n",n); printf(" sample size m= %d\n",m); nh=(int *)calloc(sizeof(int),n+1); /* initialize pseudorandom integer generator */ setbran2(s); for(i=0; i