Go to the documentation of this file.00001
00006 #include <stdio.h>
00007 #include <assert.h>
00008
00009 #include <vl/random.h>
00010
00011 int
00012 main (int argc VL_UNUSED, char *argv[] VL_UNUSED)
00013 {
00014 int i ;
00015 vl_uint32 init [4] = {0x123, 0x234, 0x345, 0x456} ;
00016 VlRand rand ;
00017 vl_rand_init (&rand) ;
00018
00019 vl_rand_seed_by_array (&rand, init, sizeof(init)/sizeof(init[0])) ;
00020
00021 printf("1000 outputs of vl_rand_uint32()\n");
00022 for (i=0; i<1000; i++) {
00023 printf("%10" VL_FL_INT32 "u ", vl_rand_uint32(&rand));
00024 if (i%5==4) printf("\n");
00025 }
00026
00027 printf("\n1000 outputs of vl_rand_real2()\n");
00028 for (i=0; i<1000; i++) {
00029 printf("%10.8f ", vl_rand_real2(&rand));
00030 if (i%5==4) printf("\n");
00031 }
00032
00033 return 0;
00034 }