IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2007, 5:24:38 PM (19 years ago)
Author:
Paul Price
Message:

Fixing up warnings/errors.

File:
1 edited

Legend:

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

    r12691 r12692  
    1313 * use ->min and ->max (PS_STAT_USE_RANGE)
    1414 *
    15  *  @version $Revision: 1.206 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2007-03-30 02:53:26 $
     15 *  @version $Revision: 1.207 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-03-30 03:24:38 $
    1717 *
    1818 *  Copyright 2006 IfA, University of Hawaii
    1919 */
     20
     21
     22// Note: choice of return values in many places is quite grey.  For example, calculating the sample standard
     23// deviation: here it's an error to get an array of size zero, but it's not an error to get an array of size
     24// unity, even though the standard deviation is not defined in that case (NAN).
    2025
    2126#ifdef HAVE_CONFIG_H
     
    112117        RESULT = Xt; }
    113118
     119#define TRACE "psLib.math"
     120
    114121/*****************************************************************************/
    115122/* TYPE DEFINITIONS                                                          */
     
    171178                                 psStats* stats)
    172179{
    173     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     180    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    174181
    175182    long count = 0;                     // Number of points contributing to this mean
     
    211218    if (isnan(mean)) {
    212219        // XXX raise an error here?
    213         psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    214         return false;
     220        psTrace(TRACE, 4, "---- %s(false) end ----\n", __func__);
     221        return true;
    215222    }
    216223
    217224    stats->results |= PS_STAT_SAMPLE_MEAN;
    218     psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     225    psTrace(TRACE, 4, "---- %s(true) end ----\n", __func__);
    219226    return true;
    220227}
     
    239246        )
    240247{
    241     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     248    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    242249    psF32 max = -PS_MAX_F32;            // The calculated maximum
    243250    psF32 min = PS_MAX_F32;             // The calculated minimum
     
    273280        stats->results |= PS_STAT_MAX;
    274281    }
    275     psTrace("psLib.math", 4, "---- %s(%d) end ----\n", __func__, numValid);
     282    psTrace(TRACE, 4, "---- %s(%d) end ----\n", __func__, numValid);
    276283    return numValid;
    277284}
     
    287294                               psStats* stats)
    288295{
    289     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     296    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    290297
    291298    bool useRange = stats->options & PS_STAT_USE_RANGE;
     
    320327        stats->sampleLQ = NAN;
    321328        stats->sampleMedian = NAN;
    322         return false;
     329        return true;
    323330    }
    324331
     
    330337        stats->sampleLQ = NAN;
    331338        stats->sampleMedian = NAN;
    332         return false;
     339        return true;
    333340    }
    334341
     
    351358
    352359    // Return "true" on success.
    353     psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     360    psTrace(TRACE, 4, "---- %s(true) end ----\n", __func__);
    354361    return true;
    355362}
     
    382389                                  psStats* stats)
    383390{
    384     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     391    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    385392
    386393    // This procedure requires the mean.  If it has not been already
     
    392399    // If the mean is NAN, then generate a warning and set the stdev to NAN.
    393400    if (isnan(stats->sampleMean)) {
     401        psTrace(TRACE, 5, "WARNING: vectorSampleStdev(): sample mean is NAN.  Setting stats->sampleStdev = NAN.\n");
    394402        stats->sampleStdev = NAN;
    395         psWarning("WARNING: vectorSampleStdev(): vectorSampleMean() reported a NAN mean.\n");
    396         psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    397         return false;
     403        return true;
    398404    }
    399405
     
    411417    for (long i = 0; i < myVector->n; i++) {
    412418        // Check if the data is with the specified range
    413         if (useRange && (data[i] < stats->min))
     419        if (useRange && (data[i] < stats->min)) {
    414420            continue;
    415         if (useRange && (data[i] > stats->max))
     421        }
     422        if (useRange && (data[i] > stats->max)) {
    416423            continue;
    417         if (maskData && (maskData[i] & maskVal))
     424        }
     425        if (maskData && (maskData[i] & maskVal)) {
    418426            continue;
     427        }
    419428
    420429        double diff = data[i] - mean;
     
    428437
    429438    if (count == 0) {
     439        // This is an ambiguous case: error or not?
     440        // It's not an empty array (that's been asserted on previously), but everything's been masked out.
     441        // Assume that the user knows what he's doing when he masks out everything --> no error.
    430442        stats->sampleStdev = NAN;
    431         psWarning("WARNING: vectorSampleStdev(): no valid psVector elements (%ld).  Setting stats->sampleStdev = NAN.\n", count);
    432         return false;
     443        psTrace(TRACE, 5, "WARNING: vectorSampleStdev(): no valid psVector elements (%ld).  Setting stats->sampleStdev = NAN.\n", count);
     444        return true;
    433445    }
    434446    if (count == 1) {
    435447        stats->sampleStdev = 0.0;
    436         psWarning("WARNING: vectorSampleStdev(): only one valid psVector elements (%ld).  Setting stats->sampleStdev = 0.0.\n", count);
    437         return false;
     448        psTrace(TRACE, 5, "WARNING: vectorSampleStdev(): only one valid psVector elements (%ld).  Setting stats->sampleStdev = 0.0.\n", count);
     449        return true;
    438450    }
    439451
     
    445457    stats->results |= PS_STAT_SAMPLE_STDEV;
    446458
    447     psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     459    psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    448460
    449461    return true;
     
    469481    )
    470482{
    471     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    472     psTrace("psLib.math", 4, "Trace level is %d\n", psTraceGetLevel("psLib.math"));
     483    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
     484    psTrace(TRACE, 4, "Trace level is %d\n", psTraceGetLevel("psLib.math"));
    473485
    474486    // Ensure that stats->clipIter is within the proper range.
     
    502514    vectorSampleMedian(myVector, tmpMask, maskVal, stats);
    503515    if (isnan(stats->sampleMedian)) {
    504         psWarning("Call to vectorSampleMedian returned NAN\n");
    505         psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
     516        psTrace(TRACE, 5, "Call to vectorSampleMedian returned NAN\n");
     517        psTrace(TRACE, 4, "---- %s(false) end ----\n", __func__);
    506518        psFree(tmpMask);
    507519        return false;
    508520    }
    509     psTrace("psLib.math", 6, "The initial sample median is %f\n", stats->sampleMedian);
     521    psTrace(TRACE, 6, "The initial sample median is %f\n", stats->sampleMedian);
    510522
    511523    // 2. Compute the sample standard deviation, which we save for output
    512524    vectorSampleStdev(myVector, errors, tmpMask, maskVal, stats);
    513525    if (isnan(stats->sampleStdev)) {
    514         psWarning("Call to vectorSampleStdev returned NAN\n");
    515         psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
     526        psTrace(TRACE, 5, "Call to vectorSampleStdev returned NAN\n");
     527        psTrace(TRACE, 4, "---- %s(false) end ----\n", __func__);
    516528        psFree(tmpMask);
    517529        return false;
    518530    }
    519     psTrace("psLib.math", 6, "The initial sample stdev is %f\n", stats->sampleStdev);
     531    psTrace(TRACE, 6, "The initial sample stdev is %f\n", stats->sampleStdev);
    520532
    521533    // 3. Use the sample median as the first estimator of the mean X.
     
    530542    for (int iter = 0; iter < stats->clipIter && clipped; iter++) {
    531543        clipped = false;
    532         psTrace("psLib.math", 6, "------------ Iteration %d ------------\n", iter);
     544        psTrace(TRACE, 6, "------------ Iteration %d ------------\n", iter);
    533545        // a) Exclude all values x_i for which |x_i - x| > K * stdev
    534546        if (errors) {
     
    538550                    fabsf(myVector->data.F32[j] - clippedMean) > stats->clipSigma * errors->data.F32[j]) {
    539551                    tmpMask->data.U8[j] = 0xff;
    540                     psTrace("psLib.math", 10, "Clipped %ld: %f +/- %f\n", j,
     552                    psTrace(TRACE, 10, "Clipped %ld: %f +/- %f\n", j,
    541553                            myVector->data.F32[j], errors->data.F32[j]);
    542554                    numClipped++;
     
    549561                    fabsf(myVector->data.F32[j] - clippedMean) > (stats->clipSigma * clippedStdev)) {
    550562                    tmpMask->data.U8[j] = 0xff;
    551                     psTrace("psLib.math", 10, "Clipped %ld: %f\n", j, myVector->data.F32[j]);
     563                    psTrace(TRACE, 10, "Clipped %ld: %f\n", j, myVector->data.F32[j]);
    552564                    numClipped++;
    553565                    clipped = true;
     
    561573        vectorSampleMean(myVector, errors, tmpMask, maskVal, statsTmp);
    562574        vectorSampleStdev(myVector, errors, tmpMask, maskVal, statsTmp);
    563         psTrace("psLib.math", 6, "The new sample mean is %f\n", statsTmp->sampleMean);
    564         psTrace("psLib.math", 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
     575        psTrace(TRACE, 6, "The new sample mean is %f\n", statsTmp->sampleMean);
     576        psTrace(TRACE, 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
    565577
    566578        // If the new mean and stdev are NAN, we must exit the loop.
     
    591603    stats->results |= PS_STAT_CLIPPED_STDEV;
    592604
    593     psTrace("psLib.math", 6, "The final clipped mean is %f\n", clippedMean);
    594     psTrace("psLib.math", 6, "The final clipped stdev is %f\n", clippedStdev);
     605    psTrace(TRACE, 6, "The final clipped mean is %f\n", clippedMean);
     606    psTrace(TRACE, 6, "The final clipped stdev is %f\n", clippedStdev);
    595607
    596608    psFree(tmpMask);
    597     psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
     609    psTrace(TRACE, 4, "---- %s(true) end ----\n", __func__);
    598610    return true;
    599611}
     
    624636                              psStats* stats)
    625637{
    626     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     638    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    627639    if (psTraceGetLevel("psLib.math") >= 8) {
    628640        PS_VECTOR_PRINT_F32(myVector);
     
    658670    // Iterate to get the best bin size
    659671    for (int iterate = 1; iterate > 0; iterate++) {
    660         psTrace("psLib.math", 6, "-------------------- Iterating on Bin size.  Iteration number %d --------------------\n", iterate);
     672        psTrace(TRACE, 6, "-------------------- Iterating on Bin size.  Iteration number %d --------------------\n", iterate);
    661673
    662674        // Get the minimum and maximum values
     
    669681            goto escape;
    670682        }
    671         psTrace("psLib.math", 6, "Data min/max is (%.2f, %.2f)\n", min, max);
     683        psTrace(TRACE, 6, "Data min/max is (%.2f, %.2f)\n", min, max);
    672684
    673685        // If all data points have the same value, then we set the appropriate members of stats and return.
     
    681693            stats->results |= PS_STAT_ROBUST_STDEV;
    682694            stats->results |= PS_STAT_ROBUST_QUARTILE;
    683             psTrace("psLib.math", 5, "All data points have the same value: %f.\n", min);
    684             psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
     695            psTrace(TRACE, 5, "All data points have the same value: %f.\n", min);
     696            psTrace(TRACE, 4, "---- %s(0) end  ----\n", __func__);
    685697            psFree(mask);
    686698            psFree(statsMinMax);
     
    691703            // Set initial bin size to the specified value.
    692704            binSize = stats->binsize;
    693             psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
     705            psTrace(TRACE, 6, "Setting initial robust bin size to %.2f\n", binSize);
    694706        } else {
    695707            // Determine the bin size of the robust histogram, using the pre-defined number of bins
    696708            binSize = (max - min) / INITIAL_NUM_BINS;
    697709        }
    698         psTrace("psLib.math", 6, "Initial robust bin size is %.2f\n", binSize);
     710        psTrace(TRACE, 6, "Initial robust bin size is %.2f\n", binSize);
    699711
    700712        // ADD step 0: Construct the histogram with the specified bin size.  NOTE: we can not specify the bin
     
    702714        // we get here, we know that binSize != 0.0.
    703715        long numBins = (max - min) / binSize; // Number of bins
    704         psTrace("psLib.math", 6, "Numbins is %ld\n", numBins);
    705         psTrace("psLib.math", 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
     716        psTrace(TRACE, 6, "Numbins is %ld\n", numBins);
     717        psTrace(TRACE, 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
    706718        // Generate the histogram
    707719        histogram = psHistogramAlloc(min, max, numBins);
     
    729741        // ADD step 2: Find the bin which contains the 50% data point.
    730742        totalDataPoints = cumulative->nums->data.F32[numBins - 1];
    731         psTrace("psLib.math", 6, "Total data points is %ld\n", totalDataPoints);
     743        psTrace(TRACE, 6, "Total data points is %ld\n", totalDataPoints);
    732744
    733745        PS_BIN_FOR_VALUE(binMedian, cumulative->nums, totalDataPoints/2.0, 0);
    734         psTrace("psLib.math", 6, "The median bin is %ld (%.2f to %.2f)\n", binMedian,
     746        psTrace(TRACE, 6, "The median bin is %ld (%.2f to %.2f)\n", binMedian,
    735747                cumulative->bounds->data.F32[binMedian], cumulative->bounds->data.F32[binMedian+1]);
    736748
     
    742754            goto escape;
    743755        }
    744         psTrace("psLib.math", 6, "Current robust median is %f\n", stats->robustMedian);
     756        psTrace(TRACE, 6, "Current robust median is %f\n", stats->robustMedian);
    745757
    746758        // ADD step 4: Find the bins which contains the 15.8655% (-1 sigma) and 84.1345% (+1 sigma) data points
     
    751763        PS_BIN_FOR_VALUE(binH2, cumulative->nums, totalDataPoints * 0.691462f, 0);
    752764
    753         psTrace("psLib.math", 6, "The 15.8655%% and 84.1345%% data point bins are (%ld, %ld).\n",
     765        psTrace(TRACE, 6, "The 15.8655%% and 84.1345%% data point bins are (%ld, %ld).\n",
    754766                binLo, binHi);
    755         psTrace("psLib.math", 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
    756         psTrace("psLib.math", 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
    757         psTrace("psLib.math", 6, "binL2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binL2));
    758         psTrace("psLib.math", 6, "binH2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binH2));
     767        psTrace(TRACE, 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
     768        psTrace(TRACE, 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
     769        psTrace(TRACE, 6, "binL2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binL2));
     770        psTrace(TRACE, 6, "binH2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binH2));
    759771
    760772        if ((binLo < 0) || (binHi < 0)) {
     
    764776
    765777        // ADD step 4b: Interpolate Sigma (linearly) to find these two positions exactly: these are the 1sigma positions.
    766         psTrace("psLib.math", 6, "binLo is %ld.  Nums at that bin and the next are (%.2f, %.2f)\n",
     778        psTrace(TRACE, 6, "binLo is %ld.  Nums at that bin and the next are (%.2f, %.2f)\n",
    767779                binLo, cumulative->nums->data.F32[binLo], cumulative->nums->data.F32[binLo+1]);
    768         psTrace("psLib.math", 6, "binHi is %ld.  Nums at that bin and the next are (%.2f, %.2f)\n",
     780        psTrace(TRACE, 6, "binHi is %ld.  Nums at that bin and the next are (%.2f, %.2f)\n",
    769781                binHi, cumulative->nums->data.F32[binHi], cumulative->nums->data.F32[binHi+1]);
    770782
     
    779791
    780792        // report +/- 1 sigma points
    781         psTrace("psLib.math", 5,
     793        psTrace(TRACE, 5,
    782794                "The exact 15.8655 and 84.1345 percent data point positions are: (%f, %f)\n",
    783795                binLoF32, binHiF32);
     
    787799        sigma = (binH2F32 - binL2F32);
    788800
    789         psTrace("psLib.math", 6, "The current sigma is %f.\n", sigma);
     801        psTrace(TRACE, 6, "The current sigma is %f.\n", sigma);
    790802        stats->robustStdev = sigma;
    791803
     
    793805        // than 25 bins from the median, recalculate the bin size, and perform the algorithm again.
    794806        if (sigma < (2 * binSize)) {
    795             psTrace("psLib.math", 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
     807            psTrace(TRACE, 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
    796808            long maskLo = PS_MAX(0, (binMedian - 25)); // Low index for masking region
    797809            long maskHi = PS_MIN(histogram->bounds->n - 1, (binMedian + 25)); // High index for masking
    798810            psF32 medianLo = histogram->bounds->data.F32[maskLo]; // Value at low index
    799811            psF32 medianHi = histogram->bounds->data.F32[maskHi]; // Value at high index
    800             psTrace("psLib.math", 6, "Masking data more than 25 bins from the median\n");
    801             psTrace("psLib.math", 6,
     812            psTrace(TRACE, 6, "Masking data more than 25 bins from the median\n");
     813            psTrace(TRACE, 6,
    802814                    "The median is at bin number %ld.  We mask bins outside the bin range (%ld:%ld)\n",
    803815                    binMedian, maskLo, maskHi);
    804             psTrace("psLib.math", 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
     816            psTrace(TRACE, 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
    805817            for (long i = 0 ; i < myVector->n ; i++) {
    806818                if ((myVector->data.F32[i] < medianLo) || (myVector->data.F32[i] > medianHi)) {
    807819                    mask->data.U8[i] |= MASK_MARK;
    808                     psTrace("psLib.math", 6, "Masking element %ld is %f\n", i, myVector->data.F32[i]);
     820                    psTrace(TRACE, 6, "Masking element %ld is %f\n", i, myVector->data.F32[i]);
    809821                }
    810822            }
     
    817829        } else {
    818830            // We've got the bin size correct now
    819             psTrace("psLib.math", 6, "*************: No more iteration.  sigma is %f\n", sigma);
     831            psTrace(TRACE, 6, "*************: No more iteration.  sigma is %f\n", sigma);
    820832            iterate = -1;
    821833        }
     
    831843    PS_BIN_FOR_VALUE (binLo25, cumulative->nums, totalDataPoints * 0.25f, 0);
    832844    PS_BIN_FOR_VALUE (binHi25, cumulative->nums, totalDataPoints * 0.75f, 0);
    833     psTrace("psLib.math", 6, "The 25-percent and 75-precent data point bins are (%ld, %ld).\n", binLo25, binHi25);
     845    psTrace(TRACE, 6, "The 25-percent and 75-precent data point bins are (%ld, %ld).\n", binLo25, binHi25);
    834846
    835847    // ADD step 8: Interpolate to find these two positions exactly: these are the upper and lower quartile
     
    847859    stats->robustLQ = binLo25F32;
    848860    stats->robustUQ = binHi25F32;
    849     psTrace("psLib.math", 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
     861    psTrace(TRACE, 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
    850862            binLo25F32, binHi25F32);
    851863    long N50 = 0;
     
    857869    }
    858870    stats->robustN50 = N50;
    859     psTrace("psLib.math", 6, "The robustN50 is %ld.\n", N50);
     871    psTrace(TRACE, 6, "The robustN50 is %ld.\n", N50);
    860872
    861873    // Clean up
     
    869881    stats->results |= PS_STAT_ROBUST_QUARTILE;
    870882
    871     psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
     883    psTrace(TRACE, 4, "---- %s(0) end  ----\n", __func__);
    872884    return true;
    873885
     
    882894    stats->results |= PS_STAT_ROBUST_QUARTILE;
    883895
    884     psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     896    psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    885897
    886898    psFree(histogram);
     
    913925        stats->fittedStdev = NAN;
    914926        stats->fittedStdev = NAN;
    915         psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     927        psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    916928        return false;
    917929    }
     
    920932    float guessMean = stats->robustMedian;  // pass the guess mean
    921933
    922     psTrace("psLib.math", 6, "The guess mean  is %f.\n", guessMean);
    923     psTrace("psLib.math", 6, "The guess stdev is %f.\n", guessStdev);
     934    psTrace(TRACE, 6, "The guess mean  is %f.\n", guessMean);
     935    psTrace(TRACE, 6, "The guess stdev is %f.\n", guessStdev);
    924936
    925937    bool done = false;
     
    931943            // Set initial bin size to the specified value.
    932944            binSize = stats->binsize;
    933             psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
     945            psTrace(TRACE, 6, "Setting initial robust bin size to %.2f\n", binSize);
    934946        } else {
    935947            // construct a histogram with (sigma/10 < binsize < sigma)
     
    947959            psError(PS_ERR_UNKNOWN, false, "Failed to calculate the min/max of the input vector.\n");
    948960            psFree(statsMinMax);
    949             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     961            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    950962            return false;
    951963        }
     
    954966        // XXX can we calculate the binMin, binMax **before** building this histogram?
    955967        long numBins = (max - min) / binSize;
    956         psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
    957         psTrace("psLib.math", 6, "The new bin size is %f.\n", binSize);
    958         psTrace("psLib.math", 6, "The numBins is %ld\n", numBins);
     968        psTrace(TRACE, 6, "The new min/max values are (%f, %f).\n", min, max);
     969        psTrace(TRACE, 6, "The new bin size is %f.\n", binSize);
     970        psTrace(TRACE, 6, "The numBins is %ld\n", numBins);
    959971
    960972        psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers)
     
    10061018            PS_VECTOR_PRINT_F32(y);
    10071019        }
    1008         psTrace("psLib.math", 6, "The clipped numBins is %ld\n", y->n);
    1009         psTrace("psLib.math", 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
    1010         psTrace("psLib.math", 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax), binMax);
     1020        psTrace(TRACE, 6, "The clipped numBins is %ld\n", y->n);
     1021        psTrace(TRACE, 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
     1022        psTrace(TRACE, 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax), binMax);
    10111023
    10121024        // Normalize y to [0.0:1.0] (since the psMinimizeLMChi2Gauss1D() functions is [0.0:1.0])
     
    10321044            psFree(histogram);
    10331045            psFree(statsMinMax);
    1034             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1046            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    10351047            return false;
    10361048        }
     
    10561068    // The fitted mean is the Gaussian mean.
    10571069    stats->fittedMean = guessMean;
    1058     psTrace("psLib.math", 6, "The fitted mean is %f.\n", stats->fittedMean);
     1070    psTrace(TRACE, 6, "The fitted mean is %f.\n", stats->fittedMean);
    10591071
    10601072    // The fitted standard deviation
    10611073    stats->fittedStdev = guessStdev;
    1062     psTrace("psLib.math", 6, "The fitted stdev is %f.\n", stats->fittedStdev);
     1074    psTrace(TRACE, 6, "The fitted stdev is %f.\n", stats->fittedStdev);
    10631075
    10641076    stats->results |= PS_STAT_FITTED_MEAN;
     
    10911103        stats->fittedStdev = NAN;
    10921104        stats->fittedStdev = NAN;
    1093         psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     1105        psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    10941106        return false;
    10951107    }
     
    10981110    float guessMean = stats->robustMedian;  // pass the guess mean
    10991111
    1100     psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
    1101     psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
     1112    psTrace(TRACE, 6, "The ** starting ** guess mean  is %f.\n", guessMean);
     1113    psTrace(TRACE, 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
    11021114
    11031115    bool done = false;
     
    11091121            // Set initial bin size to the specified value.
    11101122            binSize = stats->binsize;
    1111             psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
     1123            psTrace(TRACE, 6, "Setting initial robust bin size to %.2f\n", binSize);
    11121124        } else {
    11131125            // construct a histogram with (sigma/10 < binsize < sigma)
     
    11251137            psError(PS_ERR_UNKNOWN, false, "Failed to calculate the min/max of the input vector.\n");
    11261138            psFree(statsMinMax);
    1127             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1139            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    11281140            return false;
    11291141        }
     
    11321144        // XXX can we calculate the binMin, binMax **before** building this histogram?
    11331145        long numBins = (max - min) / binSize;
    1134         psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
    1135         psTrace("psLib.math", 6, "The new bin size is %f.\n", binSize);
    1136         psTrace("psLib.math", 6, "The numBins is %ld\n", numBins);
     1146        psTrace(TRACE, 6, "The new min/max values are (%f, %f).\n", min, max);
     1147        psTrace(TRACE, 6, "The new bin size is %f.\n", binSize);
     1148        psTrace(TRACE, 6, "The numBins is %ld\n", numBins);
    11371149
    11381150        psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers)
     
    11881200            PS_VECTOR_PRINT_F32(y);
    11891201        }
    1190         psTrace("psLib.math", 6, "The clipped numBins is %ld\n", y->n);
    1191         psTrace("psLib.math", 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
    1192         psTrace("psLib.math", 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax), binMax);
     1202        psTrace(TRACE, 6, "The clipped numBins is %ld\n", y->n);
     1203        psTrace(TRACE, 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
     1204        psTrace(TRACE, 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax), binMax);
    11931205
    11941206        // fit 2nd order polynomial to ln(y) = -(x-xo)^2/2sigma^2
     
    12101222            psFree(histogram);
    12111223            psFree(statsMinMax);
    1212             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1224            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    12131225            return false;
    12141226        }
    12151227
    12161228        if (poly->coeff[2] >= 0.0) {
    1217             psTrace("psLib.math", 6, "Parabolic fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
     1229            psTrace(TRACE, 6, "Parabolic fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
    12181230            psError(PS_ERR_UNKNOWN, false, "fit did not converge\n");
    12191231            psFree(x);
     
    12221234            psFree(histogram);
    12231235            psFree(statsMinMax);
    1224             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1236            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    12251237            return false;
    12261238        }
     
    12311243            done = true;
    12321244        } else {
    1233             psTrace("psLib.math", 6, "Parabolic fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
    1234             psTrace("psLib.math", 6, "The new guess mean  is %f.\n", guessMean);
    1235             psTrace("psLib.math", 6, "The new guess stdev is %f.\n", guessStdev);
     1245            psTrace(TRACE, 6, "Parabolic fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
     1246            psTrace(TRACE, 6, "The new guess mean  is %f.\n", guessMean);
     1247            psTrace(TRACE, 6, "The new guess stdev is %f.\n", guessStdev);
    12361248        }
    12371249
     
    12481260    // The fitted mean is the Gaussian mean.
    12491261    stats->fittedMean = guessMean;
    1250     psTrace("psLib.math", 6, "The fitted mean is %f.\n", stats->fittedMean);
     1262    psTrace(TRACE, 6, "The fitted mean is %f.\n", stats->fittedMean);
    12511263
    12521264    // The fitted standard deviation
    12531265    stats->fittedStdev = guessStdev;
    1254     psTrace("psLib.math", 6, "The fitted stdev is %f.\n", stats->fittedStdev);
     1266    psTrace(TRACE, 6, "The fitted stdev is %f.\n", stats->fittedStdev);
    12551267
    12561268    stats->results |= PS_STAT_FITTED_MEAN_V2;
     
    12831295        stats->fittedStdev = NAN;
    12841296        stats->fittedStdev = NAN;
    1285         psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     1297        psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    12861298        return false;
    12871299    }
     
    12901302    float guessMean = stats->robustMedian;  // pass the guess mean
    12911303
    1292     psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
    1293     psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
     1304    psTrace(TRACE, 6, "The ** starting ** guess mean  is %f.\n", guessMean);
     1305    psTrace(TRACE, 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
    12941306
    12951307    bool done = false;
     
    13011313            // Set initial bin size to the specified value.
    13021314            binSize = stats->binsize;
    1303             psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
     1315            psTrace(TRACE, 6, "Setting initial robust bin size to %.2f\n", binSize);
    13041316        } else {
    13051317            // construct a histogram with (sigma/2 < binsize < sigma)
     
    13171329            psError(PS_ERR_UNKNOWN, false, "Failed to calculate the min/max of the input vector.\n");
    13181330            psFree(statsMinMax);
    1319             psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1331            psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    13201332            return false;
    13211333        }
     
    13241336        // XXX can we calculate the binMin, binMax **before** building this histogram?
    13251337        long numBins = (max - min) / binSize;
    1326         psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
    1327         psTrace("psLib.math", 6, "The new bin size is %f.\n", binSize);
    1328         psTrace("psLib.math", 6, "The numBins is %ld\n", numBins);
     1338        psTrace(TRACE, 6, "The new min/max values are (%f, %f).\n", min, max);
     1339        psTrace(TRACE, 6, "The new bin size is %f.\n", binSize);
     1340        psTrace(TRACE, 6, "The numBins is %ld\n", numBins);
    13291341
    13301342        psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers)
     
    13781390        // assume a reasonably well-defined gaussian-like population; run from peak out until val < 0.25*peak
    13791391
    1380         psTrace("psLib.math", 6, "The clipped numBins is %ld\n", binMax - binMin);
    1381         psTrace("psLib.math", 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
    1382         psTrace("psLib.math", 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax - 1), binMax - 1);
    1383         psTrace("psLib.math", 6, "The clipped peak is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binPeak), binPeak);
     1392        psTrace(TRACE, 6, "The clipped numBins is %ld\n", binMax - binMin);
     1393        psTrace(TRACE, 6, "The clipped min is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMin), binMin);
     1394        psTrace(TRACE, 6, "The clipped max is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binMax - 1), binMax - 1);
     1395        psTrace(TRACE, 6, "The clipped peak is %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binPeak), binPeak);
    13841396
    13851397        {
     
    13941406                }
    13951407            }
    1396             psTrace("psLib.math", 6, "Lower bound for lower half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binS), binS);
    1397             psTrace("psLib.math", 6, "Upper bound for lower half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binE), binE);
     1408            psTrace(TRACE, 6, "Lower bound for lower half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binS), binS);
     1409            psTrace(TRACE, 6, "Upper bound for lower half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binE), binE);
    13981410
    13991411            psVector *y = psVectorAllocEmpty(binE - binS, PS_TYPE_F32); // Vector of coordinates
     
    14201432                psFree(histogram);
    14211433                psFree(statsMinMax);
    1422                 psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1434                psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    14231435                return false;
    14241436            }
    14251437
    14261438            if (poly->coeff[2] >= 0.0) {
    1427                 psTrace("psLib.math", 6, "Failed parabolic fit: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
     1439                psTrace(TRACE, 6, "Failed parabolic fit: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
    14281440                psFree(poly);
    14291441                psFree(histogram);
     
    14341446                if (iteration == 0) {
    14351447                    guessStdev = 0.25*guessStdev;
    1436                     psTrace("psLib.math", 6, "*** retry stdev is %f.\n", guessStdev);
     1448                    psTrace(TRACE, 6, "*** retry stdev is %f.\n", guessStdev);
    14371449                    continue;
    14381450                }
    14391451
    14401452                psError(PS_ERR_UNKNOWN, false, "fit did not converge\n");
    1441                 psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1453                psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    14421454                return false;
    14431455            }
     
    14491461                done = true;
    14501462            }
    1451             psTrace("psLib.math", 6, "Parabolic Lower fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
    1452             psTrace("psLib.math", 6, "The lower mean  is %f.\n", guessMean);
    1453             psTrace("psLib.math", 6, "The lower stdev is %f.\n", guessStdev);
     1463            psTrace(TRACE, 6, "Parabolic Lower fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
     1464            psTrace(TRACE, 6, "The lower mean  is %f.\n", guessMean);
     1465            psTrace(TRACE, 6, "The lower stdev is %f.\n", guessStdev);
    14541466
    14551467            psFree(poly);
     
    14671479                }
    14681480            }
    1469             psTrace("psLib.math", 6, "Lower bound for upper half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binS), binS);
    1470             psTrace("psLib.math", 6, "Upper bound for upper half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binE), binE);
     1481            psTrace(TRACE, 6, "Lower bound for upper half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binS), binS);
     1482            psTrace(TRACE, 6, "Upper bound for upper half: %f (%ld)\n", PS_BIN_MIDPOINT(histogram, binE), binE);
    14711483
    14721484            psVector *y = psVectorAllocEmpty(binE - binS, PS_TYPE_F32); // Vector of coordinates
     
    14931505                psFree(histogram);
    14941506                psFree(statsMinMax);
    1495                 psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
     1507                psTrace(TRACE, 4, "---- %s(false) end  ----\n", __func__);
    14961508                return false;
    14971509            }
     
    15011513            float upperStdev = sqrt(-0.5/poly->coeff[2]);
    15021514            float upperMean = poly->coeff[1]*PS_SQR(upperStdev);
    1503             psTrace("psLib.math", 6, "Parabolic Upper fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
    1504             psTrace("psLib.math", 6, "The upper mean  is %f.\n", upperMean);
    1505             psTrace("psLib.math", 6, "The upper stdev is %f.\n", upperStdev);
     1515            psTrace(TRACE, 6, "Parabolic Upper fit results: %f + %f x + %f x^2\n", poly->coeff[0], poly->coeff[1], poly->coeff[2]);
     1516            psTrace(TRACE, 6, "The upper mean  is %f.\n", upperMean);
     1517            psTrace(TRACE, 6, "The upper stdev is %f.\n", upperStdev);
    15061518#endif
    15071519
     
    15161528    // The fitted mean is the Gaussian mean.
    15171529    stats->fittedMean = guessMean;
    1518     psTrace("psLib.math", 6, "The fitted mean is %f.\n", stats->fittedMean);
     1530    psTrace(TRACE, 6, "The fitted mean is %f.\n", stats->fittedMean);
    15191531
    15201532    // The fitted standard deviation
    15211533    stats->fittedStdev = guessStdev;
    1522     psTrace("psLib.math", 6, "The fitted stdev is %f.\n", stats->fittedStdev);
     1534    psTrace(TRACE, 6, "The fitted stdev is %f.\n", stats->fittedStdev);
    15231535
    15241536    stats->results |= PS_STAT_FITTED_MEAN_V3;
     
    15391551                                   psF32 sigma)
    15401552{
    1541     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    1542     psTrace("psLib.math", 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
     1553    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
     1554    psTrace(TRACE, 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
    15431555    PS_ASSERT_PTR_NON_NULL(histogram, NULL);
    15441556    PS_ASSERT_PTR_NON_NULL(histogram->bounds, NULL);
     
    16271639        PS_VECTOR_PRINT_F32(smooth);
    16281640    }
    1629     psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     1641    psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    16301642    return(smooth);
    16311643}
     
    16481660psStats* psStatsAlloc(psStatsOptions options)
    16491661{
    1650     psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
     1662    psTrace(TRACE, 3,"---- %s() begin  ----\n", __func__);
    16511663    psStats* newStruct = NULL;
    16521664
     
    16771689    newStruct->options = options;
    16781690
    1679     psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
     1691    psTrace(TRACE, 3, "---- %s() end  ----\n", __func__);
    16801692    return (newStruct);
    16811693}
     
    17091721                   psMaskType maskVal)
    17101722{
    1711     psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
    1712     PS_ASSERT_PTR_NON_NULL(stats, NULL);
    1713     PS_ASSERT_VECTOR_NON_NULL(in, NULL);
     1723    psTrace(TRACE, 3,"---- %s() begin  ----\n", __func__);
     1724    PS_ASSERT_PTR_NON_NULL(stats, false);
     1725    PS_ASSERT_VECTOR_NON_NULL(in, false);
     1726    PS_ASSERT_VECTOR_NON_EMPTY(in, false);
    17141727    if (mask) {
    1715         PS_ASSERT_VECTORS_SIZE_EQUAL(mask, in, stats);
    1716         PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, stats);
     1728        PS_ASSERT_VECTORS_SIZE_EQUAL(mask, in, false);
     1729        PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, false);
    17171730    }
    17181731    if (errors) {
    1719         PS_ASSERT_VECTORS_SIZE_EQUAL(errors, in, stats);
    1720         PS_ASSERT_VECTOR_TYPE(errors, in->type.type, stats);
     1732        PS_ASSERT_VECTORS_SIZE_EQUAL(errors, in, false);
     1733        PS_ASSERT_VECTOR_TYPE(errors, in->type.type, false);
    17211734    }
    17221735
     
    17461759
    17471760    if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) {
    1748         PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->max, stats->min, stats);
     1761        PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->max, stats->min, false);
    17491762    }
    17501763
    17511764    if ((stats->options & PS_STAT_USE_BINSIZE) && (stats->min >= stats->max)) {
    1752         PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->binsize, 0.0, stats);
     1765        PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->binsize, 0.0, false);
    17531766    }
    17541767
     
    18391852    psFree(errorsF32);
    18401853    psFree(maskU8);
    1841     psTrace("psLib.math", 3,"---- %s() end  ----\n", __func__);
    1842     return (status);
     1854    psTrace(TRACE, 3,"---- %s() end  ----\n", __func__);
     1855    return status;
    18431856}
    18441857
     
    19231936        psStatsOptions option = psStatsOptionFromString(statString);
    19241937        if (option == 0) {
    1925             psWarning("Unable to interpret statistic option: %s --- ignored.\n",
    1926                      statString);
     1938            psWarning("Unable to interpret statistic option: %s --- ignored.\n", statString);
    19271939            continue;
    19281940        }
     
    20542066    )
    20552067{
    2056     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    2057     psTrace("psLib.math", 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
     2068    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
     2069    psTrace(TRACE, 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
    20582070    if (psTraceGetLevel("psLib.math") >= 8) {
    20592071        PS_VECTOR_PRINT_F32(xVec);
     
    20812093        y->data.F64[1] = yVec->data.F32[binNum];
    20822094        y->data.F64[2] = yVec->data.F32[binNum + 1];
    2083         psTrace("psLib.math", 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
     2095        psTrace(TRACE, 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
    20842096                xVec->data.F32[binNum], xVec->data.F32[binNum+1], xVec->data.F32[binNum+2]);
    2085         psTrace("psLib.math", 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
    2086         psTrace("psLib.math", 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
     2097        psTrace(TRACE, 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
     2098        psTrace(TRACE, 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
    20872099
    20882100        //
     
    21052117            psFree(x);
    21062118            psFree(y);
    2107             psTrace("psLib.math", 5, "---- %s() end ----\n", __func__);
     2119            psTrace(TRACE, 5, "---- %s() end ----\n", __func__);
    21082120            return NAN;
    21092121        }
     
    21162128            psFree(x);
    21172129            psFree(y);
    2118             psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
     2130            psTrace(TRACE, 5, "---- %s(NAN) end ----\n", __func__);
    21192131            return NAN;
    21202132        }
    2121         psTrace("psLib.math", 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
    2122         psTrace("psLib.math", 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
    2123         psTrace("psLib.math", 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
    2124         psTrace("psLib.math", 6, "Fitted y vec is (%f %f %f)\n",
     2133        psTrace(TRACE, 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
     2134        psTrace(TRACE, 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
     2135        psTrace(TRACE, 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
     2136        psTrace(TRACE, 6, "Fitted y vec is (%f %f %f)\n",
    21252137                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[0]),
    21262138                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[1]),
    21272139                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[2]));
    21282140
    2129         psTrace("psLib.math", 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
     2141        psTrace(TRACE, 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
    21302142        tmpFloat = QuadraticInverse(myPoly->coeff[2], myPoly->coeff[1], myPoly->coeff[0], yVal,
    21312143                                    x->data.F64[0], x->data.F64[2]);
     
    21372149            psFree(x);
    21382150            psFree(y);
    2139             psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
     2151            psTrace(TRACE, 5, "---- %s(NAN) end ----\n", __func__);
    21402152            return(NAN);
    21412153        }
     
    21572169    }
    21582170
    2159     psTrace("psLib.math", 6, "FIT: return %f\n", tmpFloat);
     2171    psTrace(TRACE, 6, "FIT: return %f\n", tmpFloat);
    21602172    psFree(x);
    21612173    psFree(y);
    21622174
    2163     psTrace("psLib.math", 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
     2175    psTrace(TRACE, 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
    21642176    return tmpFloat;
    21652177}
     
    21732185    )
    21742186{
    2175     psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     2187    psTrace(TRACE, 4, "---- %s() begin ----\n", __func__);
    21762188    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
    21772189    PS_ASSERT_VECTOR_SIZE(params, (long)2, NAN);
     
    21962208
    21972209
    2198     psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
     2210    psTrace(TRACE, 4, "---- %s() end ----\n", __func__);
    21992211    return gauss;
    22002212}
Note: See TracChangeset for help on using the changeset viewer.