IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23327


Ignore:
Timestamp:
Mar 15, 2009, 10:54:36 AM (17 years ago)
Author:
eugene
Message:

skip inf/nan in input vectors for sample mean, stdev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psStats.c

    r21183 r23327  
    199199    for (long i = 0; i < numData; i++) {
    200200        // Check if the data is with the specified range
     201        if (!isfinite(data[i]))
     202            continue;
    201203        if (useRange && (data[i] < stats->min))
    202204            continue;
     
    322324    // into the temporary vectors.
    323325    for (long i = 0; i < inVector->n; i++) {
     326        if (!isfinite(input[i]))
     327            continue;
    324328        if (useRange && (input[i] < stats->min))
    325329            continue;
     
    420424    for (long i = 0; i < myVector->n; i++) {
    421425        // Check if the data is with the specified range
     426        if (!isfinite(data[i]))
     427            continue;
    422428        if (useRange && (data[i] < stats->min)) {
    423429            continue;
     
    501507    for (long i = 0; i < myVector->n; i++) {
    502508        // Check if the data is with the specified range
     509        if (!isfinite(data[i]))
     510            continue;
    503511        if (useRange && (data[i] < stats->min)) {
    504512            continue;
Note: See TracChangeset for help on using the changeset viewer.