Changeset 1073 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Jun 23, 2004, 1:00:17 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r1071 r1073 32 32 psStats *stats); 33 33 #endif 34 35 static void histogramFree(psHistogram *myHist); 34 36 35 37 /****************************************************************************** … … 68 70 69 71 /****************************************************************************** 70 psStatsFree(): This routine must free the psStats data structure.71 *****************************************************************************/72 void psStatsFree(psStats *stats)73 {74 psFree(stats);75 }76 77 /******************************************************************************78 72 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure 79 73 with the specifed upper and lower limits, and the specifed number of bins. … … 108 102 // bins, then there are N+1 bounds to those bins. 109 103 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 104 p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree); 110 105 newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32); 111 106 newHist->bounds->n = newHist->bounds->nalloc; … … 160 155 // Allocate memory for the new histogram structure. 161 156 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 157 p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree); 162 158 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 163 159 newHist->bounds->n = newHist->bounds->nalloc; … … 182 178 } 183 179 184 void psHistogramFree(psHistogram *myHist) 185 { 186 psVectorFree(myHist->bounds); 187 psVectorFree(myHist->nums); 188 psFree(myHist); 180 static void histogramFree(psHistogram *myHist) 181 { 182 psFree(myHist->bounds); 183 psFree(myHist->nums); 189 184 } 190 185 … … 618 613 619 614 // Free temporary data buffers. 620 ps StatsFree(stats2);615 psFree(stats2); 621 616 622 617 // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure. … … 688 683 689 684 // Free the temporary data structures. 690 ps VectorFree(unsortedVector);691 ps VectorFree(sortedVector);685 psFree(unsortedVector); 686 psFree(sortedVector); 692 687 } 693 688 … … 775 770 776 771 // Free temporary data buffers. 777 ps StatsFree(stats2);772 psFree(stats2); 778 773 779 774 // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure. … … 840 835 841 836 // Free the temporary data structures. 842 ps VectorFree(unsortedVector);843 ps VectorFree(sortedVector);837 psFree(unsortedVector); 838 psFree(sortedVector); 844 839 // NOTE: This is the 845 840 } … … 1043 1038 } 1044 1039 1045 ps VectorFree(tmpMask);1040 psFree(tmpMask); 1046 1041 } 1047 1042 … … 1125 1120 stats->robustLQ = stats->clippedMean; 1126 1121 } 1127 ps StatsFree(tmpStats);1128 ps HistogramFree(robustHistogram);1122 psFree(tmpStats); 1123 psFree(robustHistogram); 1129 1124 return; 1130 1125 } … … 1200 1195 stats->robustNfit = 0.0; 1201 1196 stats->robustN50 = 0.0; 1202 ps StatsFree(tmpStats);1203 ps HistogramFree(robustHistogram);1197 psFree(tmpStats); 1198 psFree(robustHistogram); 1204 1199 } 1205 1200
Note:
See TracChangeset
for help on using the changeset viewer.
