IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/psLib/src/math/psRandom.h

    r15627 r23352  
    2929#include <gsl/gsl_randist.h>
    3030
    31 /** Enumeration containing a flag for psRandom types.  */
     31/// Random number generator types
    3232typedef enum {
    3333    PS_RANDOM_TAUS                     ///< A maximally equidistributed combined Tausworthe generator.
    3434} psRandomType;
    3535
    36 /** Data structure for psRandom.
    37  *  Contains information on the psRandom type and GNU Scientific Library random number generator.
    38  */
     36/// Random number generator
    3937typedef struct {
    4038    psRandomType type;                 ///< The type of RNG
     
    4846    );
    4947
    50 /** Allocates a psRandom struct.
    51  *
    52  *  @return psRandom*:    A new psRandom structure.
    53  */
     48/// Set the seed to use for random number generators.
     49///
     50/// A seed value of zero indicates that the seed is to be generated from the system.
     51/// The new seed value is returned
     52psU64 psRandomSeed(psU64 seed           ///< Seed for RNG
     53                   );
     54
     55/// Allocate a random number generator
     56///
     57/// The currently defined seed (via psRandomSeed) is used
    5458psRandom *psRandomAlloc(
    55     psRandomType type,                 ///< The type of RNG
    56     unsigned long seed                 ///< Known value with which to seed the RNG
     59    psRandomType type                   ///< The type of RNG
    5760) PS_ATTR_MALLOC;
    5861
    59 /** Resets an existing psRandom struct.
    60  *
    61  *  @return void
    62  */
    63 void psRandomReset(
    64     psRandom *rand,                    ///< Existing psRandom struct to reset
    65     unsigned long seed                 ///< Known value with which to seed the RNG
     62/// Allocate a random number generator with a specific seed
     63///
     64/// A seed value of zero indicates that the seed is to be generated from the system.
     65psRandom *psRandomAllocSpecific(psRandomType type, ///< The type of RNG
     66                                psU64 specificSeed ///< The specific seed to use
     67    );
     68
     69/// Resets an existing random number generator
     70bool psRandomReset(
     71    psRandom *rand                      ///< Random number generator to reset
    6672);
    6773
     
    7278 */
    7379double psRandomUniform(
    74     const psRandom *r                  ///< psRandom struct for RNG
     80    const psRandom *r                  ///< Random number generator
    7581);
    7682
     
    8187 */
    8288double psRandomGaussian(
    83     const psRandom *r                  ///< psRandom struct for RNG
     89    const psRandom *r                  ///< Random number generator
    8490);
    8591
    86 /** Random number generator based on a Gaussian deviate, N(0,1).
     92/** Random number generator based on a Gaussian deviate with specified standard deviation.
    8793 *  Uses gsl_ran_gaussian.
    88  *
    89  *  XXX: I created this since the above psLib spec for p_psRandomGaussian
    90  *  had no argument for sigma.  Verify that with IfA.
    9194 *
    9295 *  @return double:     Random number.
    9396 */
    9497double p_psRandomGaussian(
    95     const psRandom *r,                  ///< psRandom struct for RNG
     98    const psRandom *r,                  ///< Random number generator
    9699    double sigma
    97100);
     
    103106 */
    104107double psRandomPoisson(
    105     const psRandom *r,                 ///< psRandom struct for RNG
     108    const psRandom *r,                  ///< Random number generator
    106109    double mean                         ///< Mean value
    107110);
Note: See TracChangeset for help on using the changeset viewer.