IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1765


Ignore:
Timestamp:
Sep 9, 2004, 1:39:36 PM (22 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib/src
Files:
3 edited

Legend:

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

    r1763 r1765  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-09 22:20:31 $
     9 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-09 23:39:36 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    15801580    NOTE: "n" specifies the number of spline polynomials.  Therefore, there
    15811581    must exist n+1 points in "domains".
     1582 
     1583XXX: Ensure that domain[i+1] != domain[i]
    15821584 *****************************************************************************/
    15831585psSpline1D *psSpline1DAlloc(int numSplines,
     
    16111613}
    16121614
     1615/*****************************************************************************
     1616XXX: Ensure that domain[i+1] != domain[i]
     1617 *****************************************************************************/
    16131618psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
    16141619                                   int order)
     
    17201725{
    17211726    int i;
     1727    float slope;
     1728
    17221729    if (data->n != (1 + spline->n)) {
    17231730        psLogMsg(__func__, PS_LOG_WARN,
     
    17261733        return(NULL);
    17271734    }
     1735    // XXX: verify your math
    17281736    if (1 == (spline->spline[0])->n) {
     1737        for (i=0;i<spline->n;i++) {
     1738            slope = (data->data.F32[i+1] - data->data.F32[i]) /
     1739                    (spline->domains[i+1] - spline->domains[i]);
     1740            (spline->spline[0])->coeff[0] = data->data.F32[i] -
     1741                                            (slope * spline->domains[i]);
     1742            (spline->spline[0])->coeff[1] = slope;
     1743        }
     1744
    17291745        psLogMsg(__func__, PS_LOG_WARN,
    17301746                 "Linear splines have not been implemented.");
    17311747        return(NULL);
    1732         for (i=0;i<spline->n;i++) {}
    1733 
    1734     }
    1735     else if (3 == (spline->spline[0])->n) {
     1748    } else if (3 == (spline->spline[0])->n) {
    17361749        psLogMsg(__func__, PS_LOG_WARN,
    17371750                 "Cubic splines have not been implemented.");
  • trunk/psLib/src/math/psPolynomial.c

    r1763 r1765  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-09 22:20:31 $
     9 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-09 23:39:36 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    15801580    NOTE: "n" specifies the number of spline polynomials.  Therefore, there
    15811581    must exist n+1 points in "domains".
     1582 
     1583XXX: Ensure that domain[i+1] != domain[i]
    15821584 *****************************************************************************/
    15831585psSpline1D *psSpline1DAlloc(int numSplines,
     
    16111613}
    16121614
     1615/*****************************************************************************
     1616XXX: Ensure that domain[i+1] != domain[i]
     1617 *****************************************************************************/
    16131618psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
    16141619                                   int order)
     
    17201725{
    17211726    int i;
     1727    float slope;
     1728
    17221729    if (data->n != (1 + spline->n)) {
    17231730        psLogMsg(__func__, PS_LOG_WARN,
     
    17261733        return(NULL);
    17271734    }
     1735    // XXX: verify your math
    17281736    if (1 == (spline->spline[0])->n) {
     1737        for (i=0;i<spline->n;i++) {
     1738            slope = (data->data.F32[i+1] - data->data.F32[i]) /
     1739                    (spline->domains[i+1] - spline->domains[i]);
     1740            (spline->spline[0])->coeff[0] = data->data.F32[i] -
     1741                                            (slope * spline->domains[i]);
     1742            (spline->spline[0])->coeff[1] = slope;
     1743        }
     1744
    17291745        psLogMsg(__func__, PS_LOG_WARN,
    17301746                 "Linear splines have not been implemented.");
    17311747        return(NULL);
    1732         for (i=0;i<spline->n;i++) {}
    1733 
    1734     }
    1735     else if (3 == (spline->spline[0])->n) {
     1748    } else if (3 == (spline->spline[0])->n) {
    17361749        psLogMsg(__func__, PS_LOG_WARN,
    17371750                 "Cubic splines have not been implemented.");
  • trunk/psLib/src/math/psSpline.c

    r1763 r1765  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-09 22:20:31 $
     9 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-09 23:39:36 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    15801580    NOTE: "n" specifies the number of spline polynomials.  Therefore, there
    15811581    must exist n+1 points in "domains".
     1582 
     1583XXX: Ensure that domain[i+1] != domain[i]
    15821584 *****************************************************************************/
    15831585psSpline1D *psSpline1DAlloc(int numSplines,
     
    16111613}
    16121614
     1615/*****************************************************************************
     1616XXX: Ensure that domain[i+1] != domain[i]
     1617 *****************************************************************************/
    16131618psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
    16141619                                   int order)
     
    17201725{
    17211726    int i;
     1727    float slope;
     1728
    17221729    if (data->n != (1 + spline->n)) {
    17231730        psLogMsg(__func__, PS_LOG_WARN,
     
    17261733        return(NULL);
    17271734    }
     1735    // XXX: verify your math
    17281736    if (1 == (spline->spline[0])->n) {
     1737        for (i=0;i<spline->n;i++) {
     1738            slope = (data->data.F32[i+1] - data->data.F32[i]) /
     1739                    (spline->domains[i+1] - spline->domains[i]);
     1740            (spline->spline[0])->coeff[0] = data->data.F32[i] -
     1741                                            (slope * spline->domains[i]);
     1742            (spline->spline[0])->coeff[1] = slope;
     1743        }
     1744
    17291745        psLogMsg(__func__, PS_LOG_WARN,
    17301746                 "Linear splines have not been implemented.");
    17311747        return(NULL);
    1732         for (i=0;i<spline->n;i++) {}
    1733 
    1734     }
    1735     else if (3 == (spline->spline[0])->n) {
     1748    } else if (3 == (spline->spline[0])->n) {
    17361749        psLogMsg(__func__, PS_LOG_WARN,
    17371750                 "Cubic splines have not been implemented.");
Note: See TracChangeset for help on using the changeset viewer.