Changeset 2221 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Oct 27, 2004, 1:31:44 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r2220 r2221 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 2 1:55:09$11 * @version $Revision: 1.76 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 23:31:43 $ 13 13 n * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 #include "psTrace.h" 31 31 #include "psError.h" 32 #include "psAbort.h"33 32 #include "psStats.h" 34 33 #include "psMinimize.h" … … 743 742 // Endure that stats->clipIter is within the proper range. 744 743 if (!((PS_CLIPPED_NUM_ITER_LB <= stats->clipIter) && (stats->clipIter <= PS_CLIPPED_NUM_ITER_UB))) { 745 ps Abort(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);744 psError(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter); 746 745 } 747 746 // Endure that stats->clipSigma is within the proper range. 748 747 if (!((PS_CLIPPED_SIGMA_LB <= stats->clipSigma) && (stats->clipSigma <= PS_CLIPPED_SIGMA_UB))) { 749 ps Abort(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);748 psError(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma); 750 749 } 751 750 // We allocate a temporary mask vector since during the iterative … … 763 762 } 764 763 // 1. Compute the sample median. 765 // NOTE: This seems odd. Verify with IfA that we want to calculate the764 // XXX: This seems odd. Verify with IfA that we want to calculate the 766 765 // median here, not the mean. 767 766 p_psVectorSampleMedian(myVector, maskVector, maskVal, stats); … … 1453 1452 // Calculate the bounds for each bin. 1454 1453 binSize = (upper - lower) / (float)n; 1455 // NOTE: Is the following necessary? It prevents the max data point1454 // XXX: Is the following necessary? It prevents the max data point 1456 1455 // from being in a non-existant bin. 1457 1456 binSize += FLT_EPSILON; … … 1546 1545 PS_VECTOR_CHECK_TYPE(out->bounds, PS_TYPE_F32, NULL); 1547 1546 PS_VECTOR_CHECK_TYPE(out->nums, PS_TYPE_U32, NULL); 1547 PS_INT_CHECK_NON_NEGATIVE(out->nums->n, NULL); 1548 1548 PS_VECTOR_CHECK_NULL(in, NULL); 1549 1549 if (mask != NULL) { … … 1567 1567 } 1568 1568 1569 // NOTE: determine the correct action for a variety of other cases:1570 // in vector has 0 elements, and histogram structure has zero bins.1571 1569 1572 1570 numBins = out->nums->n; … … 1589 1587 binNum = (psS32)((inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize); 1590 1588 1591 // NOTE: This nextif-statement really shouldn't be necessary.1592 // However, d oto numerical lack of precision, we occasionally1589 // XXX: This if-statement really shouldn't be necessary. 1590 // However, due to numerical lack of precision, we occasionally 1593 1591 // produce a binNum outside the range of bins. 1594 1592 if (binNum >= out->nums->n) { … … 1657 1655 // do nothing 1658 1656 } else { 1659 ps Abort(__func__, "unsupported vector type 0x%x\n", in->type.type);1657 psError(__func__, "unsupported vector type 0x%x\n", in->type.type); 1660 1658 } 1661 1659 return (tmp); … … 1674 1672 Returns 1675 1673 The stats structure. 1676 1677 NOTE: The current strategy is to implement everything assuming that all1678 input data is of type PS_TYPE_F32. Once the basic code is in place, we will1679 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64.1680 1674 *****************************************************************************/ 1681 1675 psStats* psVectorStats(psStats* stats, … … 1712 1706 } 1713 1707 // ************************************************************************ 1714 // NOTE: The Stdev calculation requires the mean. Should we assume the1708 // XXX: The Stdev calculation requires the mean. Should we assume the 1715 1709 // mean has already been calculated? Or should we always calculate it? 1716 1710 if (stats->options & PS_STAT_SAMPLE_STDEV) {
Note:
See TracChangeset
for help on using the changeset viewer.
