BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Functions
gxkspline.hh File Reference
#include <gxk/gxkglobals.hh>

Go to the source code of this file.

Classes

struct  GxkSplinePoint
struct  GxkSplineSegment
struct  GxkSpline

Functions

GxkSpline * gxk_spline_new_natural (guint n_points, const GxkSplinePoint *points)
GxkSpline * gxk_spline_new (guint n_points, const GxkSplinePoint *points, double dy_start, double dy_end)
double gxk_spline_eval (const GxkSpline *spline, double x, double *yd1)
double gxk_spline_y (const GxkSpline *spline, double x)
double gxk_spline_findx (const GxkSpline *spline, double y)
void gxk_spline_dump (GxkSpline *spline)
GxkSpline * gxk_spline_copy (GxkSpline *spline)
void gxk_spline_free (GxkSpline *spline)

Detailed Description


Function Documentation

GxkSpline* gxk_spline_copy ( GxkSpline *  spline)
Parameters:
splinecorrectly setup GxkSpline
Returns:
newly allocated spline Produce a copy of an already setup spline.
void gxk_spline_dump ( GxkSpline *  spline)
Parameters:
splinecorrectly setup GxkSpline

Produce a debugging printout of spline on stderr.

double gxk_spline_eval ( const GxkSpline *  spline,
double  x,
double yd1 
)
Parameters:
splinecorrectly setup GxkSpline
xx position for evaluation
dy1location to store first derivative of y
Returns:
y of spline at position x

Evaluate the spline polynomial at position x and return the interpolated value y, as well as its first derivative.

double gxk_spline_findx ( const GxkSpline *  spline,
double  y 
)
Parameters:
splinecorrectly setup GxkSpline
yinterpolated y value
Returns:
x position to yield y or NAN

Find an x position for which spline evaluation yields y. Due to round off, calling gxk_spline_y() on the result may produce a number equal to y only within a certain epsilon. If multiple x positions will yield y upon evaluation, any of them may be returned. If no x position can yield y, NAN is returned. Evaluation of this function may take about 10 times as long as calling its counterpart gxk_spline_y(), some times much longer.

void gxk_spline_free ( GxkSpline *  spline)
Parameters:
splinecorrectly setup GxkSpline

Free a spline structure.

GxkSpline* gxk_spline_new ( guint  n_points,
const GxkSplinePoint points,
double  dy_start,
double  dy_end 
)
Parameters:
n_pointsnumber of fix points
pointsfix points
dy_startfirst derivatives at point[0]
dy_endfirst derivatives at point[n_points - 1]
Returns:
newly allocated spline Create a not-a-knot spline based on a given set of fix points and the first derivative of the first and last point of the interpolating function.
GxkSpline* gxk_spline_new_natural ( guint  n_points,
const GxkSplinePoint points 
)
Parameters:
n_pointsnumber of fix points
pointsfix points
Returns:
newly allocated spline Create a natural spline based on a given set of fix points.
double gxk_spline_y ( const GxkSpline *  spline,
double  x 
)
Parameters:
splinecorrectly setup GxkSpline
xx position for evaluation
Returns:
y of spline at position x

Evaluate the spline polynomial at position x and return the interpolated value y.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines