00001 #ifndef _CONV_RANDOM_H 00002 #define _CONV_RANDOM_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 00008 typedef struct rngen_ 00009 { 00010 unsigned int prime; 00011 double state[3], multiplier[3];/* simulate 64 bit arithmetic */ 00012 } CrnStream; 00013 00014 /*Type must be 0, 1, or 2.*/ 00015 void CrnInitStream(CrnStream *dest, unsigned int seed, int type); 00016 int CrnInt(CrnStream *); 00017 double CrnDouble(CrnStream *); 00018 float CrnFloat(CrnStream *); 00019 void CrnSrand(unsigned int); 00020 int CrnRand(void); 00021 double CrnDrand(void); 00022 00023 #ifdef __cplusplus 00024 } 00025 #endif 00026 00027 #endif