Changeset 1327
- Timestamp:
- Jul 28, 2004, 5:54:52 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 5 edited
-
src/dataManip/psStats.c (modified) (3 diffs)
-
src/math/psStats.c (modified) (3 diffs)
-
test/dataManip/tst_psHist00.c (modified) (1 diff)
-
test/dataManip/tst_psHist01.c (modified) (1 diff)
-
test/dataManip/tst_psHist02.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psStats.c
r1326 r1327 1600 1600 1601 1601 // Allocate the bins, and initialize them to zero. 1602 newHist->nums = psVectorAlloc(n, PS_TYPE_ S32);1602 newHist->nums = psVectorAlloc(n, PS_TYPE_U32); 1603 1603 newHist->nums->n = newHist->nums->nalloc; 1604 1604 for (i=0;i<newHist->nums->n;i++) { 1605 newHist->nums->data. S32[i] = 0;1605 newHist->nums->data.U32[i] = 0; 1606 1606 } 1607 1607 … … 1656 1656 // Allocate the bins, and initialize them to zero. If there are N bounds, 1657 1657 // 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); 1659 1659 newHist->nums->n = newHist->nums->nalloc; 1660 1660 for (i=0;i<newHist->nums->n;i++) { 1661 newHist->nums->data. S32[i] = 0;1661 newHist->nums->data.U32[i] = 0; 1662 1662 } 1663 1663 … … 1705 1705 if (out == NULL) { 1706 1706 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."); 1707 1718 } 1708 1719 -
trunk/psLib/src/math/psStats.c
r1326 r1327 1600 1600 1601 1601 // Allocate the bins, and initialize them to zero. 1602 newHist->nums = psVectorAlloc(n, PS_TYPE_ S32);1602 newHist->nums = psVectorAlloc(n, PS_TYPE_U32); 1603 1603 newHist->nums->n = newHist->nums->nalloc; 1604 1604 for (i=0;i<newHist->nums->n;i++) { 1605 newHist->nums->data. S32[i] = 0;1605 newHist->nums->data.U32[i] = 0; 1606 1606 } 1607 1607 … … 1656 1656 // Allocate the bins, and initialize them to zero. If there are N bounds, 1657 1657 // 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); 1659 1659 newHist->nums->n = newHist->nums->nalloc; 1660 1660 for (i=0;i<newHist->nums->n;i++) { 1661 newHist->nums->data. S32[i] = 0;1661 newHist->nums->data.U32[i] = 0; 1662 1662 } 1663 1663 … … 1705 1705 if (out == NULL) { 1706 1706 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."); 1707 1718 } 1708 1719 -
trunk/psLib/test/dataManip/tst_psHist00.c
r1320 r1327 50 50 51 51 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); 54 54 testStatus = false; 55 55 } 56 myHist->nums->data. S32[i] = 0;56 myHist->nums->data.U32[i] = 0; 57 57 } 58 58 -
trunk/psLib/test/dataManip/tst_psHist01.c
r1320 r1327 56 56 57 57 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); 60 60 testStatus = false; 61 61 } 62 myHist->nums->data. S32[i] = 0;62 myHist->nums->data.U32[i] = 0; 63 63 } 64 64 -
trunk/psLib/test/dataManip/tst_psHist02.c
r1320 r1327 66 66 67 67 myHist = psHistogramAlloc(LOWER, UPPER, numBins); 68 myHist = ps HistogramVector(myHist, myData, NULL, 0);68 myHist = psVectorHistogram(myHist, myData, NULL, 0); 69 69 70 70 for (i=0;i<numBins;i++) { … … 72 72 myHist->bounds->data.F32[i], 73 73 myHist->bounds->data.F32[i+1], 74 myHist->nums->data. S32[i]);74 myHist->nums->data.U32[i]); 75 75 } 76 76 psMemCheckCorruption(1); … … 91 91 92 92 myHist = psHistogramAlloc(LOWER, UPPER, numBins); 93 myHist = ps HistogramVector(myHist, myData, myMask, 1);93 myHist = psVectorHistogram(myHist, myData, myMask, 1); 94 94 95 95 for (i=0;i<numBins;i++) { … … 97 97 myHist->bounds->data.F32[i], 98 98 myHist->bounds->data.F32[i+1], 99 myHist->nums->data. S32[i]);99 myHist->nums->data.U32[i]); 100 100 } 101 101 psMemCheckCorruption(1); … … 112 112 printPositiveTestHeader(stdout, 113 113 "psStats functions", 114 "Calling ps HistogramVector() with various NULL inputs.");114 "Calling psVectorHistogram() with various NULL inputs."); 115 115 116 116 // Verify the return value is null and program execution doesn't stop, 117 117 // if input parameter myHist is null. 118 118 119 myHist2 = ps HistogramVector(NULL, myData, NULL, 0);119 myHist2 = psVectorHistogram(NULL, myData, NULL, 0); 120 120 if (myHist2 != NULL) { 121 121 printf("ERROR: myHist2!=NULL\n"); … … 130 130 131 131 myHist = psHistogramAlloc(LOWER, UPPER, numBins); 132 myHist = ps HistogramVector(myHist, NULL, NULL, 0);132 myHist = psVectorHistogram(myHist, NULL, NULL, 0); 133 133 if (myHist == NULL) { 134 134 printf("ERROR: myHist==NULL\n"); … … 147 147 myData->n = myData->nalloc; 148 148 myHist = psHistogramAlloc(LOWER, UPPER, numBins); 149 myHist = ps HistogramVector(myHist, NULL, NULL, 0);149 myHist = psVectorHistogram(myHist, NULL, NULL, 0); 150 150 if (myHist == NULL) { 151 151 printf("ERROR: myHist==NULL\n"); … … 157 157 printFooter(stdout, 158 158 "psStats functions", 159 "Calling ps HistogramVector() with various NULL inputs.",159 "Calling psVectorHistogram() with various NULL inputs.", 160 160 testStatus); 161 161
Note:
See TracChangeset
for help on using the changeset viewer.
