Index: /trunk/psLib/src/astro/psCoord.c
===================================================================
--- /trunk/psLib/src/astro/psCoord.c	(revision 4856)
+++ /trunk/psLib/src/astro/psCoord.c	(revision 4857)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-27 19:55:15 $
+*  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-23 23:23:05 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -139,4 +139,10 @@
 if the supplied psPlaneTransform transform is linear: if any of the
 cooefficients of order 2 are higher are non-zero, then it is not linear.
+ 
+Returns:
+    1: if linear
+    0: otherwise
+ 
+XXX: This should be a psBool
  *****************************************************************************/
 psS32 p_psIsProjectionLinear(psPlaneTransform *transform)
Index: /trunk/psLib/src/math/psFunctions.c
===================================================================
--- /trunk/psLib/src/math/psFunctions.c	(revision 4856)
+++ /trunk/psLib/src/math/psFunctions.c	(revision 4857)
@@ -7,6 +7,6 @@
 *  polynomials.  It also contains a Gaussian functions.
 *
-*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-20 01:21:13 $
+*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-23 23:23:05 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,7 +20,4 @@
 /*  INCLUDE FILES                                                            */
 /*****************************************************************************/
-#include <gsl/gsl_rng.h>
-#include <gsl/gsl_randist.h>
-
 #include <stdio.h>
 #include <stdbool.h>
@@ -28,4 +25,5 @@
 #include <math.h>
 
+#include "psRandom.h"
 #include "psMemory.h"
 #include "psVector.h"
@@ -36,5 +34,4 @@
 #include "psFunctions.h"
 #include "psConstants.h"
-
 #include "psErrorText.h"
 
@@ -688,9 +685,5 @@
  This private routine (formerly a psLib API routine) creates a psVector of the
  specified size and type F32 and fills it with a random Gaussian distribution
- of numbers with the specified mean and sigma.  This routine makes use of the
- GSL routines for generating both uniformly distributed numbers and the
- Gaussian distribution as well.
- 
-XXX: There is no way to seed the random generator.
+ of numbers with the specified mean and sigma.
  *****************************************************************************/
 psVector* p_psGaussianDev(psF32 mean, psF32 sigma, psS32 Npts)
@@ -698,21 +691,11 @@
     PS_ASSERT_INT_NONNEGATIVE(Npts, NULL);
 
-    psVector* gauss = NULL;
-    const gsl_rng_type *T = NULL;
-    gsl_rng *r = NULL;
-    psS32 i = 0;
-
-
-    gauss = psVectorAlloc(Npts, PS_TYPE_F32);
-    gauss->n = Npts;
-    gsl_rng_env_setup();
-    T = gsl_rng_default;
-    r = gsl_rng_alloc(T);
-
-    for (i = 0; i < Npts; i++) {
-        gauss->data.F32[i] = mean + gsl_ran_gaussian(r, sigma);
-    }
-
-    // XXX: Should I free r, T as well?  This is a memory leak.
+    psRandom *r = psRandomAlloc(PS_RANDOM_TAUS, p_psRandomGetSystemSeed());
+    psVector* gauss = psVectorAlloc(Npts, PS_TYPE_F32);
+    for (psS32 i = 0; i < Npts; i++) {
+        gauss->data.F32[i] = mean + p_psRandomGaussian(r, sigma);
+    }
+    psFree(r);
+
     return(gauss);
 }
Index: /trunk/psLib/src/math/psRandom.c
===================================================================
--- /trunk/psLib/src/math/psRandom.c	(revision 4856)
+++ /trunk/psLib/src/math/psRandom.c	(revision 4857)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-12 19:12:01 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-23 23:23:05 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -130,4 +130,17 @@
 }
 
+double p_psRandomGaussian(const psRandom *r, double sigma)
+{
+    // Check null psRandom variable
+    if(r == NULL) {
+        psError(PS_ERR_UNEXPECTED_NULL,
+                true,
+                PS_ERRORTEXT_psRandom_NULL_RANDOM_VAR);
+        return(0);
+    } else {
+        return(gsl_ran_gaussian(r->gsl, sigma));
+    }
+}
+
 double psRandomPoisson(const psRandom *r, double mean)
 {
Index: /trunk/psLib/src/math/psRandom.h
===================================================================
--- /trunk/psLib/src/math/psRandom.h	(revision 4856)
+++ /trunk/psLib/src/math/psRandom.h	(revision 4857)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-06-21 03:01:37 $
+*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-23 23:23:05 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -47,4 +47,6 @@
 }
 psRandom;
+
+psU64 p_psRandomGetSystemSeed();
 
 /** Allocates a psRandom struct.
@@ -84,4 +86,17 @@
 );
 
+/** Random number generator based on a Gaussian deviate, N(0,1).
+ *  Uses gsl_ran_gaussian.
+ *  
+ *  XXX: I created this since the above psLib spec for p_psRandomGaussian
+ *  had no argument for sigma.  Verify that with IfA.
+ *  
+ *  @return double:     Random number.
+ */
+double p_psRandomGaussian(
+    const psRandom *r,                  ///< psRandom struct for RNG
+    double sigma
+);
+
 /** Random number generator based on a Poisson distribution with the given mean.
  *  Uses gsl_ran_poisson.
Index: /trunk/psLib/src/math/psStats.h
===================================================================
--- /trunk/psLib/src/math/psStats.h	(revision 4856)
+++ /trunk/psLib/src/math/psStats.h	(revision 4857)
@@ -14,6 +14,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-12 19:12:01 $
+ *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-23 23:23:05 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -52,5 +52,4 @@
     PS_STAT_USE_RANGE =  0x002000,          ///< Range
     PS_STAT_USE_BINSIZE = 0x004000,         ///< Binsize
-    //    PS_STAT_ROBUST_FOR_SAMPLE = 0x008000    ///< Robust for sample
 } psStatsOptions;
 
