Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gxkspline.hh File Reference
#include <gxk/gxkglobals.hh>
Include dependency graph for gxkspline.hh:
This graph shows which files directly or indirectly include this file:

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)
 

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.

Here is the call graph for this function:

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.

Referenced by gxk_spline_y().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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.

Referenced by gxk_spline_new_natural().

Here is the call graph for this function:

Here is the caller graph for this 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.

Here is the call graph for this function:

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.

Referenced by gxk_spline_dump().

Here is the call graph for this function:

Here is the caller graph for this function: