00001 /** @file psRandom.h 00002 * \brief Random Number Generators 00003 * \ingroup Math 00004 * 00005 * This file will hold the prototypes for procedures which allocate, free, 00006 * and evaluate random number Generators. 00007 * 00008 * @ingroup Math 00009 * 00010 * @author GLG, MHPCC 00011 * 00012 * @version $Revision: 1.1.1.1 $ $Name: $ 00013 * @date $Date: 2005/06/15 21:08:12 $ 00014 * 00015 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00016 */ 00017 00018 #ifndef PS_RANDOM_H 00019 #define PS_RANDOM_H 00020 00021 #include <stdio.h> 00022 #include <stdbool.h> 00023 #include <float.h> 00024 #include <math.h> 00025 00026 #include "psVector.h" 00027 #include "psScalar.h" 00028 #include <gsl/gsl_rng.h> 00029 #include <gsl/gsl_randist.h> 00030 00031 /** \addtogroup Math 00032 * \{ 00033 */ 00034 00035 typedef enum { 00036 PS_RANDOM_TAUS ///< A maximally equidistributed combined Tausworthe generator. 00037 } psRandomType; 00038 00039 typedef struct 00040 { 00041 psRandomType type; ///< The type of RNG 00042 gsl_rng *gsl; ///< The RNG itself 00043 } 00044 psRandom; 00045 00046 psRandom *psRandomAlloc(psRandomType type, 00047 psU64 seed); 00048 00049 void psRandomReset(psRandom *rand, 00050 psU64 seed); 00051 00052 psF64 psRandomUniform(const psRandom *r); 00053 psF64 psRandomGaussian(const psRandom *r); 00054 psF64 psRandomPoisson(const psRandom *r, psF64 mean); 00055 00056 /* \} */// End of MathGroup Functions 00057 00058 #endif // #ifndef PS_RANDOM_H
1.4.1