Index: trunk/psLib/src/math/psRandom.c
===================================================================
--- trunk/psLib/src/math/psRandom.c	(revision 2432)
+++ trunk/psLib/src/math/psRandom.c	(revision 2433)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-11-24 20:55:01 $
+*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-11-24 21:59:43 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,7 +20,15 @@
 #include <float.h>
 #include <math.h>
+#include <gsl/gsl_rng.h>
+#include <gsl/gsl_randist.h>
 
+#include "psMemory.h"
 #include "psRandom.h"
 #include "psScalar.h"
+#include "psError.h"
+#include "psTrace.h"
+#include "psLogMsg.h"
+#include "psConstants.h"
+#include "psDataManipErrors.h"
 
 /*
@@ -39,4 +47,18 @@
                         psU64 seed)
 {
+    gsl_rng *r = NULL;
+    psRandom *myRNG = (psRandom *) psAlloc(sizeof(psRandom));
+
+    switch (type) {
+    case PS_RANDOM_TAUS:
+        r = gsl_rng_alloc(gsl_rng_taus);
+        myRNG->gsl = r;
+        return(myRNG);
+
+    default:
+        psError(PS_ERR_UNEXPECTED_NULL,
+                true,
+                PS_ERRORTEXT_psRandom_UNKNOWN_RANDFOM_NUMBER_GENERATOR_TYPE);
+    }
     return(NULL);
 }
@@ -44,18 +66,21 @@
 void psRandomReset(psRandom *rand,
                    psU64 seed)
-{}
+{
+    gsl_rng_set(rand->gsl, seed);
+}
 
 psF64 psRandomUniform(const psRandom *r)
 {
-    return(0.0);
+    return(gsl_rng_uniform(r->gsl));
 }
 
 psF64 psRandomGaussian(const psRandom *r)
 {
-    return(0.0);
+    // XXX: What should sigma be?
+    return(gsl_ran_gaussian(r->gsl, 1.0));
 }
 
 psF64 psRandomPoisson(const psRandom *r, psF64 mean)
 {
-    return(0.0);
+    return((psF64) gsl_ran_poisson(r->gsl, mean));
 }
