IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1284


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

...

Location:
trunk/psLib/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/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    }
  • trunk/psLib/src/dataManip/psStats.d

    r1233 r1284  
    1 psStats.o psStats.d : psStats.c ../sysUtils/psMemory.h ../collections/psVector.h \
    2   ../collections/psType.h ../sysUtils/psTrace.h ../sysUtils/psError.h \
    3   ../sysUtils/psAbort.h psStats.h
     1psStats.o psStats.d : psStats.c ../sysUtils/psMemory.h ../image/psImage.h \
     2  ../collections/psType.h ../collections/psVector.h ../sysUtils/psTrace.h \
     3  ../sysUtils/psError.h ../sysUtils/psAbort.h psStats.h psMinimize.h \
     4  psFunctions.h
  • trunk/psLib/src/dataManip/psStats.h

    r1281 r1284  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-22 23:44:49 $
     11 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-23 00:06:40 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6262    double robustUQ;            ///< robust upper quartile
    6363    double robustLQ;            ///< robust lower quartile
     64    double XXX;
    6465    double robustN50;           ///<
    6566    double robustNfit;          ///<
  • 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    }
  • trunk/psLib/src/math/psStats.h

    r1281 r1284  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-22 23:44:49 $
     11 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-23 00:06:40 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6262    double robustUQ;            ///< robust upper quartile
    6363    double robustLQ;            ///< robust lower quartile
     64    double XXX;
    6465    double robustN50;           ///<
    6566    double robustNfit;          ///<
Note: See TracChangeset for help on using the changeset viewer.