/** @file psRandom.h
*  \brief Random Number Generators
*  \ingroup Math
*
*  This file will hold the prototypes for procedures which allocate, free,
*  and evaluate random number Generators.
*
*  @ingroup Math
*
*  @author GLG, MHPCC
*
*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
*  @date $Date: 2005-02-17 19:26:23 $
*
*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
*/

#if !defined(PS_RANDOM_H)
#define PS_RANDOM_H

#include <stdio.h>
#include <stdbool.h>
#include <float.h>
#include <math.h>

#include "psVector.h"
#include "psScalar.h"
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>

/** \addtogroup Math
 *  \{
 */

typedef enum {
    PS_RANDOM_TAUS    ///< A maximally equidistributed combined Tausworthe generator.
} psRandomType;

typedef struct
{
    psRandomType type; ///< The type of RNG
    gsl_rng *gsl; ///< The RNG itself
}
psRandom;

psRandom *psRandomAlloc(psRandomType type,
                        psU64 seed);

void psRandomReset(psRandom *rand,
                   psU64 seed);

psF64 psRandomUniform(const psRandom *r);
psF64 psRandomGaussian(const psRandom *r);
psF64 psRandomPoisson(const psRandom *r, psF64 mean);

/* \} */// End of MathGroup Functions

#endif

