random.h

Go to the documentation of this file.
00001 /* random.h -- Define several random distributions
00002  *
00003  * Copyright (C) 2001 Ling Li
00004  * ling@caltech.edu
00005  */
00006 
00007 #ifndef __RANDOM_H__
00008 #define __RANDOM_H__
00009 #define __COMMON_TYPES_RANDOM_H__
00010 
00011 #include <stdlib.h>
00012 #include "object.h"
00013 
00014 typedef REAL PROBAB;
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 void set_seed (unsigned int seed);
00021 /* randu: [0, 1); randuc: [0, 1] */
00022 #define randu()    (rand() / (RAND_MAX + 1.0))
00023 #define randuc()   (rand() / (PROBAB) RAND_MAX)
00024 REAL randn ();
00025 
00026 #ifdef __cplusplus
00027 }
00028 #endif
00029 
00030 #else /* __RANDOM_H__ */
00031 
00032 #ifndef __COMMON_TYPES_RANDOM_H__
00033  #error This header file conflicts with another "random.h" file.
00034 #endif
00035 
00036 #endif

Generated on Mon Jan 9 23:43:24 2006 for LEMGA by  doxygen 1.4.6