IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4293 for trunk/psLib/src/math


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

* empty log message *

Location:
trunk/psLib/src/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/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
  • trunk/psLib/src/math/psStats.h

    r4162 r4293  
    1414 *  @author GLG, MHPCC
    1515 *
    16  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2005-06-08 23:40:45 $
     16 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-06-17 00:11:05 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3737// XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete?
    3838typedef enum {
    39     PS_STAT_SAMPLE_MEAN = 0x000001,
    40     PS_STAT_SAMPLE_MEDIAN = 0x000002,
    41     PS_STAT_SAMPLE_STDEV = 0x000004,
    42     PS_STAT_SAMPLE_QUARTILE = 0x000008,
    43     PS_STAT_ROBUST_MEAN = 0x000010,
    44     PS_STAT_ROBUST_MEDIAN = 0x000020,
    45     PS_STAT_ROBUST_MODE = 0x000040,
    46     PS_STAT_ROBUST_STDEV = 0x000080,
    47     PS_STAT_ROBUST_QUARTILE = 0x000100,
    48     PS_STAT_CLIPPED_MEAN = 0x000200,
    49     PS_STAT_CLIPPED_STDEV = 0x000400,
    50     PS_STAT_MAX =  0x000800,
    51     PS_STAT_MIN =  0x001000,
    52     PS_STAT_USE_RANGE =  0x002000,
    53     PS_STAT_USE_BINSIZE = 0x004000,
    54     PS_STAT_ROBUST_FOR_SAMPLE = 0x008000
     39    PS_STAT_SAMPLE_MEAN = 0x000001,         ///< Sample Mean
     40    PS_STAT_SAMPLE_MEDIAN = 0x000002,       ///< Sample Median
     41    PS_STAT_SAMPLE_STDEV = 0x000004,        ///< Sample Standard Deviation
     42    PS_STAT_SAMPLE_QUARTILE = 0x000008,     ///< Sample Quartile
     43    PS_STAT_ROBUST_MEAN = 0x000010,         ///< Robust Mean
     44    PS_STAT_ROBUST_MEDIAN = 0x000020,       ///< Robust Median
     45    PS_STAT_ROBUST_MODE = 0x000040,         ///< Robust Mode
     46    PS_STAT_ROBUST_STDEV = 0x000080,        ///< Robust Standarad Deviation
     47    PS_STAT_ROBUST_QUARTILE = 0x000100,     ///< Robust Quartile
     48    PS_STAT_CLIPPED_MEAN = 0x000200,        ///< Clipped Mean
     49    PS_STAT_CLIPPED_STDEV = 0x000400,       ///< Clipped Standard Deviation
     50    PS_STAT_MAX =  0x000800,                ///< Maximum
     51    PS_STAT_MIN =  0x001000,                ///< Minumum
     52    PS_STAT_USE_RANGE =  0x002000,          ///< Range
     53    PS_STAT_USE_BINSIZE = 0x004000,         ///< Binsize
     54    PS_STAT_ROBUST_FOR_SAMPLE = 0x008000    ///< Robust for sample
    5555} psStatsOptions;
    5656
     
    180180// XXX: Create a single, generic, version of the vector normalize function.
    181181// XXX: Ask IfA for a public psLib function.
    182 void p_psNormalizeVectorRangeU8(psVector* myData, psU8 low, psU8 high);
    183 void p_psNormalizeVectorRangeU16(psVector* myData, psU16 low, psU16 high);
    184 void p_psNormalizeVectorRangeU32(psVector* myData, psU32 low, psU32 high);
    185 void p_psNormalizeVectorRangeU64(psVector* myData, psU64 low, psU64 high);
    186 void p_psNormalizeVectorRangeS8(psVector* myData, psS8 low, psS8 high);
    187 void p_psNormalizeVectorRangeS16(psVector* myData, psS16 low, psS16 high);
    188 void p_psNormalizeVectorRangeS32(psVector* myData, psS32 low, psS32 high);
    189 void p_psNormalizeVectorRangeS64(psVector* myData, psS64 low, psS64 high);
    190 void p_psNormalizeVectorRangeF32(psVector* myData, psF32 low, psF32 high);
    191 void p_psNormalizeVectorRangeF64(psVector* myData, psF64 low, psF64 high);
     182
     183/** Normalize the range of a vector containing U8 values  */
     184void p_psNormalizeVectorRangeU8(
     185    psVector* myData,                  ///< Vector containing the U8 values
     186    psU8 low,                          ///< Minimum value
     187    psU8 high                          ///< Maximum value
     188);
     189
     190/** Normalize the range of a vector containing U16 values  */
     191void p_psNormalizeVectorRangeU16(
     192    psVector* myData,                  ///< Vector containing the U16 values
     193    psU16 low,                         ///< Minimum value
     194    psU16 high                         ///< Maximum value
     195);
     196
     197/** Normalize the range of a vector containing U32 values  */
     198void p_psNormalizeVectorRangeU32(
     199    psVector* myData,                  ///< Vector containing the U32 values
     200    psU32 low,                         ///< Minimum value
     201    psU32 high                         ///< Maximum value
     202);
     203
     204/** Normalize the range of a vector containing U64 values  */
     205void p_psNormalizeVectorRangeU64(
     206    psVector* myData,                  ///< Vector containing the U64 values
     207    psU64 low,                         ///< Minimum value
     208    psU64 high                         ///< Maximum value
     209);
     210
     211/** Normalize the range of a vector containing S8 values  */
     212void p_psNormalizeVectorRangeS8(
     213    psVector* myData,                  ///< Vector containing the S8 values
     214    psS8 low,                          ///< Minimum value
     215    psS8 high                          ///< Maximum value
     216);
     217
     218/** Normalize the range of a vector containing S16 values  */
     219void p_psNormalizeVectorRangeS16(
     220    psVector* myData,                  ///< Vector containing the S16 values
     221    psS16 low,                         ///< Minimum value
     222    psS16 high                         ///< Maximum value
     223);
     224
     225/** Normalize the range of a vector containing S32 values  */
     226void p_psNormalizeVectorRangeS32(
     227    psVector* myData,                  ///< Vector containing the S32 values
     228    psS32 low,                         ///< Minimum value
     229    psS32 high                         ///< Maximum value
     230);
     231
     232/** Normalize the range of a vector containing S64 values  */
     233void p_psNormalizeVectorRangeS64(
     234    psVector* myData,                  ///< Vector containing the S64 values
     235    psS64 low,                         ///< Minimum value
     236    psS64 high                         ///< Maximum value
     237);
     238
     239/** Normalize the range of a vector containing F32 values  */
     240void p_psNormalizeVectorRangeF32(
     241    psVector* myData,                  ///< Vector containing the F32 values
     242    psF32 low,                         ///< Minimum value
     243    psF32 high                         ///< Maximum value
     244);
     245
     246/** Normalize the range of a vector containing F64 values  */
     247void p_psNormalizeVectorRangeF64(
     248    psVector* myData,                  ///< Vector containing the F64 values
     249    psF64 low,                         ///< Minimum value
     250    psF64 high                         ///< Maximum value
     251);
    192252
    193253/// @}
Note: See TracChangeset for help on using the changeset viewer.