IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 23, 2023, 7:10:15 AM (3 years ago)
Author:
eugene
Message:

workin on spline implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psLib.20230123/src/math/psSpline.h

    r23486 r42319  
    55 * and evaluate splines.
    66 *
    7  * @author GLG, MHPCC
     7 * @author GLG (MHPCC)
     8 * reworked by EAM (IfA)
    89 *
    910 * @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
     
    2728#include "psPolynomial.h"
    2829
    29 #define PS_LEFT_SPLINE_DERIV 0.0
    30 #define PS_RIGHT_SPLINE_DERIV 0.0
    31 
    32 /** One-Dimensional Spline */
     30/** One-Dimensional Spline
     31    This structure represents a 1D cubic spline.  Note the option for
     32    equally-spaced knots allows a quick selection of the correct spline
     33    segment.  The values (xMin, xMax, xDel) are stored for ease of access.
     34 */
    3335typedef struct
    3436{
    3537    unsigned int n;                    ///< The number of spline pieces
    36     psPolynomial1D **spline;           ///< An array of n pointers to the spline polynomials
    37     psVector *knots;                   ///< The boundaries between each spline piece.  Size is n+1.
    38     psF32 *p_psDeriv2;                 ///< For cubic splines, the second derivative at each domain point.  Size is n+1.
     38    psF32 *xKnots; ///< x-coordinate of the knots (n+1)
     39    psF32 *yKnots; ///< y-coordinate of the knots (n+1)
     40    psF32 *d2yKnots; ///< 2nd derivative of y at the knots (n+1)
     41    bool equalSpacing; // if knots are equally spaced, the seqment choice can be optimized
     42    psF32 xMin; // for equally-spaced knots, the value at the lower bound (xKnots[0])
     43    psF32 xMax; // for equally-spaced knots, the value at the upper bound (xKnots[n])
     44    psF32 xDel; // for equally-spaced knots, the spacing (xKnots[n] - xKnots[0])/n
    3945}
    4046psSpline1D;
    4147
    42 /** Allocates a psSpline1D structure
    43  *
    44  *  Allocator for psSpline1D.
     48/** Allocator for psSpline1D.
    4549 *
    4650 *  @return psSpline1D*    new 1-D spline struct
     
    5357 */
    5458float psSpline1DEval(
    55     const psSpline1D *spline,          ///< Coefficients for spline polynomials
     59    const psSpline1D *spline,          ///< spline pointer
    5660    float x                            ///< location at which to evaluate
    5761);
     
    7175 *  generates the linear splines which satisfy those data points.
    7276 *
     77 *  XXX EAM: add option to generate / select a subset of knots from the data
     78 *
    7379 *  @return psSpline1D*:  the calculated one-dimensional splines
    7480 */
    75 psSpline1D *psVectorFitSpline1D(
     81psSpline1D *psSpline1DFitVector(
    7682    const psVector* x,                 ///< Ordinates (or NULL to just use the indices)
    7783    const psVector* y                  ///< Coordinates
Note: See TracChangeset for help on using the changeset viewer.