IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2004, 3:05:35 PM (22 years ago)
Author:
gusciora
Message:

Added the median calculation functions.

File:
1 edited

Legend:

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

    r644 r652  
    66 *  \ingroup MathGroup
    77 */
     8#include "psLib.h"
     9#include "psVector.h"
    810
    9 /******************************************************************************
    10     The following typedefs and functions belong in the psArray.h and psArray.c
    11     files.  However, those files are not available at this time, due to the
    12     changing definition of the psLib data/functions.  For temporary purposes
    13     only, I am including them here so that I can continue coding while our
    14     basic data types are still being implemented.
    15  *****************************************************************************/
    16 typedef enum {
    17     PS_TYPE_CHAR,
    18     PS_TYPE_SHORT,
    19     PS_TYPE_INT,
    20     PS_TYPE_LONG,
    21     PS_TYPE_UCHAR,
    22     PS_TYPE_USHORT,
    23     PS_TYPE_UINT,
    24     PS_TYPE_ULONG,
    25     PS_TYPE_FLOAT,
    26     PS_TYPE_DOUBLE,
    27     PS_TYPE_COMPLEX,
    28     PS_TYPE_OTHER,
    29 } psElemType;
    30 
    31 typedef enum {
    32     PS_DIMEN_SCALAR,
    33     PS_DIMEN_VECTOR,
    34     PS_DIMEN_TRANSV,
    35     PS_DIMEN_IMAGE,
    36     PS_DIMEN_OTHER
    37 } psDimen;
    38 
    39 typedef struct
    40 {
    41     psElemType type;
    42     psDimen dimen;
    43 }
    44 psType;
    45 
    46 typedef struct
    47 {
    48     psType type;                ///< Type of data.
    49     int nalloc;                 ///< Total number of elements available.
    50     int n;                      ///< Number of elements in use.
    51 
    52     union {
    53         int *vecI;
    54         float *vecF;
    55         double *vecD;
    56         //        complex float *vecC;
    57         void **vecP;
    58     }vec;                       ///< Union with array data.
    59 }
    60 psVector;
    61 
    62 psVector *psVectorAlloc(int        nalloc,
    63                         psElemType type)
    64 {
    65     return(NULL);
    66 }
    67 
    68 psVector *psVectorRealloc(psVector myVector,
    69                           int nalloc)
    70 {
    71     return(NULL);
    72 }
    73 
    74 void psVectorFree(psVector *restrict psArr)
    75 {}
     11int mine(psVector *myVector);
    7612
    7713/** statistics which may be calculated */
     
    13369/** Do Statistics on an array.  Returns a status value. \ingroup MathGroup */
    13470psStats *
    135 psArrayStats(const psVector *restrict myVector, ///< Vector to be analysed
    136              // must be FLOAT
    137              const psVector *restrict maskVector, ///< Ignore elements where (maskVector & maskVal) != 0
    138              // must be INT or NULL
     71psArrayStats(const psVector *restrict myVector, ///< Vector to be analysed: must be FLOAT
     72             const psVector *restrict maskVector, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    13973             unsigned int maskVal, ///< Only mask elements with one of these bits set in maskVector
    14074             psStats *stats  ///< stats structure defines stats to be calculated and how
Note: See TracChangeset for help on using the changeset viewer.