IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2004, 6:56:41 PM (22 years ago)
Author:
gusciora
Message:

Implemented the generation spline functions.

File:
1 edited

Legend:

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

    r1846 r1859  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-22 01:30:21 $
     9 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-23 04:56:40 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    467467    for (loop_x = 0; loop_x < myPoly->n; loop_x++) {
    468468        if (myPoly->mask[loop_x] == 0) {
     469            psTrace(".psLib.dataManip.psFunctions.p_psOrdPolynomial1DEval", 10,
     470                    "polysum+= sum*coeff [%f+= (%f * %f)\n", polySum, xSum, myPoly->coeff[loop_x]);
    469471            polySum += xSum * myPoly->coeff[loop_x];
    470472            xSum *= x;
     
    16871689
    16881690/*****************************************************************************
    1689 VectorBinDisectF32(): This is a private function which takes as input a
     1691p_psVectorBinDisectF32(): This is a private function which takes as input a
    16901692vector of floating point data as well as a single floating point values.
    16911693The input vector values are assumed to be non-decreasing (v[i-1] <= v[j] for
     
    16961698XXX: Macro this for a few different types.
    16971699 *****************************************************************************/
    1698 int VectorBinDisectF32(float *bins,
    1699                        int numBins,
    1700                        float x)
     1700int p_psVectorBinDisectF32(float *bins,
     1701                           int numBins,
     1702                           float x)
    17011703{
    17021704    int min;
     
    17041706    int mid;
    17051707
    1706     psTrace(".psLib.dataManip.psFunctions.VectorBinDisectF32", 4,
    1707             "---- Calling VectorBinDisectF32(%f)\n", x);
     1708    psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4,
     1709            "---- Calling p_psVectorBinDisectF32(%f)\n", x);
    17081710
    17091711    if ((x < bins[0]) ||
    17101712            (x > bins[numBins-1])) {
    17111713        psLogMsg(__func__, PS_LOG_WARN,
    1712                  "VectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
     1714                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
    17131715                 x, bins[0], bins[numBins-1]);
    17141716        return(-1);
     
    17201722
    17211723    while (min != max) {
    1722         psTrace(".psLib.dataManip.psFunctions.VectorBinDisectF32", 4,
     1724        psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4,
    17231725                "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n",
    17241726                min, mid, max, x, bins[mid]);
    17251727
    17261728        if (x == bins[mid]) {
    1727             psTrace(".psLib.dataManip.psFunctions.VectorBinDisectF32", 4,
    1728                     "---- Exiting VectorBinDisectF32(): bin %d\n", mid);
     1729            psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4,
     1730                    "---- Exiting p_psVectorBinDisectF32(): bin %d\n", mid);
    17291731            return(mid);
    17301732        } else if (x < bins[mid]) {
     
    17361738    }
    17371739
    1738     psTrace(".psLib.dataManip.psFunctions.VectorBinDisectF32", 4,
    1739             "---- Exiting VectorBinDisectF32(): bin %d\n", min);
     1740    psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectF32", 4,
     1741            "---- Exiting p_psVectorBinDisectF32(): bin %d\n", min);
    17401742    return(min);
    17411743}
    17421744
    17431745/*****************************************************************************
    1744 VectorBinDisectS32(): integer version of above.
     1746p_psVectorBinDisectS32(): integer version of above.
    17451747 *****************************************************************************/
    1746 int VectorBinDisectS32(int *bins,
    1747                        int numBins,
    1748                        int x)
     1748int p_psVectorBinDisectS32(int *bins,
     1749                           int numBins,
     1750                           int x)
    17491751{
    17501752    int min;
     
    17521754    int mid;
    17531755
    1754     psTrace(".psLib.dataManip.psFunctions.VectorBinDisectS32", 4,
    1755             "---- Calling VectorBinDisectS32(%f)\n", x);
     1756    psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4,
     1757            "---- Calling p_psVectorBinDisectS32(%f)\n", x);
    17561758
    17571759    if ((x < bins[0]) ||
    17581760            (x > bins[numBins-1])) {
    17591761        psLogMsg(__func__, PS_LOG_WARN,
    1760                  "VectorBinDisectS32(): ordinate %f is outside vector range (%f - %f).",
     1762                 "p_psVectorBinDisectS32(): ordinate %f is outside vector range (%f - %f).",
    17611763                 x, bins[0], bins[numBins-1]);
    17621764        return(-1);
     
    17681770
    17691771    while (min != max) {
    1770         psTrace(".psLib.dataManip.psFunctions.VectorBinDisectS32", 4,
     1772        psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4,
    17711773                "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n",
    17721774                min, mid, max, x, bins[mid]);
    17731775
    17741776        if (x == bins[mid]) {
    1775             psTrace(".psLib.dataManip.psFunctions.VectorBinDisectS32", 4,
    1776                     "---- Exiting VectorBinDisectS32(): bin %d\n", min);
     1777            psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4,
     1778                    "---- Exiting p_psVectorBinDisectS32(): bin %d\n", min);
    17771779            return(min);
    17781780        } else if (x < bins[mid]) {
     
    17841786    }
    17851787
    1786     psTrace(".psLib.dataManip.psFunctions.VectorBinDisectS32", 4,
    1787             "---- Exiting VectorBinDisectS32(): bin %d\n", min);
     1788    psTrace(".psLib.dataManip.psFunctions.p_psVectorBinDisectS32", 4,
     1789            "---- Exiting p_psVectorBinDisectS32(): bin %d\n", min);
    17881790    return(min);
    17891791}
    17901792
    17911793/*****************************************************************************
    1792 p_psVectorBinDisect(): A wrapper to the above VectorBinDisect().
     1794p_psVectorBinDisect(): A wrapper to the above p_psVectorBinDisect().
    17931795 *****************************************************************************/
    17941796int p_psVectorBinDisect(psVector *bins,
     
    18011803
    18021804    if (x->type.type == PS_TYPE_S32) {
    1803         return(VectorBinDisectS32(bins->data.S32, bins->n, x->data.S32));
     1805        return(p_psVectorBinDisectS32(bins->data.S32, bins->n, x->data.S32));
    18041806    } else if (x->type.type == PS_TYPE_F32) {
    1805         return(VectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));
     1807        return(p_psVectorBinDisectF32(bins->data.F32, bins->n, x->data.F32));
    18061808    } else {
    18071809        // XXX: Generate error message.
     
    18791881            "---- p_ps1DInterpolateF32() begin ----\n");
    18801882
    1881     binNum = VectorBinDisectF32(domain, n, x);
     1883    binNum = p_psVectorBinDisectF32(domain, n, x);
    18821884
    18831885    if (0 == numIntPoints%2) {
     
    19531955
    19541956    n = spline->n;
    1955     binNum = VectorBinDisectF32(spline->domains, (spline->n)+1, x);
     1957    binNum = p_psVectorBinDisectF32(spline->domains, (spline->n)+1, x);
    19561958    if (binNum == -1) {
    19571959        psLogMsg(__func__, PS_LOG_WARN,
Note: See TracChangeset for help on using the changeset viewer.