Index: trunk/psLib/src/math/psRandom.h
===================================================================
--- trunk/psLib/src/math/psRandom.h	(revision 14452)
+++ trunk/psLib/src/math/psRandom.h	(revision 15261)
@@ -7,6 +7,6 @@
  * @author GLG, MHPCC
  *
- * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-08-09 01:40:07 $
+ * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-10-09 20:05:32 $
  *
  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,15 +37,13 @@
  *  Contains information on the psRandom type and GNU Scientific Library random number generator.
  */
-typedef struct
-{
+typedef struct {
     psRandomType type;                 ///< The type of RNG
     gsl_rng *gsl;                      ///< The RNG itself
-}
-psRandom;
+} psRandom;
 
 psU64 p_psRandomGetSystemSeed();
 
 /** Allocates a psRandom struct.
- *  
+ *
  *  @return psRandom*:    A new psRandom structure.
  */
@@ -56,5 +54,5 @@
 
 /** Resets an existing psRandom struct.
- *  
+ *
  *  @return void
  */
@@ -66,5 +64,5 @@
 /** Random number generator based on a uniform distribution on [0,1).
  *  Uses gsl_rng_uniform.
- *  
+ *
  *  @return double:     Random number.
  */
@@ -75,5 +73,5 @@
 /** Random number generator based on a Gaussian deviate, N(0,1).
  *  Uses gsl_ran_gaussian.
- *  
+ *
  *  @return double:     Random number.
  */
@@ -84,8 +82,8 @@
 /** 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.
  */
@@ -97,5 +95,5 @@
 /** Random number generator based on a Poisson distribution with the given mean.
  *  Uses gsl_ran_poisson.
- *  
+ *
  *  @return double:     Random number.
  */
@@ -105,4 +103,10 @@
 );
 
+#define PS_ASSERT_RANDOM_NON_NULL(NAME, RVAL) \
+if (!(NAME) || !(NAME)->gsl) { \
+    psError(PS_ERR_UNEXPECTED_NULL, true, "Error: Random number generator %s is NULL", #NAME); \
+    return RVAL; \
+}
+
 /// @}
 #endif // #ifndef PS_RANDOM_H
