IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2004, 2:06:06 PM (22 years ago)
Author:
desonia
Message:

another attempt to get astyle to get it right.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psStats.h

    r1406 r1407  
     1
    12/** @file  psStats.h
    23 *  \brief basic statistical operations
     
    910 *  @author George Gusciora, MHPCC
    1011 *
    11  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-06 22:34:05 $
     12 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-07 00:06:06 $
    1314 *
    1415 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1516 */
    1617#if !defined(PS_STATS_H)
    17 #define PS_STATS_H
     18#    define PS_STATS_H
    1819
    19 #include "psVector.h"
     20#    include "psVector.h"
    2021
    2122/// @addtogroup Stats
     
    2627 *****************************************************************************/
    2728typedef enum {
    28     PS_STAT_SAMPLE_MEAN           = 0x000001,
    29     PS_STAT_SAMPLE_MEDIAN         = 0x000002,
    30     PS_STAT_SAMPLE_STDEV          = 0x000004,
    31     PS_STAT_SAMPLE_QUARTILE       = 0x000008,
    32     PS_STAT_ROBUST_MEAN           = 0x000010,
    33     PS_STAT_ROBUST_MEDIAN         = 0x000020,
    34     PS_STAT_ROBUST_MODE           = 0x000040,
    35     PS_STAT_ROBUST_STDEV          = 0x000080,
    36     PS_STAT_ROBUST_QUARTILE       = 0x000100,
    37     PS_STAT_CLIPPED_MEAN          = 0x000200,
    38     PS_STAT_CLIPPED_STDEV         = 0x000400,
    39     PS_STAT_MAX                   = 0x000800,
    40     PS_STAT_MIN                   = 0x001000,
    41     PS_STAT_USE_RANGE             = 0x002000,
    42     PS_STAT_USE_BINSIZE           = 0x004000,
    43     PS_STAT_ROBUST_FOR_SAMPLE     = 0x008000
     29    PS_STAT_SAMPLE_MEAN = 0x000001,
     30    PS_STAT_SAMPLE_MEDIAN = 0x000002,
     31    PS_STAT_SAMPLE_STDEV = 0x000004,
     32    PS_STAT_SAMPLE_QUARTILE = 0x000008,
     33    PS_STAT_ROBUST_MEAN = 0x000010,
     34    PS_STAT_ROBUST_MEDIAN = 0x000020,
     35    PS_STAT_ROBUST_MODE = 0x000040,
     36    PS_STAT_ROBUST_STDEV = 0x000080,
     37    PS_STAT_ROBUST_QUARTILE = 0x000100,
     38    PS_STAT_CLIPPED_MEAN = 0x000200,
     39    PS_STAT_CLIPPED_STDEV = 0x000400,
     40    PS_STAT_MAX = 0x000800,
     41    PS_STAT_MIN = 0x001000,
     42    PS_STAT_USE_RANGE = 0x002000,
     43    PS_STAT_USE_BINSIZE = 0x004000,
     44    PS_STAT_ROBUST_FOR_SAMPLE = 0x008000
    4445} psStatsOptions;
    45 
    4646
    4747/** This is the generic statistics structure.  It contails the data members
     
    5050typedef struct
    5151{
    52     double sampleMean;          ///< formal mean of sample
    53     double sampleMedian;        ///< formal median of sample
    54     double sampleStdev;         ///< standard deviation of sample
    55     double sampleUQ;            ///< upper quartile of sample
    56     double sampleLQ;            ///< lower quartile of sample
    57     double sampleLimit;         ///<
    58     double robustMean;          ///< robust mean of array
    59     double robustMedian;        ///< robust median of array
    60     double robustMode;          ///< Robust mode of array
    61     double robustStdev;         ///< robust standard deviation of array
    62     double robustUQ;            ///< robust upper quartile
    63     double robustLQ;            ///< robust lower quartile
     52    double sampleMean;          // /< formal mean of sample
     53    double sampleMedian;        // /< formal median of sample
     54    double sampleStdev;         // /< standard deviation of sample
     55    double sampleUQ;            // /< upper quartile of sample
     56    double sampleLQ;            // /< lower quartile of sample
     57    double sampleLimit;         // /<
     58    double robustMean;          // /< robust mean of array
     59    double robustMedian;        // /< robust median of array
     60    double robustMode;          // /< Robust mode of array
     61    double robustStdev;         // /< robust standard deviation of array
     62    double robustUQ;            // /< robust upper quartile
     63    double robustLQ;            // /< robust lower quartile
    6464    double XXX;
    65     double robustN50;           ///<
    66     double robustNfit;          ///<
    67     double clippedMean;         ///< Nsigma clipped mean
    68     double clippedStdev;        ///< standard deviation after clipping
    69     double clipSigma;           ///< Nsigma used for clipping; user input
    70     int    clipIter;            ///< Number of clipping iterations; user input
    71     double min;                 ///< minimum data value in array
    72     double max;                 ///< maximum data value in array
    73     double binsize;             ///<
    74     psStatsOptions options;     ///< bitmask of calculated values
     65    double robustN50;           // /<
     66    double robustNfit;          // /<
     67    double clippedMean;         // /< Nsigma clipped mean
     68    double clippedStdev;        // /< standard deviation after clipping
     69    double clipSigma;           // /< Nsigma used for clipping; user input
     70    int clipIter;               // /< Number of clipping iterations; user input
     71    double min;                 // /< minimum data value in array
     72    double max;                 // /< maximum data value in array
     73    double binsize;             // /<
     74    psStatsOptions options;     // /< bitmask of calculated values
    7575}
    7676psStats;
    7777
    78 
    7978/** Do Statistics on an array.  Returns a status value. \ingroup MathGroup */
    80 psStats *
    81 psVectorStats(psStats *stats,       ///< stats structure defines stats to be calculated and how
    82               psVector *in,         ///< Vector to be analysed: must be F32
    83               psVector *mask,       ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    84               unsigned int maskVal ///< Only mask elements with one of these bits set in maskVector
    85              );
     79psStats *psVectorStats(psStats * stats, // /< stats structure defines stats to be calculated and how
     80                       psVector * in,   // /< Vector to be analysed: must be F32
     81                       psVector * mask, // /< Ignore elements where (maskVector & maskVal) != 0: must be INT
     82                       // or NULL
     83                       unsigned int maskVal     // /< Only mask elements with one of these bits set in
     84                       // maskVector
     85                      );
    8686
    8787/** A constructor for the stats structure.*/
    88 psStats *psStatsAlloc(psStatsOptions options); ///< Statistics to measure
     88psStats *psStatsAlloc(psStatsOptions options);  // /< Statistics to measure
    8989
    9090/******************************************************************************
    9191    Histogram functions and data structures.
    9292 *****************************************************************************/
     93
    9394/** The basic histogram structure which contains bounds and bins. */
    9495typedef struct
    9596{
    96     psVector *bounds;                ///< Bounds for the bins (type F32)
    97     psVector *nums;                  ///< Number in each of the bins (INT)
    98     int minNum;                      ///< Number below the minimum
    99     int maxNum;                      ///< Number above the maximum
    100     bool uniform;                     ///< Is it a uniform distribution?
     97    psVector *bounds;           // /< Bounds for the bins (type F32)
     98    psVector *nums;             // /< Number in each of the bins (INT)
     99    int minNum;                 // /< Number below the minimum
     100    int maxNum;                 // /< Number above the maximum
     101    bool uniform;               // /< Is it a uniform distribution?
    101102}
    102103psHistogram;
    103104
    104 
    105105/** Constructor \ingroup MathGroup */
    106 psHistogram *
    107 psHistogramAlloc(float lower,  ///< Lower limit for the bins
    108                  float upper,  ///< Upper limit for the bins
    109                  int n);       ///< Number of bins
    110 
     106psHistogram *psHistogramAlloc(float lower,      // /< Lower limit for the bins
     107                              float upper,      // /< Upper limit for the bins
     108                              int n);   // /< Number of bins
    111109
    112110/** Generic constructor \ingroup MathGroup */
    113 psHistogram * psHistogramAllocGeneric(const psVector *restrict bounds); ///< Bounds for the bins
     111psHistogram *psHistogramAllocGeneric(const psVector * restrict bounds); // /< Bounds for the bins
    114112
    115113/** Calculate a histogram \ingroup MathGroup **/
    116 psHistogram *psVectorHistogram (psHistogram *out,   ///< Histogram data
    117                                 const psVector *restrict in,       ///< Vector to analyse
    118                                 const psVector *restrict mask,     ///< Mask dat for input vector
    119                                 unsigned int maskVal);       ///< Mask value
     114psHistogram *psVectorHistogram(psHistogram * out,       // /< Histogram data
     115                               const psVector * restrict in,    // /< Vector to analyse
     116                               const psVector * restrict mask,  // /< Mask dat for input vector
     117                               unsigned int maskVal);   // /< Mask value
    120118
    121 bool p_psGetStatValue(
    122     const psStats* stats,
    123     double* value
    124 );
     119bool p_psGetStatValue(const psStats * stats, double *value);
    125120
    126121/// @}
    127122
    128123#endif
    129 
Note: See TracChangeset for help on using the changeset viewer.