IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2005, 2:11:08 PM (21 years ago)
Author:
drobbin
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psRandom.h

    r4162 r4293  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-08 23:40:45 $
     12*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-06-17 00:11:05 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3333 */
    3434
     35/** Enumeration containing a flag for psRandom types.  */
    3536typedef enum {
    36     PS_RANDOM_TAUS    ///< A maximally equidistributed combined Tausworthe generator.
     37    PS_RANDOM_TAUS                     ///< A maximally equidistributed combined Tausworthe generator.
    3738} psRandomType;
    3839
     40/** Data structure for psRandom.
     41 *  Contains information on the psRandom type and GNU Scientific Library random number generator.
     42 */
    3943typedef struct
    4044{
    41     psRandomType type; ///< The type of RNG
    42     gsl_rng *gsl; ///< The RNG itself
     45    psRandomType type;                 ///< The type of RNG
     46    gsl_rng *gsl;                      ///< The RNG itself
    4347}
    4448psRandom;
    4549
    46 psRandom *psRandomAlloc(psRandomType type,
    47                         psU64 seed);
     50/** Allocates a psRandom struct.
     51 * 
     52 *  @return psRandom*:    A new psRandom structure.
     53 */
     54psRandom *psRandomAlloc(
     55    psRandomType type,                 ///< The type of RNG
     56    psU64 seed                         ///< Known value with which to seed the RNG
     57);
    4858
    49 void psRandomReset(psRandom *rand,
    50                    psU64 seed);
     59/** Resets an existing psRandom struct.
     60 * 
     61 *  @return void
     62 */
     63void psRandomReset(
     64    psRandom *rand,                    ///< Existing psRandom struct to reset
     65    psU64 seed                         ///< Known value with which to seed the RNG
     66);
    5167
    52 psF64 psRandomUniform(const psRandom *r);
    53 psF64 psRandomGaussian(const psRandom *r);
    54 psF64 psRandomPoisson(const psRandom *r, psF64 mean);
     68/** Random number generator based on a uniform distribution on [0,1).
     69 *  Uses gsl_rng_uniform.
     70 * 
     71 *  @return psF64:     Random number.
     72 */
     73psF64 psRandomUniform(
     74    const psRandom *r                  ///< psRandom struct for RNG
     75);
     76
     77/** Random number generator based on a Gaussian deviate, N(0,1).
     78 *  Uses gsl_ran_gaussian.
     79 * 
     80 *  @return psF64:     Random number.
     81 */
     82psF64 psRandomGaussian(
     83    const psRandom *r                  ///< psRandom struct for RNG
     84);
     85
     86/** Random number generator based on a Poisson distribution with the given mean.
     87 *  Uses gsl_ran_poisson.
     88 * 
     89 *  @return psF64:     Random number.
     90 */
     91psF64 psRandomPoisson(
     92    const psRandom *r,                 ///< psRandom struct for RNG
     93    psF64 mean                         ///< Mean value
     94);
    5595
    5696/* \} */// End of MathGroup Functions
Note: See TracChangeset for help on using the changeset viewer.