IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1327


Ignore:
Timestamp:
Jul 28, 2004, 5:54:52 PM (22 years ago)
Author:
evanalst
Message:

Changed the data type Histogram member nums to be of type psU32 per SDR.

Location:
trunk/psLib
Files:
5 edited

Legend:

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

    r1326 r1327  
    16001600
    16011601    // Allocate the bins, and initialize them to zero.
    1602     newHist->nums =  psVectorAlloc(n, PS_TYPE_S32);
     1602    newHist->nums =  psVectorAlloc(n, PS_TYPE_U32);
    16031603    newHist->nums->n = newHist->nums->nalloc;
    16041604    for (i=0;i<newHist->nums->n;i++) {
    1605         newHist->nums->data.S32[i] = 0;
     1605        newHist->nums->data.U32[i] = 0;
    16061606    }
    16071607
     
    16561656    // Allocate the bins, and initialize them to zero.  If there are N bounds,
    16571657    // then there are N-1 bins.
    1658     newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_S32);
     1658    newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_U32);
    16591659    newHist->nums->n = newHist->nums->nalloc;
    16601660    for (i=0;i<newHist->nums->n;i++) {
    1661         newHist->nums->data.S32[i] = 0;
     1661        newHist->nums->data.U32[i] = 0;
    16621662    }
    16631663
     
    17051705    if (out == NULL) {
    17061706        return(NULL);
     1707    }
     1708
     1709    // Check the specified output histogram for type psF32
     1710    if (out->bounds->type.type != PS_TYPE_F32) {
     1711        psAbort(__func__,
     1712                "Only data type PS_TYPE_F32 for the output.bounds member.");
     1713    }
     1714
     1715    if (out->nums->type.type != PS_TYPE_U32) {
     1716        psAbort(__func__,
     1717                "Only data type PS_TYPE_U32 for output.nums member.");
    17071718    }
    17081719
  • trunk/psLib/src/math/psStats.c

    r1326 r1327  
    16001600
    16011601    // Allocate the bins, and initialize them to zero.
    1602     newHist->nums =  psVectorAlloc(n, PS_TYPE_S32);
     1602    newHist->nums =  psVectorAlloc(n, PS_TYPE_U32);
    16031603    newHist->nums->n = newHist->nums->nalloc;
    16041604    for (i=0;i<newHist->nums->n;i++) {
    1605         newHist->nums->data.S32[i] = 0;
     1605        newHist->nums->data.U32[i] = 0;
    16061606    }
    16071607
     
    16561656    // Allocate the bins, and initialize them to zero.  If there are N bounds,
    16571657    // then there are N-1 bins.
    1658     newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_S32);
     1658    newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_U32);
    16591659    newHist->nums->n = newHist->nums->nalloc;
    16601660    for (i=0;i<newHist->nums->n;i++) {
    1661         newHist->nums->data.S32[i] = 0;
     1661        newHist->nums->data.U32[i] = 0;
    16621662    }
    16631663
     
    17051705    if (out == NULL) {
    17061706        return(NULL);
     1707    }
     1708
     1709    // Check the specified output histogram for type psF32
     1710    if (out->bounds->type.type != PS_TYPE_F32) {
     1711        psAbort(__func__,
     1712                "Only data type PS_TYPE_F32 for the output.bounds member.");
     1713    }
     1714
     1715    if (out->nums->type.type != PS_TYPE_U32) {
     1716        psAbort(__func__,
     1717                "Only data type PS_TYPE_U32 for output.nums member.");
    17071718    }
    17081719
  • trunk/psLib/test/dataManip/tst_psHist00.c

    r1320 r1327  
    5050
    5151        for (i=0;i<numBins;i++) {
    52             if (myHist->nums->data.S32[i] != 0) {
    53                 printf("ERROR: myHist->nums->data.S32[%d] not initialized to 0.\n", i);
     52            if (myHist->nums->data.U32[i] != 0) {
     53                printf("ERROR: myHist->nums->data.U32[%d] not initialized to 0.\n", i);
    5454                testStatus = false;
    5555            }
    56             myHist->nums->data.S32[i] = 0;
     56            myHist->nums->data.U32[i] = 0;
    5757        }
    5858
  • trunk/psLib/test/dataManip/tst_psHist01.c

    r1320 r1327  
    5656
    5757        for (i=0;i<numBins;i++) {
    58             if (myHist->nums->data.S32[i] != 0) {
    59                 printf("ERROR: myHist->nums->data.S32[%d] not initialized to 0.\n", i);
     58            if (myHist->nums->data.U32[i] != 0) {
     59                printf("ERROR: myHist->nums->data.U32[%d] not initialized to 0.\n", i);
    6060                testStatus = false;
    6161            }
    62             myHist->nums->data.S32[i] = 0;
     62            myHist->nums->data.U32[i] = 0;
    6363        }
    6464
  • trunk/psLib/test/dataManip/tst_psHist02.c

    r1320 r1327  
    6666
    6767        myHist = psHistogramAlloc(LOWER, UPPER, numBins);
    68         myHist = psHistogramVector(myHist, myData, NULL, 0);
     68        myHist = psVectorHistogram(myHist, myData, NULL, 0);
    6969
    7070        for (i=0;i<numBins;i++) {
     
    7272                   myHist->bounds->data.F32[i],
    7373                   myHist->bounds->data.F32[i+1],
    74                    myHist->nums->data.S32[i]);
     74                   myHist->nums->data.U32[i]);
    7575        }
    7676        psMemCheckCorruption(1);
     
    9191
    9292        myHist = psHistogramAlloc(LOWER, UPPER, numBins);
    93         myHist = psHistogramVector(myHist, myData, myMask, 1);
     93        myHist = psVectorHistogram(myHist, myData, myMask, 1);
    9494
    9595        for (i=0;i<numBins;i++) {
     
    9797                   myHist->bounds->data.F32[i],
    9898                   myHist->bounds->data.F32[i+1],
    99                    myHist->nums->data.S32[i]);
     99                   myHist->nums->data.U32[i]);
    100100        }
    101101        psMemCheckCorruption(1);
     
    112112    printPositiveTestHeader(stdout,
    113113                            "psStats functions",
    114                             "Calling psHistogramVector() with various NULL inputs.");
     114                            "Calling psVectorHistogram() with various NULL inputs.");
    115115
    116116    // Verify the return value is null and program execution doesn't stop,
    117117    // if input parameter myHist is null.
    118118
    119     myHist2 = psHistogramVector(NULL, myData, NULL, 0);
     119    myHist2 = psVectorHistogram(NULL, myData, NULL, 0);
    120120    if (myHist2 != NULL) {
    121121        printf("ERROR: myHist2!=NULL\n");
     
    130130
    131131    myHist = psHistogramAlloc(LOWER, UPPER, numBins);
    132     myHist = psHistogramVector(myHist, NULL, NULL, 0);
     132    myHist = psVectorHistogram(myHist, NULL, NULL, 0);
    133133    if (myHist == NULL) {
    134134        printf("ERROR: myHist==NULL\n");
     
    147147    myData->n = myData->nalloc;
    148148    myHist = psHistogramAlloc(LOWER, UPPER, numBins);
    149     myHist = psHistogramVector(myHist, NULL, NULL, 0);
     149    myHist = psVectorHistogram(myHist, NULL, NULL, 0);
    150150    if (myHist == NULL) {
    151151        printf("ERROR: myHist==NULL\n");
     
    157157    printFooter(stdout,
    158158                "psStats functions",
    159                 "Calling psHistogramVector() with various NULL inputs.",
     159                "Calling psVectorHistogram() with various NULL inputs.",
    160160                testStatus);
    161161
Note: See TracChangeset for help on using the changeset viewer.