IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2004, 4:42:20 PM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

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

    r1846 r1847  
    1 M/** @file  psMinimize.c
     1/** @file  psMinimize.c
    22 *  \brief basic minimization functions
    33 *  @ingroup Math
     
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-22 01:30:21 $
     11 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-22 02:42:20 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    162162                             const psVector* restrict y)        ///< Coordinates
    163163{
     164    psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
     165            "---- CalculateSecondDerivs() begin ----\n");
     166
    164167    int i;
    165168    int k;
     
    194197        u[i] = (Y[i+1] - Y[i])/(X[i+1]-X[i]) - (Y[i]-Y[i-1])/(X[i]-X[i-1]);
    195198        u[i] = (6.0 * u[i] / (X[i+1] - X[i-1]) - sig * u[i-1]) / p;
     199
     200        psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     201                "X[%d] is %f\n", i, X[i]);
     202        psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     203                "Y[%d] is %f\n", i, Y[i]);
     204        psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     205                "u[%d] is %f\n", i, u[i]);
    196206    }
    197207
    198208    for (k=(n-2);k>=0;k--) {
    199209        derivs2[k] = derivs2[k] * derivs2[k+1] + u[k];
    200     }
    201 
    202 
    203 
    204 
    205 
    206 
    207 
    208 
    209 
    210     /*
    211         if (mustFreeX == true) {
    212             psFree(X);
    213         }
    214     */
     210        psTrace(".psLib.dataManip.CalculateSecondDerivs", 6,
     211                "derivs2[%d] is %f\n", k, derivs2[k]);
     212    }
     213    if (mustFreeX == true) {
     214        psFree(X);
     215    }
    215216    psFree(u);
    216217
     218    psTrace(".psLib.dataManip.CalculateSecondDerivs", 4,
     219            "---- CalculateSecondDerivs() end ----\n");
    217220    return(derivs2);
    218221}
     
    249252                                const psVector* restrict yErr)     ///< Errors in coordinates, or NULL
    250253{
     254    psTrace(".psLib.dataManip.psVectorFitSpline1D", 4,
     255            "---- psVectorFitSpline1D() begin ----\n");
    251256    int numSplines = (y->n)-1;
    252257    float tmp;
     
    261266    for (i=0;i<numSplines;i++) {
    262267        H = x->data.F32[i+1] - x->data.F32[i];
     268        psTrace(".psLib.dataManip.psVectorFitSpline1D", 4,
     269                "X data (%f - %f) (%f)\n", x->data.F32[i], x->data.F32[i+1], H);
    263270        //
    264271        // ******** Calulate 0-order term ********
     
    309316        //
    310317        // From (3)
    311         (mySpline->spline[i])->coeff[2] = -((mySpline->p_psDeriv2)[i]) / (6.0 * H);
     318        (mySpline->spline[i])->coeff[3] = -((mySpline->p_psDeriv2)[i]) / (6.0 * H);
    312319        // From (4)
    313         (mySpline->spline[i])->coeff[2]+=  ((mySpline->p_psDeriv2)[i+1]) / (6.0 * H);
    314     }
    315 
    316 
    317 
    318 
    319 
    320 
    321 
    322 
    323 
     320        (mySpline->spline[i])->coeff[3]+=  ((mySpline->p_psDeriv2)[i+1]) / (6.0 * H);
     321
     322        psTrace(".psLib.dataManip.psMinimizeLMChi2", 6,
     323                "(mySpline->spline[%d])->coeff[0] is %f\n", i, (mySpline->spline[i])->coeff[0]);
     324        psTrace(".psLib.dataManip.psMinimizeLMChi2", 6,
     325                "(mySpline->spline[%d])->coeff[1] is %f\n", i, (mySpline->spline[i])->coeff[1]);
     326        psTrace(".psLib.dataManip.psMinimizeLMChi2", 6,
     327                "(mySpline->spline[%d])->coeff[2] is %f\n", i, (mySpline->spline[i])->coeff[2]);
     328        psTrace(".psLib.dataManip.psMinimizeLMChi2", 6,
     329                "(mySpline->spline[%d])->coeff[3] is %f\n", i, (mySpline->spline[i])->coeff[3]);
     330
     331    }
     332
     333    psTrace(".psLib.dataManip.psVectorFitSpline1D", 4,
     334            "---- psVectorFitSpline1D() end ----\n");
    324335    return(mySpline);
    325336}
     
    559570    return(false);
    560571}
    561 
    562 
    563 
    564 
    565 
    566 
    567 
    568 
    569 
    570 
    571 
    572 
    573572
    574573/******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.