Changeset 4540 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Jul 12, 2005, 9:12:01 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r4409 r4540 14 14 * stats->binsize 15 15 * 16 * @version $Revision: 1.13 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 6-28 20:17:52$16 * @version $Revision: 1.137 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-07-12 19:12:01 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 41 41 #include "psConstants.h" 42 42 43 #include "ps DataManipErrors.h"43 #include "psErrorText.h" 44 44 45 45 /*****************************************************************************/ … … 77 77 psBool p_psGetStatValue(const psStats* stats, psF64 *value) 78 78 { 79 switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) { 79 // switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) { 80 switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE)) { 80 81 case PS_STAT_SAMPLE_MEAN: 81 82 *value = stats->sampleMean; … … 658 659 x.data.F32 = iMid - (PS_GAUSS_WIDTH * sigma); 659 660 if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) { 660 jMin = p_psVectorBinDisect( robustHistogram->bounds, &x);661 jMin = p_psVectorBinDisect( *(psVector* *)&robustHistogram->bounds, &x); 661 662 if (jMin < 0) { 662 663 psError(PS_ERR_UNEXPECTED_NULL, … … 673 674 x.data.F32 = iMid + (PS_GAUSS_WIDTH * sigma); 674 675 if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) { 675 jMax = p_psVectorBinDisect( robustHistogram->bounds, &x);676 jMax = p_psVectorBinDisect( *(psVector* *)&robustHistogram->bounds, &x); 676 677 if (jMax < 0) { 677 678 psError(PS_ERR_UNEXPECTED_NULL, … … 1705 1706 //Determine id that is okay. 1706 1707 stats->robustMedian = fitQuadraticSearchForYThenReturnX( 1707 robustHistogram->bounds,1708 *(psVector* *)&robustHistogram->bounds, 1708 1709 cumulativeRobustSums, 1709 1710 medianBinNum, … … 1721 1722 //Determine id that is okay. 1722 1723 stats->robustLQ = fitQuadraticSearchForYThenReturnX( 1723 robustHistogram->bounds,1724 *(psVector* *)&robustHistogram->bounds, 1724 1725 cumulativeRobustSums, 1725 1726 LQBinNum, … … 1728 1729 //Determine id that is okay. 1729 1730 stats->robustUQ = fitQuadraticSearchForYThenReturnX( 1730 robustHistogram->bounds,1731 *(psVector* *)&robustHistogram->bounds, 1731 1732 cumulativeRobustSums, 1732 1733 UQBinNum, … … 1812 1813 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 1813 1814 newHist->bounds = psVectorAlloc(n + 1, PS_TYPE_F32); 1814 newHist->bounds->n = newHist->bounds->nalloc;1815 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 1815 1816 1816 1817 // Calculate the bounds for each bin. … … 1859 1860 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 1860 1861 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 1861 newHist->bounds->n = newHist->bounds->nalloc;1862 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 1862 1863 for (i = 0; i < bounds->n; i++) { 1863 1864 newHist->bounds->data.F32[i] = bounds->data.F32[i]; … … 2067 2068 // correct bin number requires a bit more work. 2068 2069 tmpScalar.data.F32 = inF32->data.F32[i]; 2069 binNum = p_psVectorBinDisect( out->bounds, &tmpScalar);2070 binNum = p_psVectorBinDisect( *(psVector* *)&out->bounds, &tmpScalar); 2070 2071 if (binNum < 0) { 2071 2072 psLogMsg(__func__, PS_LOG_WARN,
Note:
See TracChangeset
for help on using the changeset viewer.
