IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 23, 2005, 2:46:45 PM (21 years ago)
Author:
gusciora
Message:

Added additional psTrace messages to psStats.c.

File:
1 edited

Legend:

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

    r5115 r5116  
    1717*
    1818*
    19 *  @version $Revision: 1.148 $ $Name: not supported by cvs2svn $
    20 *  @date $Date: 2005-09-24 00:26:36 $
     19*  @version $Revision: 1.149 $ $Name: not supported by cvs2svn $
     20*  @date $Date: 2005-09-24 00:46:45 $
    2121*
    2222*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8181psBool p_psGetStatValue(const psStats* stats, psF64 *value)
    8282{
     83    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    8384    //    switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
    8485    switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE)) {
    8586    case PS_STAT_SAMPLE_MEAN:
    8687        *value = stats->sampleMean;
     88        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    8789        return true;
    8890
    8991    case PS_STAT_SAMPLE_MEDIAN:
    9092        *value = stats->sampleMedian;
     93        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    9194        return true;
    9295
    9396    case PS_STAT_SAMPLE_STDEV:
    9497        *value = stats->sampleStdev;
     98        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    9599        return true;
    96100
    97101    case PS_STAT_ROBUST_MEAN:
    98102        *value = stats->robustMean;
     103        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    99104        return true;
    100105
    101106    case PS_STAT_ROBUST_MEDIAN:
    102107        *value = stats->robustMedian;
     108        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    103109        return true;
    104110
    105111    case PS_STAT_ROBUST_MODE:
    106112        *value = stats->robustMode;
     113        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    107114        return true;
    108115
    109116    case PS_STAT_ROBUST_STDEV:
    110117        *value = stats->robustStdev;
     118        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    111119        return true;
    112120
    113121    case PS_STAT_CLIPPED_MEAN:
    114122        *value = stats->clippedMean;
     123        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    115124        return true;
    116125
    117126    case PS_STAT_CLIPPED_STDEV:
    118127        *value = stats->clippedStdev;
     128        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    119129        return true;
    120130
    121131    case PS_STAT_MAX:
    122132        *value = stats->max;
     133        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    123134        return true;
    124135
    125136    case PS_STAT_MIN:
    126137        *value = stats->min;
     138        psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    127139        return true;
    128140
    129141    default:
     142        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
    130143        return false;
    131144    }
     
    160173                           psStats* stats)
    161174{
     175    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    162176
    163177    psS32 i = 0;                // Loop index variable
     
    285299    stats->sampleMean = mean;
    286300    if (isnan(mean)) {
     301        psTrace(__func__, 4, "---- %s(-1) end ----\n", __func__);
    287302        return(-1);
    288303    } else {
     304        psTrace(__func__, 4, "---- %s(0) end ----\n", __func__);
    289305        return(0);
    290306    }
     
    304320                    psStats* stats)
    305321{
     322    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    306323    psS32 i = 0;                // Loop index variable
    307324    psF32 max = -PS_MAX_F32;    // The calculated maximum
     
    354371    } else {
    355372        stats->max = NAN;
     373        psTrace(__func__, 4, "---- %s(1) end ----\n", __func__);
    356374        return(1);
    357375    }
     376    psTrace(__func__, 4, "---- %s(0) end ----\n", __func__);
    358377    return(0);
    359378}
     
    369388                    psStats* stats)
    370389{
     390    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    371391    psS32 i = 0;                // Loop index variable
    372392    psF32 min = PS_MAX_F32;   // The calculated maximum
     
    419439    } else {
    420440        stats->min = NAN;
     441        psTrace(__func__, 4, "---- %s(1) end ----\n", __func__);
    421442        return(1);
    422443    }
     444    psTrace(__func__, 4, "---- %s(0) end ----\n", __func__);
    423445    return(0);
    424446}
     
    435457                             psStats* stats)
    436458{
     459    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    437460    PS_ASSERT_VECTOR_NON_NULL(myVector, -1);
    438461    PS_ASSERT_PTR_NON_NULL(stats, -1);
     
    445468                        (stats->min <= myVector->data.F32[i]) &&
    446469                        (myVector->data.F32[i] <= stats->max)) {
     470                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    447471                    return(true);
    448472                }
     
    452476                if ((stats->min <= myVector->data.F32[i]) &&
    453477                        (myVector->data.F32[i] <= stats->max)) {
     478                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    454479                    return(true);
    455480                }
     
    460485            for (i = 0; i < myVector->n; i++) {
    461486                if (!(maskVal & maskVector->data.U8[i])) {
     487                    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    462488                    return(true);
    463489                }
     
    465491        } else {
    466492            if (myVector->n > 0) {
     493                psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    467494                return(true);
    468495            }
    469496        }
    470497    }
     498    psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
    471499    return(false);
    472500}
     
    483511                        psStats* stats)
    484512{
     513    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    485514    PS_ASSERT_VECTOR_NON_NULL(myVector, -1);
    486515    PS_ASSERT_PTR_NON_NULL(stats, -1);
     
    517546    }
    518547
     548    psTrace(__func__, 4, "---- %s(%d) end ----\n", __func__, numData);
    519549    return (numData);
    520550}
     
    532562                            psStats* stats)
    533563{
     564    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    534565    psVector* unsortedVector = NULL;    // Temporary vector
    535566    psVector* sortedVector = NULL;      // Temporary vector
     
    598629                false,
    599630                PS_ERRORTEXT_psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM);
     631        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
    600632        return(false);
    601633    }
     
    615647
    616648    // Return "true" on success.
     649    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    617650    return(true);
    618651}
     
    631664                                       psF32 sigma)
    632665{
    633     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
    634     psTrace(__func__, 6, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
     666    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     667    psTrace(__func__, 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
    635668    PS_ASSERT_PTR_NON_NULL(histogram, NULL);
    636669    PS_ASSERT_PTR_NON_NULL(histogram->bounds, NULL);
    637670    PS_ASSERT_PTR_NON_NULL(histogram->nums, NULL);
     671    if (psTraceGetLevel(__func__) >= 8) {
     672        PS_VECTOR_PRINT_F32(histogram->nums);
     673    }
    638674
    639675    psS32 numBins = histogram->nums->n;
     
    668704                            false,
    669705                            PS_ERRORTEXT_psStats_STATS_VECTOR_BIN_DISECT_PROBLEM);
    670                     psTrace(__func__, 3, "---- %s(NULL) end ----\n", __func__);
     706                    psTrace(__func__, 4, "---- %s(NULL) end ----\n", __func__);
    671707                    return(NULL);
    672708                }
     
    684720                            false,
    685721                            PS_ERRORTEXT_psStats_STATS_VECTOR_BIN_DISECT_PROBLEM);
    686                     psTrace(__func__, 3, "---- %s(NULL) end ----\n", __func__);
     722                    psTrace(__func__, 4, "---- %s(NULL) end ----\n", __func__);
    687723                    return(NULL);
    688724                }
     
    745781    }
    746782
    747     psTrace(__func__, 3, "---- %s(psVector) end ----\n", __func__);
     783    if (psTraceGetLevel(__func__) >= 8) {
     784        PS_VECTOR_PRINT_F32(smooth);
     785    }
     786    psTrace(__func__, 4, "---- %s(psVector) end ----\n", __func__);
    748787    return(smooth);
    749788}
     
    766805                               psStats* stats)
    767806{
     807    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    768808    psVector* unsortedVector = NULL;    // Temporary vector
    769809    psVector* sortedVector = NULL;      // Temporary vector
     
    820860                false,
    821861                PS_ERRORTEXT_psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM);
     862        psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
    822863        return(false);
    823864    }
     
    832873    psFree(unsortedVector);
    833874    psFree(sortedVector);
     875    psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
    834876    return(true);
    835877}
     
    853895                              psStats* stats)
    854896{
     897    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    855898    psS32 i = 0;                  // Loop index variable
    856899    psS32 countInt = 0;           // # of data points being used
     
    870913        stats->sampleStdev = NAN;
    871914        psLogMsg(__func__, PS_LOG_WARN, "WARNING: p_psVectorSampleStdev(): p_psVectorSampleMean() reported a NAN mean.\n");
     915        psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    872916        return;
    873917    }
     
    928972        stats->sampleStdev = sqrtf((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1));
    929973    }
     974    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    930975}
    931976/******************************************************************************
     
    947992                           psStats* stats)
    948993{
     994    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    949995    psS32 i = 0;                  // Loop index variable
    950996    psS32 countInt = 0;           // # of data points being used
     
    9671013        stats->sampleStdev = NAN;
    9681014        psLogMsg(__func__, PS_LOG_WARN, "WARNING: p_psVectorSampleStdev(): p_psVectorSampleMean() reported a NAN mean.\n");
     1015        psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    9691016        return;
    9701017    }
     
    10471094        }
    10481095    }
     1096    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    10491097}
    10501098
     
    10751123                             psStats* stats)
    10761124{
     1125    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    10771126    psF32 clippedMean = 0.0;    // self-explanatory
    10781127    psF32 clippedStdev = 0.0;   // self-explanatory
     
    11211170        stats->clippedMean = NAN;
    11221171        stats->clippedStdev = NAN;
     1172        psTrace(__func__, 4, "---- %s(-2) end ----\n", __func__);
    11231173        return(-2);
    11241174    }
     
    11301180        stats->clippedMean = NAN;
    11311181        stats->clippedStdev = NAN;
     1182        psTrace(__func__, 4, "---- %s(-2) end ----\n", __func__);
    11321183        return(-2);
    11331184    }
     
    11841235
    11851236    psFree(tmpMask);
     1237    psTrace(__func__, 4, "---- %s(%d) end ----\n", __func__, rc);
    11861238    return(rc);
    11871239}
     
    12571309                              psF64 outHigh)
    12581310{
     1311    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    12591312    switch (myData->type.type) {
    12601313    case PS_TYPE_U8:
     
    12961349        break;
    12971350    }
     1351    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    12981352}
    12991353
     
    13151369                       psF32 getThisValue)
    13161370{
     1371    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    13171372    PS_ASSERT_POLY_NON_NULL(myPoly, NAN);
    13181373    PS_ASSERT_FLOAT_LARGER_THAN(rangeHigh, rangeLow, NAN);
     
    13241379    if (!((fLo <= getThisValue) && (fHi >= getThisValue))) {
    13251380        psError(PS_ERR_UNKNOWN, true, "The requested y value (%f) does not fall within the specified range (%f to %f)\n", getThisValue, fLo, fHi);
     1381        psTrace(__func__, 4, "---- %s(NAN) end ----\n", __func__);
    13261382        return(NAN);
    13271383    }
     
    13511407        numIterations++;
    13521408    }
     1409    psTrace(__func__, 4, "---- %s(%f) end ----\n", __func__, midpoint);
    13531410    return (midpoint);
    13541411}
     
    13771434                                        psF32 yVal)
    13781435{
    1379     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
    1380     psTrace(__func__, 6, "binNum, yVal is (%d, %f)\n", binNum, yVal);
     1436    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1437    psTrace(__func__, 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
    13811438    if (psTraceGetLevel(__func__) >= 8) {
    13821439        PS_VECTOR_PRINT_F32(xVec);
     
    14241481                psFree(y);
    14251482                psFree(yErr);
    1426                 psTrace(__func__, 3, "---- %s(NAN) end ----\n", __func__);
     1483                psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
    14271484                return(NAN);
    14281485            }
     
    14401497                psFree(y);
    14411498                psFree(yErr);
    1442                 psTrace(__func__, 3, "---- %s(NAN) end ----\n", __func__);
     1499                psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
    14431500                return(NAN);
    14441501            }
     
    14661523            psFree(y);
    14671524            psFree(yErr);
    1468             psTrace(__func__, 3, "---- %s(NAN) end ----\n", __func__);
     1525            psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
    14691526            return(NAN);
    14701527        }
     
    14891546            psFree(y);
    14901547            psFree(yErr);
    1491             psTrace(__func__, 3, "---- %s(NAN) end ----\n", __func__);
     1548            psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
    14921549            return(NAN);
    14931550        }
     
    15171574    psFree(yErr);
    15181575
    1519     psTrace(__func__, 3, "---- %s(%f) end ----\n", __func__, tmpFloat);
     1576    psTrace(__func__, 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
    15201577    return(tmpFloat);
    15211578}
     
    15261583psVector *PsVectorDup(psVector *in)
    15271584{
     1585    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    15281586    PS_ASSERT_VECTOR_NON_NULL(in, NULL);
    15291587    psVector *out = psVectorAlloc(in->n, in->type.type);
     
    15391597    } else {
    15401598        psError(PS_ERR_UNKNOWN, true, "Unallowable vector type.\n");
     1599        psTrace(__func__, 4, "---- %s(NULL) end ----\n", __func__);
    15411600        return(NULL);
    15421601    }
     1602    psTrace(__func__, 4, "---- %s(psVector) end ----\n", __func__);
    15431603    return(out);
    15441604}
    1545 
    1546 /******************************************************************************
    1547 XXX: This function need to be written.  Actually, it simply needs to be
    1548 retrieved from the CVS repository, since it was written earlier, then
    1549 discarded.  At present, it was deleted from the CVS repository, so we might
    1550 have to retrieve it from tape.
    1551 *****************************************************************************/
    1552 psVector *Fit1DGaussian(psVector *x, psVector*y)
    1553 {
    1554     psError(PS_ERR_UNKNOWN, true, "This code has not been implemented yet.\n");
    1555     // XXX: This function was previously part of psStats.c, was removed, was
    1556     // purged from CVS, and now needs to be retrieved from tape.
    1557 
    1558     return(NULL);
    1559 }
    1560 
    1561 
    15621605
    15631606/******************************************************************************
     
    15681611                              const psVector *coords)
    15691612{
     1613    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    15701614    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
    15711615    PS_ASSERT_VECTOR_SIZE(params, 2, NAN);
     
    15931637    // printf("f(x, mean, stdev) = f(%.2f %.2f %.2f) is %.2f\n", x, mean, stdev, psGaussian(x, mean, stdev, false));
    15941638
     1639    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    15951640    return(psGaussian(x, mean, stdev, false));
    15961641}
     
    16021647                     psF32 y)
    16031648{
    1604     // printf("HEY: LinInterpolate(%.2f %.2f %.2f %.2f %.2f)\n", x0, x1, y0, y1, y);
     1649    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1650    psTrace(__func__, 5, "LinInterpolate(%.2f %.2f %.2f %.2f %.2f)\n", x0, x1, y0, y1, y);
    16051651    if (y0 == y1) {
    16061652        psLogMsg(__func__, PS_LOG_WARN, "WARNING: y0 == y1.  Cannot interpolate.  Returning NaN.\n");
    16071653        return(NAN);
    16081654    }
    1609     // printf("HMMM: LinInterpolate(%.2f %.2f %.2f %.2f %.2f %.2f)\n", x0, x1, y0, y1, y, 0 + y * (x1 - x0) / (y1 - y0));
    1610 
     1655
     1656    psTrace(__func__, 4, "---- %s() end ----\n", __func__);
    16111657    return(x0 + y * (x1 - x0) / (y1 - y0));
    16121658}
    16131659
     1660// XXX: Get rid of this, or put it in psConstants.h
    16141661void PRINT_LEAKS()
    16151662{
     
    16351682
    16361683/******************************************************************************
    1637 p_psVectorRobustStats(myVector, maskVector, maskVal, stats): this procedure
    1638 calculates a variety of robust stat measures:
    1639     PS_STAT_ROBUST_MEAN
    1640     PS_STAT_ROBUST_MEDIAN
    1641     PS_STAT_ROBUST_MODE
    1642     PS_STAT_ROBUST_STDEV
    1643     PS_STAT_ROBUST_QUARTILE
    1644 I have included all that computation in a single function, as opposed to
    1645 breaking it across several functions for one primary reason:  they all require
    1646 the same basic initial processing steps (calculate the histogram, etc.).
    1647  
    1648 Inputs
    1649     myVector
    1650     maskVector
    1651     maskVal
    1652     stats
    1653 Returns
    1654     0 on success.
    1655  
    1656 XXX: Check for errors in psLib routines that we call.
    1657 *****************************************************************************/
    1658 
    1659 
    1660 /******************************************************************************
    1661  
    1662 p_psVectorRobustStatsNew(myVector, maskVector, maskVal, stats): This is the new
     1684p_psVectorRobustStats(myVector, maskVector, maskVal, stats): This is the new
    16631685version of the robust stats routine.
    16641686 
     
    16741696 
    16751697XXX: Check for errors in psLib routines that we call.
     1698 
     1699XXX: Review and ensure that all memory is free'ed at premature exits.
    16761700*****************************************************************************/
    1677 psS32 p_psVectorRobustStatsNew(const psVector* myVector,
    1678                                const psVector* errors,
    1679                                const psVector* maskVector,
    1680                                psU32 maskVal,
    1681                                psStats* stats)
    1682 {
    1683     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     1701psS32 p_psVectorRobustStats(const psVector* myVector,
     1702                            const psVector* errors,
     1703                            const psVector* maskVector,
     1704                            psU32 maskVal,
     1705                            psStats* stats)
     1706{
     1707    psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    16841708    if (psTraceGetLevel(__func__) >= 8) {
    16851709        PS_VECTOR_PRINT_F32(myVector);
     
    17221746            psFree(tmpMaskVec);
    17231747            psFree(tmpScalar);
    1724             psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     1748            psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    17251749            return(1);
    17261750        }
     
    17491773            psFree(tmpScalar);
    17501774
    1751             psTrace(__func__, 3, "---- %s(0) end  ----\n", __func__);
     1775            psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
    17521776            return(0);
    17531777        }
     
    18071831                psFree(tmpScalar);
    18081832                psFree(tmpMaskVec);
    1809                 psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     1833                psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    18101834                return(1);
    18111835            }
     
    18621886            psFree(tmpScalar);
    18631887            psFree(tmpMaskVec);
    1864             psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     1888            psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    18651889            return(1);
    18661890        }
     
    19731997        psFree(tmpScalar);
    19741998        psFree(tmpMaskVec);
    1975         psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     1999        psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    19762000        return(1);
    19772001    }
     
    20312055        psFree(tmpScalar);
    20322056        psFree(tmpMaskVec);
    2033         psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     2057        psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    20342058        return(1);
    20352059    }
     
    20832107        psFree(cumulativeRobustHistogram);
    20842108        psFree(tmpStatsMinMax);
    2085         psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     2109        psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    20862110        return(1);
    20872111    }
     
    21792203        psFree(params);
    21802204        psFree(tmpMaskVec);
    2181         psTrace(__func__, 3, "---- %s(1) end  ----\n", __func__);
     2205        psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
    21822206        return(1);
    21832207    }
     
    22132237    psFree(robustHistogram);
    22142238
    2215     psTrace(__func__, 3, "---- %s(0) end  ----\n", __func__);
     2239    psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
    22162240    return(0);
    22172241}
     
    22432267psStats* psStatsAlloc(psStatsOptions options)
    22442268{
     2269    psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
    22452270    psStats* newStruct = NULL;
    22462271
     
    22702295    newStruct->options = options;
    22712296
     2297    psTrace(__func__, 3, "---- %s(psStats) end  ----\n", __func__);
    22722298    return (newStruct);
    22732299}
     
    22952321psHistogram* psHistogramAlloc(float lower, float upper, int n)
    22962322{
     2323    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
     2324    psTrace(__func__, 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
    22972325    PS_ASSERT_INT_POSITIVE(n, NULL);
    22982326    PS_FLOAT_COMPARE(lower, upper, NULL);
     
    23292357    newHist->uniform = true;
    23302358
     2359    psTrace(__func__, 3, "---- %s(psHistogram) end  ----\n", __func__);
    23312360    return (newHist);
    23322361}
     
    23432372psHistogram* psHistogramAllocGeneric(const psVector* bounds)
    23442373{
     2374    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
    23452375    PS_ASSERT_VECTOR_NON_NULL(bounds, NULL);
    23462376    PS_ASSERT_VECTOR_TYPE(bounds, PS_TYPE_F32, NULL);
     
    23712401    newHist->uniform = false;
    23722402
     2403    psTrace(__func__, 3, "---- %s(psHistogram) end  ----\n", __func__);
    23732404    return (newHist);
    23742405}
     
    24062437                          psF32 error)
    24072438{
     2439    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
    24082440    PS_ASSERT_PTR_NON_NULL(out, -1);
    24092441    PS_ASSERT_PTR_NON_NULL(out->bounds, -1);
     
    24442476    if (boxcarLeftBinNum == boxcarRightBinNum) {
    24452477        out->nums->data.F32[binNum]+= 1.0;
     2478        psTrace(__func__, 3, "---- %s(0) end  ----\n", __func__);
    24462479        return(0);
    24472480    }
     
    24712504    // Return 0 on success.
    24722505    //
     2506    psTrace(__func__, 3, "---- %s(0) end  ----\n", __func__);
    24732507    return(0);
    24742508}
     
    24952529                               psMaskType maskVal)
    24962530{
     2531    psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
    24972532    PS_ASSERT_PTR_NON_NULL(out, NULL);
    24982533    PS_ASSERT_VECTOR_NON_NULL(out->bounds, NULL);
     
    25952630        psFree(errorsF32);
    25962631    }
     2632
     2633    psTrace(__func__, 3, "---- %s(psHistogram) end  ----\n", __func__);
    25972634    return (out);
    25982635}
     
    26102647psVector* p_psConvertToF32(psVector* in)
    26112648{
     2649    psTrace(__func__, 4,"---- %s() begin  ----\n", __func__);
    26122650    if (in == NULL) {
    26132651        return(NULL);
     
    26702708                strType);
    26712709    }
     2710
     2711    psTrace(__func__, 4,"---- %s(psVector) end  ----\n", __func__);
    26722712    return (tmp);
    26732713}
     
    26922732                       psMaskType maskVal)
    26932733{
     2734    psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
    26942735    PS_ASSERT_PTR_NON_NULL(stats, NULL);
    26952736    PS_ASSERT_VECTOR_NON_NULL(in, stats);
     
    27542795    // Since the various robust stats quantities share much computation, they
    27552796    // are grouped together in a single private function:
    2756     // p_psVectorRobustStatsNew()
     2797    // p_psVectorRobustStats()
    27572798    if ((stats->options & PS_STAT_ROBUST_MEAN) ||
    27582799            (stats->options & PS_STAT_ROBUST_MEDIAN) ||
     
    27602801            (stats->options & PS_STAT_ROBUST_STDEV) ||
    27612802            (stats->options & PS_STAT_ROBUST_QUARTILE)) {
    2762         if (0 != p_psVectorRobustStatsNew(inF32, errorsF32, mask, maskVal, stats)) {
     2803        if (0 != p_psVectorRobustStats(inF32, errorsF32, mask, maskVal, stats)) {
    27632804            psError(PS_ERR_UNKNOWN, false,
    27642805                    PS_ERRORTEXT_psStats_STATS_FAILED);
     
    27672808            // XXX: If so, do it for other funcs?
    27682809            psFree(stats);
     2810            psTrace(__func__, 3,"---- %s(NULL) end  ----\n", __func__);
    27692811            return(NULL);
    27702812        }
     
    28082850        psFree(errorsF32);
    28092851    }
     2852    psTrace(__func__, 3,"---- %s(psStats) end  ----\n", __func__);
    28102853    return (stats);
    28112854}
Note: See TracChangeset for help on using the changeset viewer.