IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2004, 1:31:44 PM (22 years ago)
Author:
gusciora
Message:

Parameter checking for the psCOord.c file.

File:
1 edited

Legend:

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

    r2220 r2221  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.75 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-27 21:55:09 $
     11 *  @version $Revision: 1.76 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-27 23:31:43 $
    1313n *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3030#include "psTrace.h"
    3131#include "psError.h"
    32 #include "psAbort.h"
    3332#include "psStats.h"
    3433#include "psMinimize.h"
     
    743742    // Endure that stats->clipIter is within the proper range.
    744743    if (!((PS_CLIPPED_NUM_ITER_LB <= stats->clipIter) && (stats->clipIter <= PS_CLIPPED_NUM_ITER_UB))) {
    745         psAbort(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);
     744        psError(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);
    746745    }
    747746    // Endure that stats->clipSigma is within the proper range.
    748747    if (!((PS_CLIPPED_SIGMA_LB <= stats->clipSigma) && (stats->clipSigma <= PS_CLIPPED_SIGMA_UB))) {
    749         psAbort(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);
     748        psError(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);
    750749    }
    751750    // We allocate a temporary mask vector since during the iterative
     
    763762    }
    764763    // 1. Compute the sample median.
    765     // NOTE: This seems odd.  Verify with IfA that we want to calculate the
     764    // XXX: This seems odd.  Verify with IfA that we want to calculate the
    766765    // median here, not the mean.
    767766    p_psVectorSampleMedian(myVector, maskVector, maskVal, stats);
     
    14531452    // Calculate the bounds for each bin.
    14541453    binSize = (upper - lower) / (float)n;
    1455     // NOTE: Is the following necessary? It prevents the max data point
     1454    // XXX: Is the following necessary? It prevents the max data point
    14561455    // from being in a non-existant bin.
    14571456    binSize += FLT_EPSILON;
     
    15461545    PS_VECTOR_CHECK_TYPE(out->bounds, PS_TYPE_F32, NULL);
    15471546    PS_VECTOR_CHECK_TYPE(out->nums, PS_TYPE_U32, NULL);
     1547    PS_INT_CHECK_NON_NEGATIVE(out->nums->n, NULL);
    15481548    PS_VECTOR_CHECK_NULL(in, NULL);
    15491549    if (mask != NULL) {
     
    15671567    }
    15681568
    1569     // NOTE: determine the correct action for a variety of other cases:
    1570     // in vector has 0 elements, and histogram structure has zero bins.
    15711569
    15721570    numBins = out->nums->n;
     
    15891587                    binNum = (psS32)((inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize);
    15901588
    1591                     // NOTE: This next if-statement really shouldn't be necessary.
    1592                     // However, do to numerical lack of precision, we occasionally
     1589                    // XXX: This if-statement really shouldn't be necessary.
     1590                    // However, due to numerical lack of precision, we occasionally
    15931591                    // produce a binNum outside the range of bins.
    15941592                    if (binNum >= out->nums->n) {
     
    16571655        // do nothing
    16581656    } else {
    1659         psAbort(__func__, "unsupported vector type 0x%x\n", in->type.type);
     1657        psError(__func__, "unsupported vector type 0x%x\n", in->type.type);
    16601658    }
    16611659    return (tmp);
     
    16741672Returns
    16751673    The stats structure.
    1676  
    1677 NOTE: The current strategy is to implement everything assuming that all
    1678 input data is of type PS_TYPE_F32.  Once the basic code is in place, we will
    1679 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64.
    16801674 *****************************************************************************/
    16811675psStats* psVectorStats(psStats* stats,
     
    17121706    }
    17131707    // ************************************************************************
    1714     // NOTE: The Stdev calculation requires the mean.  Should we assume the
     1708    // XXX: The Stdev calculation requires the mean.  Should we assume the
    17151709    // mean has already been calculated? Or should we always calculate it?
    17161710    if (stats->options & PS_STAT_SAMPLE_STDEV) {
Note: See TracChangeset for help on using the changeset viewer.