IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3854


Ignore:
Timestamp:
May 5, 2005, 12:21:55 PM (21 years ago)
Author:
gusciora
Message:

Coding standard modes: changed local function names and declared them static.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMinimize.c

    r3853 r3854  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.112 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-05-05 22:15:16 $
     11 *  @version $Revision: 1.113 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-05-05 22:21:55 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6060XXX: Use a static vector.
    6161 *****************************************************************************/
    62 void psBuildSums1D(psF64 x,
    63                    psS32 polyOrder,
    64                    psVector* sums)
     62static void buildSums1D(psF64 x,
     63                        psS32 polyOrder,
     64                        psVector* sums)
    6565{
    6666    psS32 i = 0;
     
    9696XXX: do an F64 version?
    9797 *****************************************************************************/
    98 psF32 *CalculateSecondDerivs(const psVector* x,        ///< Ordinates (or NULL to just use the indices)
    99                              const psVector* y)        ///< Coordinates
    100 {
    101     psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
    102             "---- CalculateSecondDerivs() begin ----\n");
     98static psF32 *calculateSecondDerivs(const psVector* x,        ///< Ordinates (or NULL to just use the indices)
     99                                    const psVector* y)        ///< Coordinates
     100{
     101    psTrace(".psLib.dataManip.calculateSecondDerivs", 4,
     102            "---- calculateSecondDerivs() begin ----\n");
    103103
    104104    psS32 i;
     
    125125        u[i] = ((6.0 * u[i] / (X[i+1] - X[i-1])) - (sig * u[i-1])) / p;
    126126
    127         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     127        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    128128                "X[%d] is %f\n", i, X[i]);
    129         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     129        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    130130                "Y[%d] is %f\n", i, Y[i]);
    131         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     131        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    132132                "u[%d] is %f\n", i, u[i]);
    133133    }
     
    140140        derivs2[k] = derivs2[k] * derivs2[k+1] + u[k];
    141141
    142         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     142        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    143143                "derivs2[%d] is %f\n", k, derivs2[k]);
    144144    }
    145145
    146146    psFree(u);
    147     psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
    148             "---- CalculateSecondDerivs() end ----\n");
     147    psTrace(".psLib.dataManip.calculateSecondDerivs", 4,
     148            "---- calculateSecondDerivs() end ----\n");
    149149    return(derivs2);
    150150}
     
    347347    // If we get here, then we know these are cubic splines.  We first
    348348    // generate the second derivatives at each data point.
    349     mySpline->p_psDeriv2 = CalculateSecondDerivs(x32, y32);
     349    mySpline->p_psDeriv2 = calculateSecondDerivs(x32, y32);
    350350    for (i=0;i<y32->n;i++)
    351351        psTrace(".psLib.dataManip.psVectorFitSpline1D", 6,
     
    11941194
    11951195/******************************************************************************
    1196 VectorFitPolynomial1DCheb():  This routine will fit a Chebyshev polynomial of
     1196vectorFitPolynomial1DCheb():  This routine will fit a Chebyshev polynomial of
    11971197degree myPoly to the data points (x, y) and return the coefficients of that
    11981198polynomial.
    11991199 
    12001200XXX: yErr is currently ignored.
    1201  
    1202 XXX: Use private name?
    12031201*****************************************************************************/
    1204 psPolynomial1D *VectorFitPolynomial1DCheby(psPolynomial1D* myPoly,
     1202static psPolynomial1D *vectorFitPolynomial1DCheby(psPolynomial1D* myPoly,
    12051203        const psVector* x,
    12061204        const psVector* y,
     
    12491247        psFree(fScalar);
    12501248
    1251         psTrace(".psLib.dataManip.VectorFitPolynomial1DCheby", 6,
     1249        psTrace(".psLib.dataManip.vectorFitPolynomial1DCheby", 6,
    12521250                "(x, X, y, f(X)) is (%f, %f, %f, %f)\n",
    12531251                x->data.F64[i], X, y->data.F64[i], f->data.F64[i]);
     
    12801278XXX: Use recycled vectors.
    12811279 *****************************************************************************/
    1282 psPolynomial1D* VectorFitPolynomial1DOrd(psPolynomial1D* myPoly,
     1280static psPolynomial1D* vectorFitPolynomial1DOrd(psPolynomial1D* myPoly,
    12831281        const psVector* x,
    12841282        const psVector* y,
     
    12971295    psVector* xSums = NULL;
    12981296
    1299     psTrace(".psLib.dataManip.VectorFitPolynomial1DOrd", 4,
    1300             "---- VectorFitPolynomial1DOrd() begin ----\n");
     1297    psTrace(".psLib.dataManip.vectorFitPolynomial1DOrd", 4,
     1298            "---- vectorFitPolynomial1DOrd() begin ----\n");
    13011299    // printf("VectorFitPolynomial1D()\n");
    13021300    // for (i=0;i<x->n;i++) {
     
    13281326    if (yErr == NULL) {
    13291327        for (i = 0; i < X->n; i++) {
    1330             psBuildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
     1328            buildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
    13311329
    13321330            for (k = 0; k < polyOrder; k++) {
     
    13421340    } else {
    13431341        for (i = 0; i < X->n; i++) {
    1344             psBuildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
     1342            buildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
    13451343
    13461344            for (k = 0; k < polyOrder; k++) {
     
    13751373    psFree(xSums);
    13761374
    1377     psTrace(".psLib.dataManip.VectorFitPolynomial1DOrd", 4,
    1378             "---- VectorFitPolynomial1DOrd() begin ----\n");
     1375    psTrace(".psLib.dataManip.vectorFitPolynomial1DOrd", 4,
     1376            "---- vectorFitPolynomial1DOrd() begin ----\n");
    13791377    return (myPoly);
    13801378}
     
    14361434    psPolynomial1D *rc = NULL;
    14371435    if (myPoly->type == PS_POLYNOMIAL_CHEB) {
    1438         rc = VectorFitPolynomial1DCheby(myPoly, x64, y64, yErr64);
     1436        rc = vectorFitPolynomial1DCheby(myPoly, x64, y64, yErr64);
    14391437    } else if (myPoly->type == PS_POLYNOMIAL_ORD) {
    1440         rc = VectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
     1438        rc = vectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
    14411439    } else {
    14421440        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     
    21712169XXX: This is F32 only
    21722170 *****************************************************************************/
    2173 psF32 myPowellChi2Func(const psVector *params,
    2174                        const psArray *coords)
     2171static psF32 myPowellChi2Func(const psVector *params,
     2172                              const psArray *coords)
    21752173{
    21762174    psTrace(".psLib.dataManip.myPowellChi2Func", 4,
  • trunk/psLib/src/math/psMinimize.c

    r3853 r3854  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.112 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-05-05 22:15:16 $
     11 *  @version $Revision: 1.113 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-05-05 22:21:55 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6060XXX: Use a static vector.
    6161 *****************************************************************************/
    62 void psBuildSums1D(psF64 x,
    63                    psS32 polyOrder,
    64                    psVector* sums)
     62static void buildSums1D(psF64 x,
     63                        psS32 polyOrder,
     64                        psVector* sums)
    6565{
    6666    psS32 i = 0;
     
    9696XXX: do an F64 version?
    9797 *****************************************************************************/
    98 psF32 *CalculateSecondDerivs(const psVector* x,        ///< Ordinates (or NULL to just use the indices)
    99                              const psVector* y)        ///< Coordinates
    100 {
    101     psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
    102             "---- CalculateSecondDerivs() begin ----\n");
     98static psF32 *calculateSecondDerivs(const psVector* x,        ///< Ordinates (or NULL to just use the indices)
     99                                    const psVector* y)        ///< Coordinates
     100{
     101    psTrace(".psLib.dataManip.calculateSecondDerivs", 4,
     102            "---- calculateSecondDerivs() begin ----\n");
    103103
    104104    psS32 i;
     
    125125        u[i] = ((6.0 * u[i] / (X[i+1] - X[i-1])) - (sig * u[i-1])) / p;
    126126
    127         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     127        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    128128                "X[%d] is %f\n", i, X[i]);
    129         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     129        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    130130                "Y[%d] is %f\n", i, Y[i]);
    131         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     131        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    132132                "u[%d] is %f\n", i, u[i]);
    133133    }
     
    140140        derivs2[k] = derivs2[k] * derivs2[k+1] + u[k];
    141141
    142         psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     142        psTrace(".psLib.dataManip.calculateSecondDerivs", 6,
    143143                "derivs2[%d] is %f\n", k, derivs2[k]);
    144144    }
    145145
    146146    psFree(u);
    147     psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
    148             "---- CalculateSecondDerivs() end ----\n");
     147    psTrace(".psLib.dataManip.calculateSecondDerivs", 4,
     148            "---- calculateSecondDerivs() end ----\n");
    149149    return(derivs2);
    150150}
     
    347347    // If we get here, then we know these are cubic splines.  We first
    348348    // generate the second derivatives at each data point.
    349     mySpline->p_psDeriv2 = CalculateSecondDerivs(x32, y32);
     349    mySpline->p_psDeriv2 = calculateSecondDerivs(x32, y32);
    350350    for (i=0;i<y32->n;i++)
    351351        psTrace(".psLib.dataManip.psVectorFitSpline1D", 6,
     
    11941194
    11951195/******************************************************************************
    1196 VectorFitPolynomial1DCheb():  This routine will fit a Chebyshev polynomial of
     1196vectorFitPolynomial1DCheb():  This routine will fit a Chebyshev polynomial of
    11971197degree myPoly to the data points (x, y) and return the coefficients of that
    11981198polynomial.
    11991199 
    12001200XXX: yErr is currently ignored.
    1201  
    1202 XXX: Use private name?
    12031201*****************************************************************************/
    1204 psPolynomial1D *VectorFitPolynomial1DCheby(psPolynomial1D* myPoly,
     1202static psPolynomial1D *vectorFitPolynomial1DCheby(psPolynomial1D* myPoly,
    12051203        const psVector* x,
    12061204        const psVector* y,
     
    12491247        psFree(fScalar);
    12501248
    1251         psTrace(".psLib.dataManip.VectorFitPolynomial1DCheby", 6,
     1249        psTrace(".psLib.dataManip.vectorFitPolynomial1DCheby", 6,
    12521250                "(x, X, y, f(X)) is (%f, %f, %f, %f)\n",
    12531251                x->data.F64[i], X, y->data.F64[i], f->data.F64[i]);
     
    12801278XXX: Use recycled vectors.
    12811279 *****************************************************************************/
    1282 psPolynomial1D* VectorFitPolynomial1DOrd(psPolynomial1D* myPoly,
     1280static psPolynomial1D* vectorFitPolynomial1DOrd(psPolynomial1D* myPoly,
    12831281        const psVector* x,
    12841282        const psVector* y,
     
    12971295    psVector* xSums = NULL;
    12981296
    1299     psTrace(".psLib.dataManip.VectorFitPolynomial1DOrd", 4,
    1300             "---- VectorFitPolynomial1DOrd() begin ----\n");
     1297    psTrace(".psLib.dataManip.vectorFitPolynomial1DOrd", 4,
     1298            "---- vectorFitPolynomial1DOrd() begin ----\n");
    13011299    // printf("VectorFitPolynomial1D()\n");
    13021300    // for (i=0;i<x->n;i++) {
     
    13281326    if (yErr == NULL) {
    13291327        for (i = 0; i < X->n; i++) {
    1330             psBuildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
     1328            buildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
    13311329
    13321330            for (k = 0; k < polyOrder; k++) {
     
    13421340    } else {
    13431341        for (i = 0; i < X->n; i++) {
    1344             psBuildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
     1342            buildSums1D(X->data.F64[i], 2 * polyOrder, xSums);
    13451343
    13461344            for (k = 0; k < polyOrder; k++) {
     
    13751373    psFree(xSums);
    13761374
    1377     psTrace(".psLib.dataManip.VectorFitPolynomial1DOrd", 4,
    1378             "---- VectorFitPolynomial1DOrd() begin ----\n");
     1375    psTrace(".psLib.dataManip.vectorFitPolynomial1DOrd", 4,
     1376            "---- vectorFitPolynomial1DOrd() begin ----\n");
    13791377    return (myPoly);
    13801378}
     
    14361434    psPolynomial1D *rc = NULL;
    14371435    if (myPoly->type == PS_POLYNOMIAL_CHEB) {
    1438         rc = VectorFitPolynomial1DCheby(myPoly, x64, y64, yErr64);
     1436        rc = vectorFitPolynomial1DCheby(myPoly, x64, y64, yErr64);
    14391437    } else if (myPoly->type == PS_POLYNOMIAL_ORD) {
    1440         rc = VectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
     1438        rc = vectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
    14411439    } else {
    14421440        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     
    21712169XXX: This is F32 only
    21722170 *****************************************************************************/
    2173 psF32 myPowellChi2Func(const psVector *params,
    2174                        const psArray *coords)
     2171static psF32 myPowellChi2Func(const psVector *params,
     2172                              const psArray *coords)
    21752173{
    21762174    psTrace(".psLib.dataManip.myPowellChi2Func", 4,
Note: See TracChangeset for help on using the changeset viewer.