IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8245


Ignore:
Timestamp:
Aug 8, 2006, 4:26:44 PM (20 years ago)
Author:
jhoblitt
Message:

normalize psTrace() facility names

Location:
trunk/psLib/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r8232 r8245  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.122 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-08-08 23:32:22 $
     12*  @version $Revision: 1.123 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-08-09 02:26:44 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    589589    psPolynomial2D *trans2)
    590590{
    591     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    592     psTrace(__func__, 5, "multiplyDPoly2D(%d %d: %d %d)\n", trans1->nX, trans1->nY, trans2->nX, trans2->nY);
     591    psTrace("psLib.astro", 4, "---- %s() begin ----\n", __func__);
     592    psTrace("psLib.astro", 5, "multiplyDPoly2D(%d %d: %d %d)\n", trans1->nX, trans1->nY, trans2->nX, trans2->nY);
    593593    psS32 orderX = trans1->nX + trans2->nX;
    594594    psS32 orderY = trans1->nY + trans2->nY;
    595     psTrace(__func__, 5, "out poly (nX, nY) is (%d, %d)\n", orderX, orderY);
     595    psTrace("psLib.astro", 5, "out poly (nX, nY) is (%d, %d)\n", orderX, orderY);
    596596
    597597    psPolynomial2D *out = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, orderX, orderY);
    598     psTrace(__func__, 5, "Creating poly (%d, %d)\n", orderX, orderY);
     598    psTrace("psLib.astro", 5, "Creating poly (%d, %d)\n", orderX, orderY);
    599599
    600600    for (psS32 t1x = 0 ; t1x < (1 + trans1->nX) ; t1x++) {
     
    609609        }
    610610    }
    611     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     611    psTrace("psLib.astro", 4, "---- %s() end ----\n", __func__);
    612612    return(out);
    613613}
     
    623623    int nSamples)
    624624{
    625     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
    626     psTrace(__func__, 3, "tracelevel(%s) is %d\n", __func__, psTraceGetLevel(__func__));
     625    psTrace("psLib.astro", 3, "---- %s() begin ----\n", __func__);
     626    psTrace("psLib.astro", 3, "tracelevel(%s) is %d\n", __func__, psTraceGetLevel(__func__));
    627627
    628628    PS_ASSERT_PTR_NON_NULL(trans1, NULL);
    629629    PS_ASSERT_PTR_NON_NULL(trans2, NULL);
    630     psTrace(__func__, 5, "trans1->x is (%d, %d) order.\n", trans1->x->nX, trans1->x->nY);
    631     psTrace(__func__, 5, "trans1->y is (%d, %d) order.\n", trans1->y->nX, trans1->y->nY);
    632     psTrace(__func__, 5, "trans2->x is (%d, %d) order.\n", trans2->x->nX, trans2->x->nY);
    633     psTrace(__func__, 5, "trans2->y is (%d, %d) order.\n", trans2->y->nX, trans2->y->nY);
     630    psTrace("psLib.astro", 5, "trans1->x is (%d, %d) order.\n", trans1->x->nX, trans1->x->nY);
     631    psTrace("psLib.astro", 5, "trans1->y is (%d, %d) order.\n", trans1->y->nX, trans1->y->nY);
     632    psTrace("psLib.astro", 5, "trans2->x is (%d, %d) order.\n", trans2->x->nX, trans2->x->nY);
     633    psTrace("psLib.astro", 5, "trans2->y is (%d, %d) order.\n", trans2->y->nX, trans2->y->nY);
    634634    if (psTraceGetLevel(__func__) >= 6) {
    635635        PS_POLY_PRINT_2D(trans1->x);
     
    648648    psS32 orderX = PS_MAX(orderXnX, orderYnX);
    649649    psS32 orderY = PS_MAX(orderXnY, orderYnY);
    650     psTrace(__func__, 5, "The new (orderX, orderY) is (%d, %d)\n", orderX, orderY);
     650    psTrace("psLib.astro", 5, "The new (orderX, orderY) is (%d, %d)\n", orderX, orderY);
    651651
    652652    //
     
    679679        }
    680680    }
    681     psTrace(__func__, 5, "New polynomial ranks are (%d %d %d %d)\n", myPT->x->nX, myPT->x->nY, myPT->y->nX, myPT->y->nY);
     681    psTrace("psLib.astro", 5, "New polynomial ranks are (%d %d %d %d)\n", myPT->x->nX, myPT->x->nY, myPT->y->nX, myPT->y->nY);
    682682
    683683    //
     
    707707    }
    708708
    709     psTrace(__func__, 5, "Determine the new x-polynomial\n");
     709    psTrace("psLib.astro", 5, "Determine the new x-polynomial\n");
    710710    for (psS32 t2x = 0 ; t2x < (trans2->x->nX + 1) ; t2x++) {
    711711        for (psS32 t2y = 0 ; t2y < (trans2->x->nY + 1) ; t2y++) {
    712             psTrace(__func__, 6, "X: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
     712            psTrace("psLib.astro", 6, "X: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
    713713            if (trans2->x->mask[t2x][t2y] == 0) {
    714                 psTrace(__func__, 6, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
     714                psTrace("psLib.astro", 6, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
    715715                psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
    716716
     
    734734    }
    735735    if (psTraceGetLevel(__func__) >= 6) {
    736         psTrace(__func__, 6, "The final x-polynomial\n");
     736        psTrace("psLib.astro", 6, "The final x-polynomial\n");
    737737        PS_POLY_PRINT_2D(myPT->x);
    738738    }
     
    741741    // Determine the new y-polynomial
    742742    //
    743     psTrace(__func__, 5, "Determine the new y-polynomial\n");
     743    psTrace("psLib.astro", 5, "Determine the new y-polynomial\n");
    744744    for (psS32 t2x = 0 ; t2x < (trans2->y->nX + 1) ; t2x++) {
    745745        for (psS32 t2y = 0 ; t2y < (trans2->y->nY + 1) ; t2y++) {
    746             psTrace(__func__, 5, "Y: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
     746            psTrace("psLib.astro", 5, "Y: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
    747747            if (trans2->y->mask[t2x][t2y] == 0) {
    748                 psTrace(__func__, 5, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
     748                psTrace("psLib.astro", 5, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
    749749                psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
    750750
     
    767767    }
    768768    if (psTraceGetLevel(__func__) >= 6) {
    769         psTrace(__func__, 6, "The final y-polynomial\n");
     769        psTrace("psLib.astro", 6, "The final y-polynomial\n");
    770770        PS_POLY_PRINT_2D(myPT->y);
    771771    }
     
    778778    psFree(trans1YPolys);
    779779
    780     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     780    psTrace("psLib.astro", 3, "---- %s() end ----\n", __func__);
    781781    return(myPT);
    782782}
     
    969969
    970970            out->x+= xPoly->coeff[loop_x][loop_y] * xSum * ySum * ((psF32) loop_x);
    971             psTrace(__func__, 6, "out->x+= (%.2f * %.2f * %.2f * %.2f)\n", xPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_x));
     971            psTrace("psLib.astro", 6, "out->x+= (%.2f * %.2f * %.2f * %.2f)\n", xPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_x));
    972972            ySum*= coord->y;
    973973        }
     
    991991
    992992            out->y+= yPoly->coeff[loop_x][loop_y] * xSum * ySum * ((psF32) loop_y);
    993             psTrace(__func__, 6, "out->y+= (%.2f * %.2f * %.2f * %.2f)\n", yPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_y));
     993            psTrace("psLib.astro", 6, "out->y+= (%.2f * %.2f * %.2f * %.2f)\n", yPoly->coeff[loop_x][loop_y], xSum, ySum, ((psF32) loop_y));
    994994            ySum*= coord->y;
    995995        }
  • trunk/psLib/src/fits/psFitsTable.c

    r8232 r8245  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-08 23:32:23 $
     9 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-08-09 02:26:44 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7474    }
    7575
    76     psTrace(".psFits.psFitsReadTableRow",5,"Table size is %ix%i\n",numCols, numRows);
     76    psTrace("psLib.fits",5,"Table size is %ix%i\n",numCols, numRows);
    7777    // the row parameter in the proper range?
    7878    if (row < 0 || row >= numRows) {
     
    110110                    fits_read_col(fits->fd, FITSTYPE, col,row+1, \
    111111                                  1, 1, NULL, &value, &anynul, &status); \
    112                     psTrace(".psFits.psFitsReadTableRow",5,"Column #%i, '%s', is type %i, repeat %i, Value = %g\n", \
     112                    psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %i, Value = %g\n", \
    113113                            col, name, typecode, repeat, (double)value); \
    114114                    psMetadataAdd(data,PS_LIST_TAIL, name, \
     
    144144                    fits_read_col(fits->fd, TSTRING, col,row+1,
    145145                                  1, 1, NULL, &value, &anynul, &status);
    146                     psTrace(".psFits.psFitsReadTableRow",5,"Column #%i, '%s', is type %i, repeat %i, value = %s\n",
     146                    psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %i, value = %s\n",
    147147                            col, name, typecode, repeat, value);
    148148                    if (anynul == 0) {
     
    158158                          typecode, col);
    159159
    160                 psTrace("psFits.psFitsReadTableRow", 2,
     160                psTrace("psLib.fits", 2,
    161161                        "Column %d or row %d was of a non primitive type, %d",
    162162                        col, row, typecode);
     
    387387
    388388    for (int row = 0; row < numRows; row++) {
    389         psTrace(".psFits.psFitsReadTable",5,"Reading row %i of %i\n",row, numRows);
     389        psTrace("psLib.fits",5,"Reading row %i of %i\n",row, numRows);
    390390        table->data[row] = psFitsReadTableRow(fits,row);
    391391        table->n++;
  • trunk/psLib/src/math/psMathUtils.c

    r8232 r8245  
    33 *  This file contains standard math routines.
    44 *
    5  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-08-08 23:32:23 $
     5 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-08-09 02:26:44 $
    77 *
    88 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5858    long max; \
    5959    long mid; \
    60     psTrace(__func__, 4, "---- %s() begin ----\n", __func__); \
    61     /* psTrace(__func__, 6, "Determining the bin for: %f\n", x); */\
     60    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__); \
     61    /* psTrace("psLib.math", 6, "Determining the bin for: %f\n", x); */\
    6262    if (value < bounds[0]) { \
    6363        psLogMsg(__func__, PS_LOG_WARN, \
     
    7979        \
    8080        if (value == bounds[mid]) { \
    81             psTrace(__func__, 4, "---- %s(%d) end (1) ----\n", __func__, mid); \
     81            psTrace("psLib.math", 4, "---- %s(%d) end (1) ----\n", __func__, mid); \
    8282            return(mid); \
    8383        } else if (value < bounds[mid]) { \
     
    8888        mid = ((max+1)+min)/2; \
    8989    } \
    90     psTrace(__func__, 4, "---- %s(%d) end (2) ----\n", __func__, min); \
     90    psTrace("psLib.math", 4, "---- %s(%d) end (2) ----\n", __func__, min); \
    9191    return(min); \
    9292}
     
    135135#define VECTOR_INTERPOLATE_CASE(TYPE) \
    136136case PS_TYPE_##TYPE: { \
    137     psTrace(__func__, 4, "---- %s() begin %u-order.) (%d data points) ----\n", __func__, order, order+1); \
     137    psTrace("psLib.math", 4, "---- %s() begin %u-order.) (%d data points) ----\n", __func__, order, order+1); \
    138138    if (x->data.TYPE < domain->data.TYPE[0]) { \
    139139        psLogMsg(__func__, PS_LOG_WARN, "WARNING: x is outside the domain of input data.\n"); \
     
    173173    out->data.TYPE = p->data.TYPE[origin]; \
    174174    psFree(p); \
    175     psTrace(__func__, 4, "---- %s(....) end ----\n", __func__); \
     175    psTrace("psLib.math", 4, "---- %s(....) end ----\n", __func__); \
    176176    return(out); \
    177177}
     
    192192    const psScalar *x)
    193193{
    194     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     194    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    195195    PS_ASSERT_VECTOR_NON_NULL(domain, NULL);
    196196    PS_ASSERT_VECTOR_NON_NULL(range, NULL);
     
    275275{
    276276    PS_ASSERT_VECTOR_NON_NULL(myData, false);
    277     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     277    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    278278
    279279    switch (myData->type.type) {
     
    295295        }
    296296    }
    297     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     297    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    298298    return true;
    299299}
  • trunk/psLib/src/math/psMatrix.c

    r8232 r8245  
    2121 *  @author Robert DeSonia, MHPCC
    2222 *
    23  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    24  *  @date $Date: 2006-08-08 23:32:23 $
     23 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2006-08-09 02:26:44 $
    2525 *
    2626 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    343343                        if (ipiv[k] > 1) {
    344344                            // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Singular Matrix (1).\n");
    345                             psTrace(__func__, 4, "Singular Matrix (1).\n");
     345                            psTrace("psLib.math", 4, "Singular Matrix (1).\n");
    346346                            goto fescape;
    347347                        }
  • trunk/psLib/src/math/psMinimizeLMM.c

    r7914 r8245  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-07-15 02:57:12 $
     12 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-08-09 02:26:44 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7171
    7272    // LU decomposition version
    73     psTrace(__func__, 5, "using LUD version\n");
     73    psTrace("psLib.math", 5, "using LUD version\n");
    7474
    7575    // set new guess values (creates matrix A)
     
    103103    # else
    104104        // gauss-jordan version
    105         psTrace(__func__, 5, "using Gauss-J version");
     105        psTrace("psLib.math", 5, "using Gauss-J version");
    106106
    107107    // set new guess values (creates matrix A)
     
    158158    psMinimizeLMChi2Func func)
    159159{
    160     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     160    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    161161    // allocate internal arrays (current vs Guess)
    162162    psImage  *alpha  = psImageAlloc (params->n, params->n, PS_TYPE_F64);
     
    184184        rc = false;
    185185    }
    186     psTrace(__func__, 5, "p_psMinLM_SetABX() was succesful\n", __func__);
     186    psTrace("psLib.math", 5, "p_psMinLM_SetABX() was succesful\n", __func__);
    187187
    188188    psBool rcBool = p_psMinLM_GuessABP(Alpha, delta, Params, alpha, beta, params, paramMask, NULL, NULL, NULL, 0.0);
     
    191191        rc = false;
    192192    }
    193     psTrace(__func__, 5, "p_psMinLM_GuessABP() was succesful\n", __func__);
     193    psTrace("psLib.math", 5, "p_psMinLM_GuessABP() was succesful\n", __func__);
    194194
    195195    psFree(alpha);
     
    200200        psFree(dy);
    201201    }
    202     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     202    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    203203    return(rc);
    204204}
     
    335335    psMinimizeLMChi2Func func)
    336336{
    337     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     337    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    338338    PS_ASSERT_PTR_NON_NULL(min, false);
    339339    // XXX: If covar not NULL, do asserts...
     
    415415    }
    416416    if (psTraceGetLevel (__func__) >= 6) {
    417         psTrace(__func__, 6, "The current Param vector: \n");
     417        psTrace("psLib.math", 6, "The current Param vector: \n");
    418418        for (psS32 i = 0 ; i < Params->n ; i++) {
    419             psTrace(__func__, 6, "Params[%d] is %f\n", Params->data.F32[i]);
     419            psTrace("psLib.math", 6, "Params[%d] is %f\n", Params->data.F32[i]);
    420420        }
    421421    }
     
    423423    // iterate until the tolerance is reached, or give up
    424424    while ((min->iter < min->maxIter) && ((min->lastDelta > min->tol) || !isfinite(min->lastDelta))) {
    425         psTrace(__func__, 5, "Iteration number %d.  (max iterations is %d).\n", min->iter, min->maxIter);
    426         psTrace(__func__, 5, "Last delta is %f.  Min->tol is %f.\n", min->lastDelta, min->tol);
     425        psTrace("psLib.math", 5, "Iteration number %d.  (max iterations is %d).\n", min->iter, min->maxIter);
     426        psTrace("psLib.math", 5, "Last delta is %f.  Min->tol is %f.\n", min->lastDelta, min->tol);
    427427
    428428        // set a new guess for Alpha, Beta, Params
     
    445445        if (psTraceGetLevel(__func__) >= 6) {
    446446            if (psTraceGetLevel (__func__) >= 6) {
    447                 psTrace(__func__, 6, "The current Param vector: \n");
     447                psTrace("psLib.math", 6, "The current Param vector: \n");
    448448                for (psS32 i = 0 ; i < Params->n ; i++) {
    449                     psTrace(__func__, 6, "Params[%d] is %f\n", Params->data.F32[i]);
     449                    psTrace("psLib.math", 6, "Params[%d] is %f\n", Params->data.F32[i]);
    450450                }
    451451            }
     
    466466        psF64 rho = (min->value - Chisq) / dLinear;
    467467
    468         psTrace(__func__, 5, "last chisq: %f, new chisq %f, delta: %f, rho: %f\n", min->value,
     468        psTrace("psLib.math", 5, "last chisq: %f, new chisq %f, delta: %f, rho: %f\n", min->value,
    469469                Chisq, min->lastDelta, rho);
    470470
     
    489489        min->iter++;
    490490    }
    491     psTrace(__func__, 5, "chisq: %f, last delta: %f, Niter: %d\n", min->value, min->lastDelta, min->iter);
     491    psTrace("psLib.math", 5, "chisq: %f, last delta: %f, Niter: %d\n", min->value, min->lastDelta, min->iter);
    492492
    493493    // construct & return the covariance matrix (if requested)
     
    509509    }
    510510    if (min->iter == min->maxIter) {
    511         psTrace(__func__, 3, "---- %s(false) end ----\n", __func__);
     511        psTrace("psLib.math", 3, "---- %s(false) end ----\n", __func__);
    512512        return(false);
    513513    }
    514     psTrace(__func__, 3, "---- %s(true) end ----\n", __func__);
     514    psTrace("psLib.math", 3, "---- %s(true) end ----\n", __func__);
    515515    return(true);
    516516}
  • trunk/psLib/src/math/psMinimizePolyFit.c

    r7766 r8245  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-06-30 02:20:06 $
     12 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-08-09 02:26:44 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    470470    const psVector *x)
    471471{
    472     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     472    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    473473    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    474474    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
     
    488488
    489489    if (psTraceGetLevel(__func__) >= 6) {
    490         psTrace(__func__, 6, "VectorFitPolynomial1D()\n");
     490        psTrace("psLib.math", 6, "VectorFitPolynomial1D()\n");
    491491        for (psS32 i = 0; i < f->n; i++) {
    492             psTrace(__func__, 6, "(x, f, fErr) is (");
     492            psTrace("psLib.math", 6, "(x, f, fErr) is (");
    493493            if (x != NULL) {
    494                 psTrace(__func__, 6, "%f, %f, ", x->data.F64[i], f->data.F64[i]);
     494                psTrace("psLib.math", 6, "%f, %f, ", x->data.F64[i], f->data.F64[i]);
    495495            } else {
    496                 psTrace(__func__, 6, "%f, %f, ", (psF64) i, f->data.F64[i]);
     496                psTrace("psLib.math", 6, "%f, %f, ", (psF64) i, f->data.F64[i]);
    497497            }
    498498            if (fErr != NULL) {
    499                 psTrace(__func__, 6, "%f)\n", fErr->data.F64[i]);
     499                psTrace("psLib.math", 6, "%f)\n", fErr->data.F64[i]);
    500500            } else {
    501                 psTrace(__func__, 6, "NULL)\n");
     501                psTrace("psLib.math", 6, "NULL)\n");
    502502            }
    503503        }
     
    516516        psFree(A);
    517517        psFree(B);
    518         psTrace(__func__, 4, "---- %s() End ----\n", __func__);
     518        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
    519519        return(NULL);
    520520    }
     
    645645    psFree(B);
    646646
    647     psTrace(__func__, 4, "---- %s() End ----\n", __func__);
     647    psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
    648648    return (myPoly);
    649649}
     
    754754    const psVector *xIn)
    755755{
    756     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     756    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    757757    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    758758    PS_ASSERT_PTR_NON_NULL(stats, NULL);
     
    811811    // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
    812812    stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    813     psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
    814     psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
     813    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
     814    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
    815815
    816816    //
    817817    for (psS32 N = 0; N < stats->clipIter; N++) {
    818         psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
     818        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
    819819        psS32 Nkeep = 0;
    820820        if (psTraceGetLevel(__func__) >= 6) {
    821821            if (mask != NULL) {
    822822                for (psS32 i = 0 ; i < mask->n ; i++) {
    823                     psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
     823                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
    824824                }
    825825            }
     
    851851                for (psS32 i = 0 ; i < mask->n ; i++) {
    852852                    if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
    853                         psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
     853                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
    854854                                i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
    855855                    }
     
    859859
    860860        stats  = psVectorStats(stats, resid, NULL, mask, maskValue);
    861         psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
    862         psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
     861        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
     862        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
    863863        psF32 minClipValue = -minClipSigma*stats->sampleStdev;
    864864        psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
     
    875875                    (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
    876876                if (f->type.type == PS_TYPE_F64) {
    877                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     877                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    878878                            i, fit->data.F64[i], i, resid->data.F64[i]);
    879879                } else {
    880                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     880                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    881881                            i, fit->data.F32[i], i, resid->data.F64[i]);
    882882                }
     
    894894        // since the polynomial fit won't change.
    895895        //
    896         psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
     896        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
    897897        psFree(fit);
    898898    }
     
    905905    psFree(resid);
    906906
    907     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     907    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    908908    return (poly);
    909909}
     
    931931    const psVector *y)
    932932{
    933     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     933    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    934934    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    935935    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     
    967967        psFree(A);
    968968        psFree(B);
    969         psTrace(__func__, 4, "---- %s() End ----\n", __func__);
     969        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
    970970        return(NULL);
    971971    }
     
    10451045    psFree(B);
    10461046
    1047     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     1047    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    10481048    return (myPoly);
    10491049}
     
    12011201    const psVector *y)
    12021202{
    1203     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     1203    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    12041204    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    12051205    PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
     
    12461246    // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
    12471247    stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    1248     psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
    1249     psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
     1248    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
     1249    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
    12501250
    12511251    for (psS32 N = 0; N < stats->clipIter; N++) {
    1252         psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
     1252        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
    12531253        psS32 Nkeep = 0;
    12541254        if (psTraceGetLevel(__func__) >= 6) {
    12551255            if (mask != NULL) {
    12561256                for (psS32 i = 0 ; i < mask->n ; i++) {
    1257                     psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
     1257                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
    12581258                }
    12591259            }
     
    12861286                for (psS32 i = 0 ; i < mask->n ; i++) {
    12871287                    if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
    1288                         psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
     1288                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
    12891289                                i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
    12901290                    }
     
    13001300            return(NULL);
    13011301        }
    1302         psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
    1303         psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
     1302        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
     1303        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
    13041304        psF32 minClipValue = -minClipSigma*stats->sampleStdev;
    13051305        psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
     
    13161316                    (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
    13171317                if (fit->type.type == PS_TYPE_F64) {
    1318                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     1318                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    13191319                            i, fit->data.F64[i], i, resid->data.F64[i]);
    13201320                } else {
    1321                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     1321                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    13221322                            i, fit->data.F32[i], i, resid->data.F64[i]);
    13231323                }
     
    13311331        }
    13321332
    1333         psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
     1333        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
    13341334        psFree(fit);
    13351335    }
     
    13421342    }
    13431343
    1344     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     1344    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    13451345    return(poly);
    13461346}
     
    13691369    const psVector *z)
    13701370{
    1371     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1371    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    13721372    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    13731373    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     
    14111411        psFree(A);
    14121412        psFree(B);
    1413         psTrace(__func__, 4, "---- %s() End ----\n", __func__);
     1413        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
    14141414        return(NULL);
    14151415    }
     
    15431543    psFree(B);
    15441544
    1545     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     1545    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    15461546    return (myPoly);
    15471547}
     
    17161716    const psVector *z)
    17171717{
    1718     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     1718    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    17191719    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    17201720    PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
     
    17661766    // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
    17671767    stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    1768     psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
    1769     psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
     1768    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
     1769    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
    17701770
    17711771    for (psS32 N = 0; N < stats->clipIter; N++) {
    1772         psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
     1772        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial1D()\n");
    17731773        psS32 Nkeep = 0;
    17741774        if (psTraceGetLevel(__func__) >= 6) {
    17751775            if (mask != NULL) {
    17761776                for (psS32 i = 0 ; i < mask->n ; i++) {
    1777                     psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
     1777                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
    17781778                }
    17791779            }
     
    18051805                for (psS32 i = 0 ; i < mask->n ; i++) {
    18061806                    if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
    1807                         psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
     1807                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
    18081808                                i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
    18091809                    }
     
    18201820        }
    18211821
    1822         psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
    1823         psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
     1822        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
     1823        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
    18241824        psF32 minClipValue = -minClipSigma*stats->sampleStdev;
    18251825        psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
     
    18361836                    (resid->data.F64[i] - stats->sampleMedian < minClipValue))  {
    18371837                if (f->type.type == PS_TYPE_F64) {
    1838                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     1838                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    18391839                            i, fit->data.F64[i], i, resid->data.F64[i]);
    18401840                } else {
    1841                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     1841                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    18421842                            i, fit->data.F32[i], i, resid->data.F64[i]);
    18431843                }
     
    18511851        }
    18521852
    1853         psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
     1853        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
    18541854        psFree(fit);
    18551855    }
     
    18621862    }
    18631863
    1864     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     1864    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    18651865    return(poly);
    18661866}
     
    18881888    const psVector *t)
    18891889{
    1890     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1890    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    18911891    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    18921892    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     
    19341934        psFree(A);
    19351935        psFree(B);
    1936         psTrace(__func__, 4, "---- %s() End ----\n", __func__);
     1936        psTrace("psLib.math", 4, "---- %s() End ----\n", __func__);
    19371937        return(NULL);
    19381938    }
     
    20792079    psFree(B);
    20802080
    2081     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     2081    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    20822082    return (myPoly);
    20832083}
     
    22772277    const psVector *t)
    22782278{
    2279     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     2279    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    22802280    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    22812281    PS_ASSERT_POLY_TYPE(poly, PS_POLYNOMIAL_ORD, NULL);
     
    23312331    // for now, for the SAMPLE_MEDIAN and SAMPLE_STDEV to be used
    23322332    stats->options |= (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    2333     psTrace(__func__, 4, "stats->clipIter is %d\n", stats->clipIter);
    2334     psTrace(__func__, 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
     2333    psTrace("psLib.math", 4, "stats->clipIter is %d\n", stats->clipIter);
     2334    psTrace("psLib.math", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma);
    23352335
    23362336    for (psS32 N = 0; N < stats->clipIter; N++) {
    2337         psTrace(__func__, 6, "Loop iteration %d.  Calling psVectorFitPolynomial4D()\n");
     2337        psTrace("psLib.math", 6, "Loop iteration %d.  Calling psVectorFitPolynomial4D()\n");
    23382338        psS32 Nkeep = 0;
    23392339        if (psTraceGetLevel(__func__) >= 6) {
    23402340            if (mask != NULL) {
    23412341                for (psS32 i = 0 ; i < mask->n ; i++) {
    2342                     psTrace(__func__, 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
     2342                    psTrace("psLib.math", 6,  "mask[%d] is %d\n", i, mask->data.U8[i]);
    23432343                }
    23442344            }
     
    23712371                for (psS32 i = 0 ; i < mask->n ; i++) {
    23722372                    if (!((mask != NULL) && (mask->data.U8[i] & maskValue))) {
    2373                         psTrace(__func__, 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
     2373                        psTrace("psLib.math", 6,  "(f, fit)[%d] is (%f, %f).  resid is (%f)\n",
    23742374                                i, f->data.F32[i], fit->data.F32[i], resid->data.F64[i]);
    23752375                    }
     
    23852385            return(NULL);
    23862386        }
    2387         psTrace(__func__, 6, "Median is %f\n", stats->sampleMedian);
    2388         psTrace(__func__, 6, "Stdev is %f\n", stats->sampleStdev);
     2387        psTrace("psLib.math", 6, "Median is %f\n", stats->sampleMedian);
     2388        psTrace("psLib.math", 6, "Stdev is %f\n", stats->sampleStdev);
    23892389        psF32 minClipValue = -minClipSigma*stats->sampleStdev;
    23902390        psF32 maxClipValue = +maxClipSigma*stats->sampleStdev;
     
    24012401                    (resid->data.F64[i] - stats->sampleMedian < minClipValue)) {
    24022402                if (f->type.type == PS_TYPE_F64) {
    2403                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     2403                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    24042404                            i, fit->data.F64[i], i, resid->data.F64[i]);
    24052405                } else {
    2406                     psTrace(__func__, 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
     2406                    psTrace("psLib.math", 6, "Masking element %d (%f).  resid->data.F64[%d] is %f\n",
    24072407                            i, fit->data.F32[i], i, resid->data.F64[i]);
    24082408                }
     
    24172417        }
    24182418
    2419         psTrace(__func__, 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
     2419        psTrace("psLib.math", 6, "keeping %d of %d pts for fit\n", Nkeep, x->n);
    24202420        psFree (fit);
    24212421    }
     
    24282428    }
    24292429
    2430     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     2430    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    24312431    return(poly);
    24322432}
  • trunk/psLib/src/math/psMinimizePowell.c

    r7766 r8245  
    1111 *  NOTE: XXX: The SDR is silent about data types.  F32 is implemented here.
    1212 *
    13  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2006-06-30 02:20:06 $
     13 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-08-09 02:26:44 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    117117    psBool boolLineIsNull = true;
    118118
    119     psTrace(__func__, 4, "---- p_psDetermineBracket() begin ----\n");
     119    psTrace("psLib.math", 4, "---- p_psDetermineBracket() begin ----\n");
    120120
    121121    // If the line vector is zero, then return NULL.
    122122    PS_VECTOR_WITH_MASK_F32_CHECK_ZERO_VECTOR(params, paramMask, boolLineIsNull);
    123123    if (boolLineIsNull == true) {
    124         psTrace(__func__, 2, "p_psDetermineBracket() called with zero line vector.\n");
    125         psTrace(__func__, 4, "---- p_psDetermineBracket() end (NULL) ----\n");
     124        psTrace("psLib.math", 2, "p_psDetermineBracket() called with zero line vector.\n");
     125        psTrace("psLib.math", 4, "---- p_psDetermineBracket() end (NULL) ----\n");
    126126        psFree(bracket);
    127127        return(NULL);
     
    155155    }
    156156
    157     psTrace(__func__, 6, "(a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc);
     157    psTrace("psLib.math", 6, "(a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc);
    158158
    159159    while (iter > 0) {
    160         psTrace(__func__, 6, "psDetermineBracket(): iteration %d\n", iter);
     160        psTrace("psLib.math", 6, "psDetermineBracket(): iteration %d\n", iter);
    161161        if ((fb < fa) && (fb < fc)) {
    162162            bracket->data.F32[0] = a;
     
    164164            bracket->data.F32[2] = c;
    165165            psFree(tmp);
    166             psTrace(__func__, 6, "---- p_psDetermineBracket() end ----\n");
     166            psTrace("psLib.math", 6, "---- p_psDetermineBracket() end ----\n");
    167167            return(bracket);
    168168        }
     
    177177        fc = func(tmp, coords);
    178178
    179         psTrace(__func__, 6, "Iter(%d): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc);
     179        psTrace("psLib.math", 6, "Iter(%d): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc);
    180180
    181181        if (fa < fb) {
     
    195195            bracket->data.F32[2] = c;
    196196            psFree(tmp);
    197             psTrace(__func__, 4, "---- p_psDetermineBracket() end ----\n");
     197            psTrace("psLib.math", 4, "---- p_psDetermineBracket() end ----\n");
    198198            return(bracket);
    199199        }
     
    204204            bracket->data.F32[2] = c;
    205205            psFree(tmp);
    206             psTrace(__func__, 4, "---- p_psDetermineBracket() end ----\n");
     206            psTrace("psLib.math", 4, "---- p_psDetermineBracket() end ----\n");
    207207            return(bracket);
    208208        }
     
    213213    psFree(tmp);
    214214    psFree(bracket);
    215     psTrace(__func__, 4, "---- p_psDetermineBracket() end (NULL) ----\n");
     215    psTrace("psLib.math", 4, "---- p_psDetermineBracket() end (NULL) ----\n");
    216216    return(NULL);
    217217}
     
    228228    bracket->data.F32[2] = a; \
    229229} \
    230 psTrace(__func__, 4, "Final bracket (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc); \
    231 psTrace(__func__, 4, "---- p_psDetermineBracket() end ----\n"); \
     230psTrace("psLib.math", 4, "Final bracket (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", a, b, c, fa, fb, fc); \
     231psTrace("psLib.math", 4, "---- p_psDetermineBracket() end ----\n"); \
    232232psFree(tmp); \
    233233return(bracket); \
     
    253253    psS32 countMin = 0;
    254254
    255     psTrace(__func__, 4, "---- p_psDetermineBracket() begin ----\n");
     255    psTrace("psLib.math", 4, "---- p_psDetermineBracket() begin ----\n");
    256256
    257257    // If the line vector is zero, then return NULL.
    258258    PS_VECTOR_WITH_MASK_F32_CHECK_ZERO_VECTOR(params, paramMask, boolLineIsNull);
    259259    if (boolLineIsNull == true) {
    260         psTrace(__func__, 2, "p_psDetermineBracket() called with zero line vector.\n");
    261         psTrace(__func__, 4, "---- p_psDetermineBracket() end (NULL) ----\n");
     260        psTrace("psLib.math", 2, "p_psDetermineBracket() called with zero line vector.\n");
     261        psTrace("psLib.math", 4, "---- p_psDetermineBracket() end (NULL) ----\n");
    262262        psFree(tmp);
    263263        return(NULL);
     
    289289    iter = 0;
    290290    while (iter < PS_DETERMINE_BRACKET_MAX_ITERATIONS) {
    291         psTrace(__func__, 6, "psDetermineBracket(): iterationA %d\n", iter);
     291        psTrace("psLib.math", 6, "psDetermineBracket(): iterationA %d\n", iter);
    292292        c+= (1.0 + PS_DETERMINE_BRACKET_STEP_SIZE) * (c - a);
    293293
     
    295295        fc = func(tmp, coords);
    296296
    297         psTrace(__func__, 6, "Iteration(%d) (bracket): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc);
     297        psTrace("psLib.math", 6, "Iteration(%d) (bracket): (a, b, c) is (%f %f %f) (fa, fb, fc) is (%f %f %f)\n", iter, a, b, c, fa, fb, fc);
    298298
    299299        if ((fb < fa) && (fb < fc)) {
     
    320320
    321321    psFree(bracket);
    322     psTrace(__func__, 4, "---- p_psDetermineBracket() end (NULL) (BAD) ----\n");
     322    psTrace("psLib.math", 4, "---- p_psDetermineBracket() end (NULL) (BAD) ----\n");
    323323    return(NULL);
    324324}
     
    371371    psS32 numIterations = 0;
    372372
    373     psTrace(__func__, 4, "---- LineMin() begin ----\n");
     373    psTrace("psLib.math", 4, "---- LineMin() begin ----\n");
    374374    PS_VECTOR_F32_CHECK_ZERO_VECTOR(line, boolLineIsNull);
    375375
    376376    if (boolLineIsNull == true) {
    377377        min->value = func(params, coords);
    378         psTrace(__func__, 2, "LineMin() called with zero line vector.  Return 0.0.  Function value is %f\n", min->value);
     378        psTrace("psLib.math", 2, "LineMin() called with zero line vector.  Return 0.0.  Function value is %f\n", min->value);
    379379        return(0.0);
    380380    }
     
    382382    if (6 <= psTraceGetLevel(__func__)) {
    383383        for (i=0;i<params->n;i++) {
    384             psTrace(__func__, 6, "(params, paramMask, line)[%d] is (%f %d %f)\n", i,
     384            psTrace("psLib.math", 6, "(params, paramMask, line)[%d] is (%f %d %f)\n", i,
    385385                    params->data.F32[i], paramMask->data.U8[i], line->data.F32[i]);
    386386        }
     
    402402    while (numIterations < PS_LINEMIN_MAX_ITERATIONS) {
    403403        numIterations++;
    404         psTrace(__func__, 6, "LineMin(): iteration %d\n", numIterations);
     404        psTrace("psLib.math", 6, "LineMin(): iteration %d\n", numIterations);
    405405
    406406        a = bracket->data.F32[0];
     
    413413        fb = func(tmpb, coords);
    414414        fc = func(tmpc, coords);
    415         psTrace(__func__, 6, "LineMin: f(%f %f %f) is (%f %f %f)\n", a, b, c, fa, fb, fc);
     415        psTrace("psLib.math", 6, "LineMin: f(%f %f %f) is (%f %f %f)\n", a, b, c, fa, fb, fc);
    416416
    417417        // We determine which is the biggest segment in [a,b,c] then split
     
    449449            }
    450450        }
    451         psTrace(__func__, 6, "LineMin: new bracket is (%f %f %f)\n", bracket->data.F32[0], bracket->data.F32[1], bracket->data.F32[2]);
     451        psTrace("psLib.math", 6, "LineMin: new bracket is (%f %f %f)\n", bracket->data.F32[0], bracket->data.F32[1], bracket->data.F32[2]);
    452452
    453453        mul = bracket->data.F32[1];
     
    456456            min->value = func(params, coords);
    457457            psFree(bracket);
    458             psTrace(__func__, 4, "---- LineMin() end.a (%f) (%f) ----\n", mul, min->value);
     458            psTrace("psLib.math", 4, "---- LineMin() end.a (%f) (%f) ----\n", mul, min->value);
    459459            psFree(tmpa);
    460460            psFree(tmpb);
     
    468468    PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, params, mul);
    469469    min->value = func(params, coords);
    470     psTrace(__func__, 4, "---- LineMin() end.b (%f) %f ----\n", mul, min->value);
     470    psTrace("psLib.math", 4, "---- LineMin() end.b (%f) %f ----\n", mul, min->value);
    471471
    472472    psFree(bracket);
     
    517517    psS32 iterationNumber = 0;
    518518
    519     psTrace(__func__, 4, "---- psMinimizePowell() begin ----\n");
    520     psTrace(__func__, 6, "min->maxIter is %d\n", min->maxIter);
    521     psTrace(__func__, 6, "min->tol is %f\n", min->tol);
     519    psTrace("psLib.math", 4, "---- psMinimizePowell() begin ----\n");
     520    psTrace("psLib.math", 6, "min->maxIter is %d\n", min->maxIter);
     521    psTrace("psLib.math", 6, "min->tol is %f\n", min->tol);
    522522
    523523    if (paramMask == NULL) {
     
    562562    while (iterationNumber < min->maxIter) {
    563563        iterationNumber++;
    564         psTrace(__func__, 6, "psMinimizePowell() iteration %d\n", iterationNumber);
     564        psTrace("psLib.math", 6, "psMinimizePowell() iteration %d\n", iterationNumber);
    565565
    566566        // 3: For each dimension in params, move Q only in the vector v[i] to
     
    569569        baseFuncVal = func(Q, coords);
    570570        currFuncVal = baseFuncVal;
    571         psTrace(__func__, 6, "Current function value is %f\n", currFuncVal);
     571        psTrace("psLib.math", 6, "Current function value is %f\n", currFuncVal);
    572572
    573573        biggestDiff = 0;
     
    588588                    return(false);
    589589                }
    590                 psTrace(__func__, 6, "LineMin along dimension %d has multiple %f\n", i, mul);
     590                psTrace("psLib.math", 6, "LineMin along dimension %d has multiple %f\n", i, mul);
    591591
    592592                if (fabs(dummyMin.value - currFuncVal) > biggestDiff) {
     
    598598            // XXX: how can it be that we are not saving mul anywhere?
    599599        }
    600         psTrace(__func__, 6, "New function value is %f\n", currFuncVal);
     600        psTrace("psLib.math", 6, "New function value is %f\n", currFuncVal);
    601601        // XXX: There must be a bug here.  How can currFuncVal be the current function value?
    602602        // It is simply the minimum along one of the parameter dimensions.
     
    608608                u->n++;
    609609
    610                 psTrace(__func__, 6, "u[i]=Q[i]-P[i] (%f = %f - %f)\n", u->data.F32[i],
     610                psTrace("psLib.math", 6, "u[i]=Q[i]-P[i] (%f = %f - %f)\n", u->data.F32[i],
    611611                        Q->data.F32[i],
    612612                        params->data.F32[i]);
     
    620620        // 5: Move Q only in the direction u, and minimize the function.
    621621        for (i=0;i<numDims;i++) {
    622             psTrace(__func__, 6, "u[i] is %f\n", u->data.F32[i]);
     622            psTrace("psLib.math", 6, "u[i] is %f\n", u->data.F32[i]);
    623623        }
    624624
     
    643643            min->value = currFuncVal;
    644644            min->lastDelta = 0.0;
    645             psTrace(__func__, 4, "---- psMinimizePowell() end (1)(true) ----\n");
     645            psTrace("psLib.math", 4, "---- psMinimizePowell() end (1)(true) ----\n");
    646646            return(true);
    647647        }
     
    685685            min->iter = iterationNumber;
    686686            min->lastDelta = currFuncVal - baseFuncVal;
    687             psTrace(__func__, 4, "---- psMinimizePowell() end (2) (true) ----\n");
     687            psTrace("psLib.math", 4, "---- psMinimizePowell() end (2) (true) ----\n");
    688688            return(true);
    689689        }
     
    695695    psFree(Q);
    696696    min->iter = iterationNumber;
    697     psTrace(__func__, 4, "---- psMinimizePowell() end (0) (false) ----\n");
     697    psTrace("psLib.math", 4, "---- psMinimizePowell() end (0) (false) ----\n");
    698698    return(false);
    699699}
     
    712712    const psArray *coords)
    713713{
    714     psTrace(__func__, 4, "---- myPowellChi2Func() begin ----\n");
     714    psTrace("psLib.math", 4, "---- myPowellChi2Func() begin ----\n");
    715715    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
    716716    PS_ASSERT_VECTOR_NON_EMPTY(params, NAN);
     
    750750    }
    751751    psFree(tmp);
    752     psTrace(__func__, 4, "---- myPowellChi2Func() end (chi2 is %f) ----\n", chi2);
     752    psTrace("psLib.math", 4, "---- myPowellChi2Func() end (chi2 is %f) ----\n", chi2);
    753753    return(chi2);
    754754}
  • trunk/psLib/src/math/psPolynomial.c

    r8232 r8245  
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    9 *  @version $Revision: 1.148 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-08-08 23:32:23 $
     9*  @version $Revision: 1.149 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-08-09 02:26:44 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    217217    psF64 xSum = 1.0;
    218218
    219     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    220     psTrace(__func__, 4, "Polynomial order is %u\n", poly->nX);
     219    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     220    psTrace("psLib.math", 4, "Polynomial order is %u\n", poly->nX);
    221221    for (loop_x = 0; loop_x < poly->nX+1; loop_x++) {
    222         psTrace(__func__, 4, "Polynomial coeff[%u] is %lf\n", loop_x, poly->coeff[loop_x]);
     222        psTrace("psLib.math", 4, "Polynomial coeff[%u] is %lf\n", loop_x, poly->coeff[loop_x]);
    223223    }
    224224
    225225    for (loop_x = 0; loop_x < poly->nX+1; loop_x++) {
    226226        if (poly->mask[loop_x] == 0) {
    227             psTrace(__func__, 8,
     227            psTrace("psLib.math", 8,
    228228                    "polysum+= sum*coeff [%lf+= (%lf * %lf)\n", polySum, xSum, poly->coeff[loop_x]);
    229229            polySum += xSum * poly->coeff[loop_x];
     
    232232    }
    233233
    234     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     234    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    235235    return(polySum);
    236236}
     
    571571    psF32 tmp = 1.0;
    572572
    573     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     573    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    574574
    575575    if (normal == true) {
     
    577577    }
    578578
    579     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     579    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    580580    return(tmp * exp(-((x - mean) * (x - mean)) / (2.0 * sigma * sigma)));
    581581}
  • trunk/psLib/src/math/psSpline.c

    r8232 r8245  
    66*  This file contains the routines that allocate, free, and evaluate splines.
    77*
    8 *  @version $Revision: 1.151 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2006-08-08 23:32:23 $
     8*  @version $Revision: 1.152 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2006-08-09 02:26:44 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    119119    const psVector* y)                  ///< Coordinates
    120120{
    121     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     121    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    122122    if (psTraceGetLevel(__func__) >= 6) {
    123123        p_psVectorPrint(1, (psVector *) x, "x");
     
    143143        u[i] = ((6.0 * u[i] / (X[i+1] - X[i-1])) - (sig * u[i-1])) / p;
    144144
    145         psTrace(__func__, 6, "X[%d] is %f\n", i, X[i]);
    146         psTrace(__func__, 6, "Y[%d] is %f\n", i, Y[i]);
    147         psTrace(__func__, 6, "u[%d] is %f\n", i, u[i]);
     145        psTrace("psLib.math", 6, "X[%d] is %f\n", i, X[i]);
     146        psTrace("psLib.math", 6, "Y[%d] is %f\n", i, Y[i]);
     147        psTrace("psLib.math", 6, "u[%d] is %f\n", i, u[i]);
    148148    }
    149149
     
    154154    for (psS32 k=(n-2);k>=0;k--) {
    155155        derivs2[k] = derivs2[k] * derivs2[k+1] + u[k];
    156         psTrace(__func__, 6, "derivs2[%d] is %f\n", k, derivs2[k]);
     156        psTrace("psLib.math", 6, "derivs2[%d] is %f\n", k, derivs2[k]);
    157157    }
    158158    psFree(u);
    159     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     159    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    160160    return(derivs2);
    161161}
     
    210210    const psVector* y)                  ///< Coordinates.
    211211{
    212     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     212    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    213213    PS_ASSERT_VECTOR_NON_NULL(y, NULL);
    214214    PS_ASSERT_VECTOR_TYPE_F32_OR_F64(y, NULL);
    215215    PS_ASSERT_INT_LARGER_THAN_OR_EQUAL(y->n, 2, NULL);
    216216    psS32 numSplines = (y->n)-1;
    217     psTrace(__func__, 5, "numSplines is %d\n", numSplines);
     217    psTrace("psLib.math", 5, "numSplines is %d\n", numSplines);
    218218
    219219    //
     
    281281                    i, i+1, xPtr->data.F32[i], xPtr->data.F32[i+1]);
    282282        }
    283         psTrace(__func__, 6, "x data (%f - %f) (%f)\n", xPtr->data.F32[i], xPtr->data.F32[i+1], H);
     283        psTrace("psLib.math", 6, "x data (%f - %f) (%f)\n", xPtr->data.F32[i], xPtr->data.F32[i+1], H);
    284284        //
    285285        // ******** Calculate 0-order term ********
     
    334334        spline->spline[i]->coeff[3]+=  spline->p_psDeriv2[i+1] / (6.0 * H);
    335335
    336         psTrace(__func__, 6, "(spline->spline[%u])->coeff[0] is %f\n", i, spline->spline[i]->coeff[0]);
    337         psTrace(__func__, 6, "(spline->spline[%u])->coeff[1] is %f\n", i, spline->spline[i]->coeff[1]);
    338         psTrace(__func__, 6, "(spline->spline[%u])->coeff[2] is %f\n", i, spline->spline[i]->coeff[2]);
    339         psTrace(__func__, 6, "(spline->spline[%u])->coeff[3] is %f\n", i, spline->spline[i]->coeff[3]);
     336        psTrace("psLib.math", 6, "(spline->spline[%u])->coeff[0] is %f\n", i, spline->spline[i]->coeff[0]);
     337        psTrace("psLib.math", 6, "(spline->spline[%u])->coeff[1] is %f\n", i, spline->spline[i]->coeff[1]);
     338        psTrace("psLib.math", 6, "(spline->spline[%u])->coeff[2] is %f\n", i, spline->spline[i]->coeff[2]);
     339        psTrace("psLib.math", 6, "(spline->spline[%u])->coeff[3] is %f\n", i, spline->spline[i]->coeff[3]);
    340340    }
    341341
     
    343343        psFree(yPtr);
    344344    }
    345     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     345    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    346346    return(spline);
    347347}
     
    365365    float x)
    366366{
    367     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     367    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    368368    PS_ASSERT_PTR_NON_NULL(spline, NAN);
    369369    PS_ASSERT_INT_NONNEGATIVE(spline->n, NAN);
     
    379379
    380380        psS32 binNum = (x < spline->knots->data.F32[0]) ? 0 : n-1;
    381         psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     381        psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    382382        return(psPolynomial1DEval(spline->spline[binNum], x));
    383383    }
     
    392392    }
    393393
    394     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     394    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    395395    return(psPolynomial1DEval(spline->spline[binNum], x));
    396396}
     
    403403    const psVector *x)
    404404{
    405     psTrace(__func__, 3, "---- %s() begin ----\n", __func__);
     405    psTrace("psLib.math", 3, "---- %s() begin ----\n", __func__);
    406406    PS_ASSERT_PTR_NON_NULL(spline, NULL);
    407407    PS_ASSERT_VECTOR_TYPE(spline->knots, PS_TYPE_F32, NULL);
     
    426426    }
    427427
    428     psTrace(__func__, 3, "---- %s() end ----\n", __func__);
     428    psTrace("psLib.math", 3, "---- %s() end ----\n", __func__);
    429429    return(tmpVector);
    430430}
  • trunk/psLib/src/math/psStats.c

    r8232 r8245  
    1616 * use ->min and ->max (PS_STAT_USE_RANGE)
    1717 *
    18  *  @version $Revision: 1.183 $ $Name: not supported by cvs2svn $
    19  *  @date $Date: 2006-08-08 23:32:23 $
     18 *  @version $Revision: 1.184 $ $Name: not supported by cvs2svn $
     19 *  @date $Date: 2006-08-09 02:26:44 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    110110                             psStats* stats)
    111111{
    112     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     112    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    113113
    114114    psF32 mean = 0.0;                   // The mean
     
    221221    stats->sampleMean = mean;
    222222    if (isnan(mean)) {
    223         psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
     223        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    224224        return false;
    225225    }
    226226
    227     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     227    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    228228    return true;
    229229}
     
    240240                        )
    241241{
    242     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     242    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    243243    psF32 max = -PS_MAX_F32;            // The calculated maximum
    244244    psF32 min = PS_MAX_F32;             // The calculated minimum
     
    316316        stats->min = min;
    317317    }
    318     psTrace(__func__, 4, "---- %s(%d) end ----\n", __func__, numValid);
     318    psTrace("psLib.math", 4, "---- %s(%d) end ----\n", __func__, numValid);
    319319    return numValid;
    320320}
     
    332332                                psStats* stats)
    333333{
    334     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     334    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    335335    PS_ASSERT_VECTOR_NON_NULL(myVector, false);
    336336    PS_ASSERT_PTR_NON_NULL(stats, false);
     
    342342                        (stats->min <= myVector->data.F32[i]) &&
    343343                        (myVector->data.F32[i] <= stats->max)) {
    344                     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     344                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    345345                    return true;
    346346                }
     
    350350                if ((stats->min <= myVector->data.F32[i]) &&
    351351                        (myVector->data.F32[i] <= stats->max)) {
    352                     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     352                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    353353                    return true;
    354354                }
     
    359359            for (long i = 0; i < myVector->n; i++) {
    360360                if (!(maskVal & maskVector->data.U8[i])) {
    361                     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     361                    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    362362                    return true;
    363363                }
     
    365365        } else {
    366366            if (myVector->n > 0) {
    367                 psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     367                psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    368368                return true;
    369369            }
    370370        }
    371371    }
    372     psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
     372    psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    373373    return(false);
    374374}
     
    385385                               psStats* stats)
    386386{
    387     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     387    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    388388
    389389    // Allocate temporary vectors for the data.
     
    441441                false,
    442442                _("Failed to sort input data."));
    443         psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
     443        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    444444        psFree(vector);
    445445        return false;
     
    463463
    464464    // Return "true" on success.
    465     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     465    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    466466    return true;
    467467}
     
    475475                                   psF32 sigma)
    476476{
    477     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    478     psTrace(__func__, 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
     477    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     478    psTrace("psLib.math", 5, "(histogram->nums->n, sigma) is (%d, %.2f\n", (int) histogram->nums->n, sigma);
    479479    PS_ASSERT_PTR_NON_NULL(histogram, NULL);
    480480    PS_ASSERT_PTR_NON_NULL(histogram->bounds, NULL);
     
    564564        PS_VECTOR_PRINT_F32(smooth);
    565565    }
    566     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     566    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    567567    return(smooth);
    568568}
     
    586586                              psStats* stats)
    587587{
    588     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     588    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    589589
    590590    // This procedure requires the mean.  If it has not been already
     
    597597        stats->sampleStdev = NAN;
    598598        psLogMsg(__func__, PS_LOG_WARN, "WARNING: vectorSampleStdev(): vectorSampleMean() reported a NAN mean.\n");
    599         psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     599        psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    600600        return false;
    601601    }
     
    680680                                  (float)(count - 1));
    681681    }
    682     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     682    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    683683
    684684    return true;
     
    704704                              )
    705705{
    706     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    707     psTrace(__func__, 4, "Trace level is %d\n", psTraceGetLevel(__func__));
     706    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     707    psTrace("psLib.math", 4, "Trace level is %d\n", psTraceGetLevel(__func__));
    708708
    709709    // Ensure that stats->clipIter is within the proper range.
     
    739739        stats->clippedMean = NAN;
    740740        stats->clippedStdev = NAN;
    741         psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
     741        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    742742        psFree(tmpMask);
    743743        psFree(statsTmp);
    744744        return false;
    745745    }
    746     psTrace(__func__, 6, "The initial sample median is %f\n", statsTmp->sampleMedian);
     746    psTrace("psLib.math", 6, "The initial sample median is %f\n", statsTmp->sampleMedian);
    747747
    748748    // 2. Compute the sample standard deviation.
     
    752752        stats->clippedMean = NAN;
    753753        stats->clippedStdev = NAN;
    754         psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
     754        psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__);
    755755        psFree(tmpMask);
    756756        psFree(statsTmp);
    757757        return false;
    758758    }
    759     psTrace(__func__, 6, "The initial sample stdev is %f\n", statsTmp->sampleStdev);
     759    psTrace("psLib.math", 6, "The initial sample stdev is %f\n", statsTmp->sampleStdev);
    760760
    761761    // 3. Use the sample median as the first estimator of the mean X.
     
    770770    for (int iter = 0; iter < stats->clipIter && clipped; iter++) {
    771771        clipped = false;
    772         psTrace(__func__, 6, "------------ Iteration %d ------------\n", iter);
     772        psTrace("psLib.math", 6, "------------ Iteration %d ------------\n", iter);
    773773        // a) Exclude all values x_i for which |x_i - x| > K * stdev
    774774        if (errors) {
     
    777777                        fabsf(myVector->data.F32[j] - clippedMean) > stats->clipSigma * errors->data.F32[j]) {
    778778                    tmpMask->data.U8[j] = 0xff;
    779                     psTrace(__func__, 10, "Clipped %d: %f +/- %f\n", j,
     779                    psTrace("psLib.math", 10, "Clipped %d: %f +/- %f\n", j,
    780780                            myVector->data.F32[j], errors->data.F32[j]);
    781781                    numClipped++;
     
    788788                        fabsf(myVector->data.F32[j] - clippedMean) > (stats->clipSigma * clippedStdev)) {
    789789                    tmpMask->data.U8[j] = 0xff;
    790                     psTrace(__func__, 10, "Clipped %d: %f\n", j, myVector->data.F32[j]);
     790                    psTrace("psLib.math", 10, "Clipped %d: %f\n", j, myVector->data.F32[j]);
    791791                    numClipped++;
    792792                    clipped = true;
     
    798798        vectorSampleMean(myVector, errors, tmpMask, maskVal, statsTmp);
    799799        vectorSampleStdev(myVector, errors, tmpMask, maskVal, statsTmp);
    800         psTrace(__func__, 6, "The new sample mean is %f\n", statsTmp->sampleMean);
    801         psTrace(__func__, 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
     800        psTrace("psLib.math", 6, "The new sample mean is %f\n", statsTmp->sampleMean);
     801        psTrace("psLib.math", 6, "The new sample stdev is %f\n", statsTmp->sampleStdev);
    802802
    803803        // If the new mean and stdev are NAN, we must exit the loop.
     
    821821    if (stats->options & PS_STAT_CLIPPED_MEAN) {
    822822        stats->clippedMean = clippedMean;
    823         psTrace(__func__, 6, "The final clipped mean is %f\n", clippedMean);
     823        psTrace("psLib.math", 6, "The final clipped mean is %f\n", clippedMean);
    824824    }
    825825    // 8. The last calcuated value of stdev is the clipped stdev.
    826826    if (stats->options & PS_STAT_CLIPPED_STDEV) {
    827827        stats->clippedStdev = clippedStdev;
    828         psTrace(__func__, 6, "The final clipped stdev is %f\n", clippedStdev);
     828        psTrace("psLib.math", 6, "The final clipped stdev is %f\n", clippedStdev);
    829829    }
    830830
    831831    psFree(tmpMask);
    832832    psFree(statsTmp);
    833     psTrace(__func__, 4, "---- %s(true) end ----\n", __func__);
     833    psTrace("psLib.math", 4, "---- %s(true) end ----\n", __func__);
    834834    return true;
    835835}
     
    884884                                              )
    885885{
    886     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
    887     psTrace(__func__, 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
     886    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
     887    psTrace("psLib.math", 5, "binNum, yVal is (%d, %f)\n", binNum, yVal);
    888888    if (psTraceGetLevel(__func__) >= 8) {
    889889        PS_VECTOR_PRINT_F32(xVec);
     
    913913        y->data.F64[1] = yVec->data.F32[binNum];
    914914        y->data.F64[2] = yVec->data.F32[binNum + 1];
    915         psTrace(__func__, 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
     915        psTrace("psLib.math", 6, "x vec (orig) is (%f %f %f %f)\n", xVec->data.F32[binNum - 1],
    916916                xVec->data.F32[binNum], xVec->data.F32[binNum+1], xVec->data.F32[binNum+2]);
    917         psTrace(__func__, 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
    918         psTrace(__func__, 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
     917        psTrace("psLib.math", 6, "x data is (%f %f %f)\n", x->data.F64[0], x->data.F64[1], x->data.F64[2]);
     918        psTrace("psLib.math", 6, "y data is (%f %f %f)\n", y->data.F64[0], y->data.F64[1], y->data.F64[2]);
    919919
    920920        //
     
    937937            psFree(x);
    938938            psFree(y);
    939             psTrace(__func__, 5, "---- %s() end ----\n", __func__);
     939            psTrace("psLib.math", 5, "---- %s() end ----\n", __func__);
    940940            return NAN;
    941941        }
     
    949949            psFree(x);
    950950            psFree(y);
    951             psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
     951            psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
    952952            return NAN;
    953953        }
    954         psTrace(__func__, 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
    955         psTrace(__func__, 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
    956         psTrace(__func__, 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
    957         psTrace(__func__, 6, "Fitted y vec is (%f %f %f)\n",
     954        psTrace("psLib.math", 6, "myPoly->coeff[0] is %f\n", myPoly->coeff[0]);
     955        psTrace("psLib.math", 6, "myPoly->coeff[1] is %f\n", myPoly->coeff[1]);
     956        psTrace("psLib.math", 6, "myPoly->coeff[2] is %f\n", myPoly->coeff[2]);
     957        psTrace("psLib.math", 6, "Fitted y vec is (%f %f %f)\n",
    958958                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[0]),
    959959                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[1]),
    960960                (psF32) psPolynomial1DEval(myPoly, (psF64) x->data.F64[2]));
    961961
    962         psTrace(__func__, 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
     962        psTrace("psLib.math", 6, "We fit the polynomial, now find x such that f(x) equals %f\n", yVal);
    963963        tmpFloat = QuadraticInverse(myPoly->coeff[2], myPoly->coeff[1], myPoly->coeff[0], yVal,
    964964                                    x->data.F64[0], x->data.F64[2]);
     
    970970            psFree(x);
    971971            psFree(y);
    972             psTrace(__func__, 5, "---- %s(NAN) end ----\n", __func__);
     972            psTrace("psLib.math", 5, "---- %s(NAN) end ----\n", __func__);
    973973            return(NAN);
    974974        }
     
    990990    }
    991991
    992     psTrace(__func__, 6, "FIT: return %f\n", tmpFloat);
     992    psTrace("psLib.math", 6, "FIT: return %f\n", tmpFloat);
    993993    psFree(x);
    994994    psFree(y);
    995995
    996     psTrace(__func__, 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
     996    psTrace("psLib.math", 5, "---- %s(%f) end ----\n", __func__, tmpFloat);
    997997    return tmpFloat;
    998998}
     
    10061006                                  )
    10071007{
    1008     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1008    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    10091009    PS_ASSERT_VECTOR_NON_NULL(params, NAN);
    10101010    PS_ASSERT_VECTOR_SIZE(params, 2, NAN);
     
    10281028
    10291029
    1030     psTrace(__func__, 4, "---- %s() end ----\n", __func__);
     1030    psTrace("psLib.math", 4, "---- %s() end ----\n", __func__);
    10311031    return gauss;
    10321032}
     
    10571057                              psStats* stats)
    10581058{
    1059     psTrace(__func__, 4, "---- %s() begin ----\n", __func__);
     1059    psTrace("psLib.math", 4, "---- %s() begin ----\n", __func__);
    10601060    if (psTraceGetLevel(__func__) >= 8) {
    10611061        PS_VECTOR_PRINT_F32(myVector);
     
    10851085    // Iterate to get the best bin size
    10861086    for (int iterate = 1; iterate > 0; iterate++) {
    1087         psTrace(__func__, 6,
     1087        psTrace("psLib.math", 6,
    10881088                "-------------------- Iterating on Bin size.  Iteration number %d --------------------\n",
    10891089                iterate);
     
    10981098            psFree(statsMinMax);
    10991099            psFree(mask);
    1100             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1100            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    11011101            return false;
    11021102        }
    1103         psTrace(__func__, 6, "Data min/max is (%.2f, %.2f)\n", min, max);
     1103        psTrace("psLib.math", 6, "Data min/max is (%.2f, %.2f)\n", min, max);
    11041104
    11051105        // If all data points have the same value, then we set the appropiate members of stats and return.
    11061106        if (fabs(max - min) <= FLT_EPSILON) {
    1107             psTrace(__func__, 5, "All data points have the same value: %f.\n", min);
     1107            psTrace("psLib.math", 5, "All data points have the same value: %f.\n", min);
    11081108            if (stats->options & PS_STAT_ROBUST_MEDIAN) {
    11091109                stats->robustMedian = min;
     
    11171117            psFree(mask);
    11181118
    1119             psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
     1119            psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
    11201120            return false;
    11211121        }
     
    11251125            // Set initial bin size to the specified value.
    11261126            binSize = stats->binsize;
    1127             psTrace(__func__, 6, "Setting initial robust bin size to %.2f\n", binSize);
     1127            psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
    11281128        } else {
    11291129            // Determine the bin size of the robust histogram, using the pre-defined number of bins
    11301130            binSize = (max - min) / INITIAL_NUM_BINS;
    11311131        }
    1132         psTrace(__func__, 6, "Initial robust bin size is %.2f\n", binSize);
     1132        psTrace("psLib.math", 6, "Initial robust bin size is %.2f\n", binSize);
    11331133
    11341134        // ADD step 0: Construct the histogram with the specified bin size.  NOTE: we can not specify the bin
     
    11361136        // we get here, we know that binSize != 0.0.
    11371137        long numBins = (max - min) / binSize; // Number of bins
    1138         psTrace(__func__, 6, "Numbins is %d\n", numBins);
    1139         psTrace(__func__, 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
     1138        psTrace("psLib.math", 6, "Numbins is %d\n", numBins);
     1139        psTrace("psLib.math", 6, "Creating a robust histogram from data range (%.2f - %.2f)\n", min, max);
    11401140        // Generate the histogram
    11411141        histogram = psHistogramAlloc(min, max, numBins);
     
    11591159        // ADD step 2: Find the bin which contains the 50% data point.
    11601160        totalDataPoints = cumulative->nums->data.F32[numBins - 1];
    1161         psTrace(__func__, 6, "Total data points is %d\n", totalDataPoints);
     1161        psTrace("psLib.math", 6, "Total data points is %d\n", totalDataPoints);
    11621162        long binMedian;
    11631163        if (totalDataPoints/2.0 < cumulative->nums->data.F32[0]) {
     
    11751175                psFree(cumulative);
    11761176                psFree(mask);
    1177                 psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1177                psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    11781178                return false;
    11791179            }
    11801180        }
    1181         psTrace(__func__, 6, "The median bin is %d (%.2f to %.2f)\n", binMedian,
     1181        psTrace("psLib.math", 6, "The median bin is %d (%.2f to %.2f)\n", binMedian,
    11821182                cumulative->bounds->data.F32[binMedian], cumulative->bounds->data.F32[binMedian+1]);
    11831183
     
    11921192            psFree(cumulative);
    11931193            psFree(mask);
    1194             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1194            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    11951195            return false;
    11961196        }
    1197         psTrace(__func__, 6, "Current robust median is %f\n", stats->robustMedian);
     1197        psTrace("psLib.math", 6, "Current robust median is %f\n", stats->robustMedian);
    11981198
    11991199        // ADD step 4: Find the bins which contains the 15.8655% and 84.1345% data points.
     
    12171217            }
    12181218        }
    1219         psTrace(__func__, 6, "The 15.8655%% and 84.1345%% data point bins are (%d, %d).\n",
     1219        psTrace("psLib.math", 6, "The 15.8655%% and 84.1345%% data point bins are (%d, %d).\n",
    12201220                binLo, binHi);
    1221         psTrace(__func__, 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
    1222         psTrace(__func__, 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
     1221        psTrace("psLib.math", 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
     1222        psTrace("psLib.math", 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
    12231223
    12241224        if ((binLo < 0) || (binHi < 0)) {
     
    12281228            psFree(cumulative);
    12291229            psFree(mask);
    1230             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1230            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    12311231            return false;
    12321232        }
     
    12441244        float binHiF32 = fitQuadraticSearchForYThenReturnX(cumulative->bounds, cumulative->nums, binHi,
    12451245                         totalDataPoints * 0.841345f);
    1246         psTrace(__func__, 6, "The exact 15.8655%% and 84.1345%% data point positions are: (%f, %f)\n",
     1246        psTrace("psLib.math", 6, "The exact 15.8655%% and 84.1345%% data point positions are: (%f, %f)\n",
    12471247                binLoF32, binHiF32);
    12481248        #else
    12491249        // This code basically interpolates to find the positions exactly.
    1250         psTrace(__func__, 6, "binLo is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
     1250        psTrace("psLib.math", 6, "binLo is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
    12511251                binLo, cumulative->nums->data.F32[binLo], cumulative->nums->data.F32[binLo+1]);
    1252         psTrace(__func__, 6, "binHi is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
     1252        psTrace("psLib.math", 6, "binHi is %d.  Nums at that bin and the next are (%.2f, %.2f)\n",
    12531253                binHi, cumulative->nums->data.F32[binHi], cumulative->nums->data.F32[binHi+1]);
    12541254
     
    12661266        float base = cumulative->bounds->data.F32[binLo];
    12671267        float binLoF32 = base + (deltaBounds / deltaNums) * percentNums; // Value for the 15.8655% mark
    1268         psTrace(__func__, 6,
     1268        psTrace("psLib.math", 6,
    12691269                "(base, deltaBounds, deltaNums, prevPixels, percentNums) is (%.2f %.2f %.2f %.2f %.2f)\n",
    12701270                base, deltaBounds, deltaNums, prevPixels, percentNums);
     
    12811281        base = cumulative->bounds->data.F32[binHi];
    12821282        float binHiF32 = base + (deltaBounds / deltaNums) * percentNums; // Value for the 84.1345% mark
    1283         psTrace(__func__, 6,
     1283        psTrace("psLib.math", 6,
    12841284                "(base, deltaBounds, deltaNums, prevPixels, percentNums) is (%.2f %.2f %.2f %.2f %.2f)\n",
    12851285                base, deltaBounds, deltaNums, prevPixels, percentNums);
    1286         psTrace(__func__, 6,
     1286        psTrace("psLib.math", 6,
    12871287                "The exact 15.8655 and 84.1345 percent data point positions are: (%f, %f)\n",
    12881288                binLoF32, binHiF32);
     
    12911291        // ADD step 5: Determine SIGMA as 1/2 of the distance between these positions.
    12921292        sigma = (binHiF32 - binLoF32) / 2.0;
    1293         psTrace(__func__, 6, "The current sigma is %f.\n", sigma);
     1293        psTrace("psLib.math", 6, "The current sigma is %f.\n", sigma);
    12941294        stats->robustStdev = sigma;
    12951295
     
    12971297        // than 25 bins from the median, recalculate the bin size, and perform the algorithm again.
    12981298        if (sigma < (2 * binSize)) {
    1299             psTrace(__func__, 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
     1299            psTrace("psLib.math", 6, "*************: Do another iteration (%f %f).\n", sigma, binSize);
    13001300            long maskLo = PS_MAX(0, (binMedian - 25)); // Low index for masking region
    13011301            long maskHi = PS_MIN(histogram->bounds->n - 1, (binMedian + 25)); // High index for masking
    13021302            psF32 medianLo = histogram->bounds->data.F32[maskLo]; // Value at low index
    13031303            psF32 medianHi = histogram->bounds->data.F32[maskHi]; // Value at high index
    1304             psTrace(__func__, 6, "Masking data more than 25 bins from the median\n");
    1305             psTrace(__func__, 6,
     1304            psTrace("psLib.math", 6, "Masking data more than 25 bins from the median\n");
     1305            psTrace("psLib.math", 6,
    13061306                    "The median is at bin number %d.  We mask bins outside the bin range (%d:%d)\n",
    13071307                    binMedian, maskLo, maskHi);
    1308             psTrace(__func__, 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
     1308            psTrace("psLib.math", 6, "Masking data outside (%f %f)\n", medianLo, medianHi);
    13091309            for (long i = 0 ; i < myVector->n ; i++) {
    13101310                if ((myVector->data.F32[i] < medianLo) || (myVector->data.F32[i] > medianHi)) {
    13111311                    mask->data.U8[i] = 0xff;
    1312                     psTrace(__func__, 6, "Masking element %d is %f\n", i, myVector->data.F32[i]);
     1312                    psTrace("psLib.math", 6, "Masking element %d is %f\n", i, myVector->data.F32[i]);
    13131313                }
    13141314            }
     
    13181318        } else {
    13191319            // We've got the bin size correct now
    1320             psTrace(__func__, 6, "*************: No more iteration.  sigma is %f\n", sigma);
     1320            psTrace("psLib.math", 6, "*************: No more iteration.  sigma is %f\n", sigma);
    13211321            iterate = -1;
    13221322        }
     
    13471347        psFree(cumulative);
    13481348        psFree(mask);
    1349         psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1349        psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    13501350        return false;
    13511351    }
    1352     psTrace(__func__, 6, "The 25-percent and 75-precent data point bins are (%d, %d).\n", binLo25, binHi25);
     1352    psTrace("psLib.math", 6, "The 25-percent and 75-precent data point bins are (%d, %d).\n", binLo25, binHi25);
    13531353
    13541354    // ADD step 8: Interpolate to find these two positions exactly: these are the upper and lower quartile
     
    13651365        psFree(statsMinMax);
    13661366        psFree(mask);
    1367         psTrace(__func__, 4, "---- %s(1) end  ----\n", __func__);
     1367        psTrace("psLib.math", 4, "---- %s(1) end  ----\n", __func__);
    13681368        return false;
    13691369    }
     
    13711371    stats->robustLQ = binLo25F32;
    13721372    stats->robustUQ = binHi25F32;
    1373     psTrace(__func__, 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
     1373    psTrace("psLib.math", 6, "The 25 and 75 percent data point exact positions are (%f, %f).\n",
    13741374            binLo25F32, binHi25F32);
    13751375    long N50 = 0;
     
    13811381    }
    13821382    stats->robustN50 = N50;
    1383     psTrace(__func__, 6, "The robustN50 is %d.\n", N50);
     1383    psTrace("psLib.math", 6, "The robustN50 is %d.\n", N50);
    13841384
    13851385
     
    14051405            psFree(statsMinMax);
    14061406            psFree(mask);
    1407             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1407            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    14081408            return false;
    14091409        }
     
    14111411        // Calculate the number of bins.
    14121412        long numBins = (max - min) / newBinSize;
    1413         psTrace(__func__, 6, "The new min/max values are (%f, %f).\n", min, max);
    1414         psTrace(__func__, 6, "The new bin size is %f.\n", newBinSize);
    1415         psTrace(__func__, 6, "The numBins is %d\n", numBins);
     1413        psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
     1414        psTrace("psLib.math", 6, "The new bin size is %f.\n", newBinSize);
     1415        psTrace("psLib.math", 6, "The numBins is %d\n", numBins);
    14161416
    14171417        psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers)
     
    14481448            psFree(histogram);
    14491449            psFree(mask);
    1450             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1450            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    14511451            return false;
    14521452        }
     
    14601460            }
    14611461        }
    1462         psTrace(__func__, 6, "The peak bin is %d, with %f data.n", binNum, binMaxNums);
     1462        psTrace("psLib.math", 6, "The peak bin is %d, with %f data.n", binNum, binMaxNums);
    14631463
    14641464        // Fit a Gaussian to the bins in the range 20 sigma of the robust histogram median.
     
    14801480            psFree(histogram);
    14811481            psFree(mask);
    1482             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1482            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    14831483            return false;
    14841484        }
     
    15111511            psFree(histogram);
    15121512            psFree(statsMinMax);
    1513             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1513            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    15141514            return false;
    15151515        }
     
    15371537            psFree(params);
    15381538            psFree(mask);
    1539             psTrace(__func__, 4, "---- %s(false) end  ----\n", __func__);
     1539            psTrace("psLib.math", 4, "---- %s(false) end  ----\n", __func__);
    15401540            return false;
    15411541        }
     
    15461546        // The fitted mean is the Gaussian mean.
    15471547        stats->fittedMean = params->data.F32[0];
    1548         psTrace(__func__, 6, "The fitted mean is %f.\n", params->data.F32[0]);
     1548        psTrace("psLib.math", 6, "The fitted mean is %f.\n", params->data.F32[0]);
    15491549
    15501550        // The fitted standard deviation, SIGMA_r is determined by subtracting the smoothing scale in
    15511551        // quadrature: SIGMA_r^2 = SIGMA^2 - sigma_s^2
    15521552        stats->fittedStdev = sqrt(PS_SQR(params->data.F32[1]) - PS_SQR(newBinSize));
    1553         psTrace(__func__, 6, "The fitted stdev is %f.\n", stats->fittedStdev);
     1553        psTrace("psLib.math", 6, "The fitted stdev is %f.\n", stats->fittedStdev);
    15541554
    15551555        // Clean up after fitting
     
    15641564    psFree(mask);
    15651565
    1566     psTrace(__func__, 4, "---- %s(0) end  ----\n", __func__);
     1566    psTrace("psLib.math", 4, "---- %s(0) end  ----\n", __func__);
    15671567    return true;
    15681568}
     
    15871587psStats* psStatsAlloc(psStatsOptions options)
    15881588{
    1589     psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
     1589    psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
    15901590    psStats* newStruct = NULL;
    15911591
     
    16161616    newStruct->options = options;
    16171617
    1618     psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
     1618    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
    16191619    return (newStruct);
    16201620}
     
    16451645psHistogram* psHistogramAlloc(float lower, float upper, int n)
    16461646{
    1647     psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
    1648     psTrace(__func__, 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
     1647    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
     1648    psTrace("psLib.math", 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
    16491649    PS_ASSERT_INT_POSITIVE(n, NULL);
    16501650    PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(upper, lower, NULL);
     
    16781678    newHist->uniform = true;
    16791679
    1680     psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
     1680    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
    16811681    return newHist;
    16821682}
     
    16931693psHistogram* psHistogramAllocGeneric(const psVector* bounds)
    16941694{
    1695     psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
     1695    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
    16961696    PS_ASSERT_VECTOR_NON_NULL(bounds, NULL);
    16971697    PS_ASSERT_VECTOR_TYPE(bounds, PS_TYPE_F32, NULL);
     
    17211721    newHist->uniform = false;
    17221722
    1723     psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
     1723    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
    17241724    return (newHist);
    17251725}
     
    17571757                               )
    17581758{
    1759     psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
     1759    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
    17601760    PS_ASSERT_PTR_NON_NULL(out, false);
    17611761    PS_ASSERT_PTR_NON_NULL(out->bounds, false);
     
    17941794    if (boxcarLeftBinNum == boxcarRightBinNum) {
    17951795        out->nums->data.F32[binNum] += 1.0;
    1796         psTrace(__func__, 3, "---- %s(true) end  ----\n", __func__);
     1796        psTrace("psLib.math", 3, "---- %s(true) end  ----\n", __func__);
    17971797        return true;
    17981798    }
     
    18131813        (boxcarRight - out->bounds->data.F32[boxcarRightBinNum]) / boxcarWidth;
    18141814
    1815     psTrace(__func__, 3, "---- %s(true) end  ----\n", __func__);
     1815    psTrace("psLib.math", 3, "---- %s(true) end  ----\n", __func__);
    18161816    return true;
    18171817}
     
    18381838                               psMaskType maskVal)
    18391839{
    1840     psTrace(__func__, 3, "---- %s() begin  ----\n", __func__);
     1840    psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
    18411841    PS_ASSERT_PTR_NON_NULL(out, NULL);
    18421842    PS_ASSERT_VECTOR_NON_NULL(out->bounds, NULL);
     
    19331933    psFree(errorsF32);
    19341934
    1935     psTrace(__func__, 3, "---- %s() end  ----\n", __func__);
     1935    psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
    19361936    return (out);
    19371937}
     
    19591959    psMaskType maskVal)
    19601960{
    1961     psTrace(__func__, 3,"---- %s() begin  ----\n", __func__);
     1961    psTrace("psLib.math", 3,"---- %s() begin  ----\n", __func__);
    19621962    PS_ASSERT_PTR_NON_NULL(stats, NULL);
    19631963    PS_ASSERT_VECTOR_NON_NULL(in, NULL);
     
    20392039            psFree(inF32);
    20402040            psFree(errorsF32);
    2041             psTrace(__func__, 3,"---- %s(NULL) end  ----\n", __func__);
     2041            psTrace("psLib.math", 3,"---- %s(NULL) end  ----\n", __func__);
    20422042            return(NULL);
    20432043        }
     
    20632063    psFree(errorsF32);
    20642064    psFree(maskU8);
    2065     psTrace(__func__, 3,"---- %s() end  ----\n", __func__);
     2065    psTrace("psLib.math", 3,"---- %s() end  ----\n", __func__);
    20662066    return (stats);
    20672067}
  • trunk/psLib/src/sys/psLogMsg.c

    r8232 r8245  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2006-08-08 23:32:23 $
     13 *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2006-08-09 02:26:44 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    172172    // XXX: If one must at least log error messages, why don't we set logMsg = true here?
    173173    if (!logMsg) {
    174         psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", format);
     174        psTrace("psLib.sys", 1, "You must at least log error messages (You chose \"%s\")", format);
    175175
    176176    }
     
    293293
    294294    default:
    295         psTrace("utils.logMsg", 2, "Invalid logMsg level: %d (%s)\n", level, format);
     295        psTrace("psLib.sys", 2, "Invalid logMsg level: %d (%s)\n", level, format);
    296296        level = (level < 0) ? 0 : 9;
    297297        clevel = level + '0';
  • trunk/psLib/src/sys/psTrace.c

    r8244 r8245  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-08-09 02:01:02 $
     11 *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-08-09 02:26:44 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    525525        clevel = level + '0';
    526526    } else {
    527         psTrace("utils.logMsg", 2, "Invalid logMsg level: %d (%s)\n", level, format);
     527        psTrace("psLib.sys", 2, "Invalid logMsg level: %d (%s)\n", level, format);
    528528        level = (level < 0) ? 0 : 9;
    529529        clevel = level + '0';
     
    721721    // XXX: If one must at least log error messages, why don't we set logMsg = true here?
    722722    if (!traceMsg) {
    723         psTrace("utils.traceMsg", 1,
     723        psTrace("psLib.sys", 1,
    724724                "You must at least trace error messages (You chose \"%s\")", format);
    725725
  • trunk/psLib/src/types/psArguments.c

    r8232 r8245  
    77 *  @author David Robbins, MHPCC
    88 *
    9  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-08-08 23:32:23 $
     9 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-08-09 02:26:44 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    156156
    157157    for (int i = 1; i < *argc; i++) {
    158         psTrace(__func__, 7, "Looking at %s\n", argv[i]);
     158        psTrace("psLib.types", 7, "Looking at %s\n", argv[i]);
    159159        psMetadataItem *argItem = psMetadataLookup(arguments, argv[i]);
    160160        if (argItem) {
  • trunk/psLib/src/types/psHash.c

    r8232 r8245  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-08-08 23:32:23 $
     14*  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-08-09 02:26:44 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    148148    table->n = nalloc;
    149149
    150     psTrace("utils.hash", 1, "Creating %d-element hash table\n", nalloc);
     150    psTrace("psLib.types", 1, "Creating %d-element hash table\n", nalloc);
    151151
    152152    // Initialize all buckets to NULL.
     
    321321                // We have found this key in the hash table.
    322322
    323                 psTrace("utils.hash.insert", 3, "Replacing data for %s\n", key);
     323                psTrace("psLib.types", 3, "Replacing data for %s\n", key);
    324324
    325325                // NOTE: I have changed this behavior from the originally
  • trunk/psLib/src/types/psMetadata.c

    r8232 r8245  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.121 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-08 23:32:23 $
     14 *  @version $Revision: 1.122 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-09 02:26:44 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    445445        unsigned int flag = PS_META_REPLACE; // Flag to indicate MULTI; otherwise, replace
    446446        if (multiCheckItem->type == PS_DATA_METADATA_MULTI) {
    447             psTrace(__func__, 10, "MULTI: %s (%s)\n", inItem->name, inItem->comment);
     447            psTrace("psLib.types", 10, "MULTI: %s (%s)\n", inItem->name, inItem->comment);
    448448            flag = PS_META_DUPLICATE_OK;
    449449        }
    450         psTrace(__func__, 5, "Copying %s (%s)...\n", inItem->name, inItem->comment);
     450        psTrace("psLib.types", 5, "Copying %s (%s)...\n", inItem->name, inItem->comment);
    451451
    452452        // Copy the item and add it on
  • trunk/psLib/src/types/psMetadataItemCompare.c

    r8224 r8245  
    6767            return false;
    6868        }
    69         psTrace(__func__, 10, "Comparing '%s' with '%s'\n", compare->data.V, template->
     69        psTrace("psLib.types", 10, "Comparing '%s' with '%s'\n", compare->data.V, template->
    7070                data.V);
    7171        return (strcasecmp(compare->data.V, template->
Note: See TracChangeset for help on using the changeset viewer.