Changeset 6193 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Jan 25, 2006, 2:31:19 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r6186 r6193 14 14 * stats->binsize 15 15 * 16 * 17 * 18 * 19 * @version $Revision: 1.160 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2006-01-23 22:25:31 $ 16 * @version $Revision: 1.161 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-01-26 00:31:19 $ 21 18 * 22 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 574 571 nValues = p_psVectorNValues(myVector, maskVector, maskVal, stats); 575 572 576 // XXX: Is a warning message appropriate? What value should we set the577 // sampleMedian to? Should we generate an error?578 573 if (nValues <= 0) { 579 574 psLogMsg(__func__, PS_LOG_WARN, "WARNING: p_psVectorSampleMedian(): no valid elements in input vector.\n"); … … 784 779 Returns 785 780 NULL 786 787 XXX: Use static vectors.788 781 *****************************************************************************/ 789 782 bool p_psVectorSampleQuartiles(const psVector* myVector, … … 1133 1126 p_psMemSetPersistent(statsTmp, true); 1134 1127 } else { 1135 // XXXEAM : initialize structure if already allocated1128 // EAM : initialize structure if already allocated 1136 1129 statsTmp->sampleMean = NAN; 1137 1130 statsTmp->sampleMedian = NAN; … … 1226 1219 // Otherwise, use the new results and continue. 1227 1220 if (isnan(statsTmp->sampleMean) || isnan(statsTmp->sampleStdev)) { 1228 // Exit loop. XXX: Should wethrow an error/warning here?1221 // Exit loop. XXX: throw an error/warning here? 1229 1222 iter = stats->clipIter; 1230 1223 rc = -1; … … 1487 1480 // 1488 1481 // XXX: This routine should probably be rewritten in a more general fashion 1489 // so that the follo iwng checks are not necessary.1482 // so that the following checks are not necessary. 1490 1483 // 1491 1484 if (y->data.F64[0] < y->data.F64[1]) { … … 1591 1584 psTrace(__func__, 5, "---- %s(%f) end ----\n", __func__, tmpFloat); 1592 1585 return(tmpFloat); 1593 }1594 1595 /*****************************************************************************1596 XXX: Is there a psLib function for this?1597 *****************************************************************************/1598 psVector *PsVectorDup(psVector *in)1599 {1600 psTrace(__func__, 4, "---- %s() begin ----\n", __func__);1601 PS_ASSERT_VECTOR_NON_NULL(in, NULL);1602 psVector *out = psVectorAlloc(in->n, in->type.type);1603 1604 if (in->type.type == PS_TYPE_F32) {1605 for (psS32 i = 0 ; i < in->n ; i++) {1606 out->data.F32[i] = in->data.F32[i];1607 }1608 } else if (in->type.type == PS_TYPE_F64) {1609 for (psS32 i = 0 ; i < in->n ; i++) {1610 out->data.F64[i] = in->data.F64[i];1611 }1612 } else {1613 psError(PS_ERR_UNKNOWN, true, "Unallowable vector type.\n");1614 psTrace(__func__, 4, "---- %s(NULL) end ----\n", __func__);1615 return(NULL);1616 }1617 psTrace(__func__, 4, "---- %s(psVector) end ----\n", __func__);1618 return(out);1619 1586 } 1620 1587 … … 1832 1799 // ADD: Step 3. 1833 1800 // Interpolate to the exact 50% position: this is the robust histogram median. 1834 // XXX: Check for errors here!1801 // XXX: Check return codes. 1835 1802 // 1836 1803 stats->robustMedian = fitQuadraticSearchForYThenReturnX( … … 2640 2607 2641 2608 XXX: Should the default data type be F64? Since we are buying Opterons... 2609 2610 XXX: Use psLib functions instead. 2642 2611 *****************************************************************************/ 2643 2612 psVector* p_psConvertToF32(psVector* in)
Note:
See TracChangeset
for help on using the changeset viewer.
