IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 22, 2004, 2:06:40 PM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

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

    r1282 r1284  
    1515#include "psAbort.h"
    1616#include "psStats.h"
    17 #include "psVectorSort.h"
    1817#include "psMinimize.h"
    1918#include "psFunctions.h"
     
    4039
    4140/** Preprocessor macro to generate error on an incorrect type */
    42 #define PS_CHECK_VECTOR_TYPE(NAME, TYPE)                                                          \
    43 if (NAME->type.type != TYPE) {                                                         \
    44     psError(__func__,"Invalid operation: %s has incorrect type.", #NAME);                          \
     41#define PS_CHECK_VECTOR_TYPE(NAME, TYPE) \
     42if (NAME->type.type != TYPE) { \
     43    psError(__func__,"Invalid operation: %s has incorrect type.", #NAME); \
    4544}
    4645
    4746/** Preprocessor macro to generate error on a NULL vector */
    48 #define PS_CHECK_NULL_VECTOR(NAME)                                                          \
    49 if (NAME == NULL || NAME->data.V == NULL) {                                                         \
    50     psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME);                          \
     47#define PS_CHECK_NULL_VECTOR(NAME) \
     48if (NAME == NULL || NAME->data.V == NULL) { \
     49    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \
    5150}
    5251
    5352/** Preprocessor macro to generate error for zero length vector */
    54 #define PS_CHECK_EMPTY_VECTOR(NAME)                                                          \
    55 if (NAME->n < 1) {                                                                                  \
    56     psError(__func__,"Invalid operation: %s has zero n value.", #NAME);                             \
     53#define PS_CHECK_EMPTY_VECTOR(NAME) \
     54if (NAME->n < 1) { \
     55    psError(__func__,"Invalid operation: %s has zero n value.", #NAME); \
    5756}
    5857
    5958/** Preprocessor macro to generate error on differing size vectors */
    60 #define PS_CHECK_VECTOR_SIZE_EQUAL(VEC1, VEC2)                                                          \
    61 if (VEC1->n != VEC2->n) {               \
     59#define PS_CHECK_VECTOR_SIZE_EQUAL(VEC1, VEC2) \
     60if (VEC1->n != VEC2->n) { \
    6261    psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
    6362}
     63
     64#define PS_PRINT_VECTOR(NAME) \
     65for (int my_i=0;my_i<NAME->n;my_i++) { \
     66    printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
     67} \
     68printf("\n"); \
    6469
    6570/*****************************************************************************/
     
    653658    psFree(unsortedVector);
    654659    psFree(sortedVector);
    655     // NOTE: This is the
    656660}
    657661
     
    668672    NULL
    669673 
    670 NOTE: the mean is always calculated exactly.  Robust means are never
    671 calculated in this routine.
    672674 *****************************************************************************/
    673675void p_psVectorSampleStdev(const psVector *restrict myVector,
     
    10441046}
    10451047
    1046 #define PS_PRINT_VECTOR(NAME) \
    1047 for (int my_i=0;my_i<NAME->n;my_i++) { \
    1048     printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
    1049 } \
    1050 printf("\n"); \
    1051 
    10521048/******************************************************************************
    10531049p_psVectorRobustStats(myVector, maskVector, maskVal, stats): this procedure
     
    10591055PS_STAT_ROBUST_QUARTILE
    10601056I have included all that computation in a single function, as opposed to
    1061 breaking it across several functions for one primary reason:
     1057breaking it across several functions for one primary reason: 
    10621058they all
    10631059require the same basic initial processing steps (calculate the histogram,
    1064 etc.)
     1060etc.) 
    10651061however there is no currently defined means, in the SDRS, to
    10661062specify this computation as a separate step.  If the above robust stat
     
    16111607    // NOTE: Verify that this is the correct action.
    16121608    if (bounds == NULL) {
    1613         //        psAbort(__func__, "psHistogram requested with NULL bounds");
     1609        // psAbort(__func__, "psHistogram requested with NULL bounds");
    16141610        return(NULL);
    16151611    }
     
    16171613    // NOTE: Verify that this is the correct action.
    16181614    if (bounds->n <= 1) {
    1619         //        psAbort(__func__, "psHistogram requested with NULL bounds");
     1615        // psAbort(__func__, "psHistogram requested with NULL bounds");
    16201616        return(NULL);
    16211617    }
Note: See TracChangeset for help on using the changeset viewer.