Bidimensional Spline Abstract Class

Bidimensional Spline Abstract Class — Base class for implementing bidimensional splines

Properties

NcmSpline * spline Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── NcmSpline2d
        ├── NcmSpline2dBicubic
        ├── NcmSpline2dGsl
        ╰── NcmSpline2dSpline

Description

This class comprises all functions to provide a NcmSpline2d, get its properties and evaluate it given an interpolation method.

Functions

ncm_spline2d_set ()

void
ncm_spline2d_set (NcmSpline2d *s2d,
                  NcmVector *xv,
                  NcmVector *yv,
                  NcmMatrix *zm,
                  gboolean init);

This funtion sets xv and yv vectors and zm matrix to s .

Parameters

s2d

a NcmSpline2d

 

xv

a NcmVector of knots.

 

yv

a NcmVector of knots.

 

zm

a NcmMatrix of the values of the function, to be interpolated, computed at xv and yv .

 

init

TRUE to prepare the NcmSpline2d or FALSE to not prepare it.

 

ncm_spline2d_set_function ()

void
ncm_spline2d_set_function (NcmSpline2d *s2d,
                           NcmSplineFuncType ftype,
                           gsl_function *Fx,
                           gsl_function *Fy,
                           gdouble xl,
                           gdouble xu,
                           gdouble yl,
                           gdouble yu,
                           gdouble rel_err);

This function automatically determines the knots of s2d in the intervals [xl , xu ] and [yl , yu ] given a ftype and rel_error .

The functions Fx and Fy are the bidimensional function given at specific values of y and x, respectively. These x and y values must be in the the intervals [xl , xu ] and [yl , yu ].

Parameters

s2d

a NcmSpline2d.

 

ftype

a NcmSplineFuncType.

 

Fx

function of x variable to be approximated by spline functions.

 

Fy

function of y variable to be approximated by spline functions.

 

xl

lower knot of x-coordinate.

 

xu

upper knot of x-coordinate.

 

yl

lower knot of y-coordinate.

 

yu

upper knot of y-coordinate.

 

rel_err

relative error between the function to be interpolated and the spline result.

 

ncm_spline2d_prepare ()

void
ncm_spline2d_prepare (NcmSpline2d *s2d);

This function prepares the bidimensional spline s2d such that one can evaluate it (ncm_spline2d_eval), as well as to compute its integration in x, y or both directions.

Parameters

s2d

a NcmSpline2d.

 

ncm_spline2d_min_size ()

guint
ncm_spline2d_min_size (NcmSpline2d *s2d);

Parameters

s2d

a NcmSpline2d.

 

Returns

The size of the NcmSpline member of s2d .


ncm_spline2d_copy_empty ()

NcmSpline2d *
ncm_spline2d_copy_empty (const NcmSpline2d *s2d);

This function copies the bidimensional spline s2d into an initialized empty NcmSpline2d of a specific type.

Parameters

s2d

a NcmSpline2d.

 

Returns

a NcmSpline2d.

[transfer full]


ncm_spline2d_copy ()

NcmSpline2d *
ncm_spline2d_copy (NcmSpline2d *s2d);

This function copies the two NcmVector and the NcmMatrix of the bidimensional spline s2d into those two NcmVector and NcmMatrix of a new NcmSpline2d.

Parameters

s2d

a NcmSpline2d.

 

Returns

A NcmSpline2d.

[transfer full]


ncm_spline2d_new ()

NcmSpline2d *
ncm_spline2d_new (const NcmSpline2d *s2d,
                  NcmVector *xv,
                  NcmVector *yv,
                  NcmMatrix *zm,
                  gboolean init);

This function returns a new NcmSpline2d, where the knots of this new spline are given in the NcmVector xv and yv . The values of the function, at those knots, to be interpolated are given in the NcmMatrix zm .

Parameters

s2d

a constant NcmSpline2d.

 

xv

NcmVector of knots.

 

yv

NcmVector of knots.

 

zm

NcmMatrix of the values of the function, to be interpolated, computed at xv and yv .

 

init

TRUE to prepare the new NcmSpline2d or FALSE to not prepare it.

 

Returns

A new NcmSpline2d.

[transfer full]


ncm_spline2d_free ()

void
ncm_spline2d_free (NcmSpline2d *s2d);

Atomically decrements the reference count of s2d by one. If the reference count drops to 0, all memory allocated by s2d is released.

Parameters

s2d

a NcmSpline2d.

 

ncm_spline2d_clear ()

void
ncm_spline2d_clear (NcmSpline2d **s2d);

Atomically decrements the reference count of s2d by one. If the reference count drops to 0, all memory allocated by s2d is released. Set pointer to NULL.

Parameters

s2d

a NcmSpline2d.

 

ncm_spline2d_eval ()

gdouble
ncm_spline2d_eval (NcmSpline2d *s2d,
                   gdouble x,
                   gdouble y);

Parameters

s2d

a NcmSpline2d.

 

x

x-coordinate value.

 

y

y-coordinate value.

 

Returns

The interpolated value of a function computed at the point (x , y ).


ncm_spline2d_integ_dx ()

gdouble
ncm_spline2d_integ_dx (NcmSpline2d *s2d,
                       gdouble xl,
                       gdouble xu,
                       gdouble y);

This function computes the integration in x over the interval [xl , xu ] and at y .

Parameters

s2d

a NcmSpline2d.

 

xl

lower limit of integration.

 

xu

upper limit of integration.

 

y

y-coordinate value.

 

Returns

The numerical integral in x of an interpolated function over the range [xl , xu ] and at y .


ncm_spline2d_integ_dy ()

gdouble
ncm_spline2d_integ_dy (NcmSpline2d *s2d,
                       gdouble x,
                       gdouble yl,
                       gdouble yu);

This function computes the integration in y over the interval [yl , yu ] and at x .

Parameters

s2d

a NcmSpline2d.

 

x

x-coordinate value.

 

yl

lower limit of integration.

 

yu

upper limit of integration.

 

Returns

The numerical integral in y of an interpolated function over the range [yl , yu ] and at x .


ncm_spline2d_integ_dxdy ()

gdouble
ncm_spline2d_integ_dxdy (NcmSpline2d *s2d,
                         gdouble xl,
                         gdouble xu,
                         gdouble yl,
                         gdouble yu);

This function computes the integration in both x and y directions over the intervals [xl , xu ] and [yl , yu ].

Parameters

s2d

a NcmSpline2d

 

xl

lower limit of integration in the x-direction.

 

xu

upper limit of integration in the x-direction.

 

yl

lower limit of integration in the y-direction.

 

yu

upper limit of integration in the y-direction.

 

Returns

The numerical integral in x and y of an interpolated function over the ranges [xl , xu ] and [yl , yu ].


ncm_spline2d_integ_dx_spline ()

NcmSpline *
ncm_spline2d_integ_dx_spline (NcmSpline2d *s2d,
                              gdouble xl,
                              gdouble xu);

This function computes the integral in x of the bidimensional interpolated function over the range [xl , xu ] resulting in a one dimensional function.

Parameters

s2d

a NcmSpline2d.

 

xl

lower limit of integration x.

 

xu

upper limit of integration x.

 

Returns

A NcmSpline.

[transfer full]


ncm_spline2d_integ_dy_spline ()

NcmSpline *
ncm_spline2d_integ_dy_spline (NcmSpline2d *s2d,
                              gdouble yl,
                              gdouble yu);

This function computes the integral in y of the bidimensional interpolated function over the range [yl , yu ] resulting in a one dimensional function.

Parameters

s2d

a NcmSpline2d.

 

yl

lower limit of integration.

 

yu

upper limit of integration.

 

Returns

A NcmSpline.

[transfer full]


ncm_spline2d_integ_dx_spline_val ()

gdouble
ncm_spline2d_integ_dx_spline_val (NcmSpline2d *s2d,
                                  gdouble xl,
                                  gdouble xu,
                                  gdouble y);

This function calls ncm_spline2d_integ_dx_spline and evaluates the resulting NcmSpline at y .

Parameters

s2d

a NcmSpline2d.

 

xl

lower limit of integration.

 

xu

upper limit of integration.

 

y

y-coordinate value.

 

Returns

The value of s2d integrated in x over the range [xl , xu ] and computed at y .


ncm_spline2d_integ_dy_spline_val ()

gdouble
ncm_spline2d_integ_dy_spline_val (NcmSpline2d *s2d,
                                  gdouble x,
                                  gdouble yl,
                                  gdouble yu);

This function calls ncm_spline2d_integ_dy_spline and evaluates the resulting NcmSpline at x .

Parameters

s2d

a NcmSpline2d.

 

x

x-coordinate value.

 

yl

lower limit of integration.

 

yu

upper limit of integration.

 

Returns

The value of s2d integrated in y over the range [yl , yu ] and computed at x .


ncm_spline2d_integ_dxdy_spline_x ()

gdouble
ncm_spline2d_integ_dxdy_spline_x (NcmSpline2d *s2d,
                                  gdouble xl,
                                  gdouble xu,
                                  gdouble yl,
                                  gdouble yu);

This function calls ncm_spline2d_integ_dx_spline and integrates the resulting NcmSpline over the interval [yl , yu ].

Parameters

s2d

a NcmSpline2d.

 

xl

lower limit of integration in the x-direction.

 

xu

upper limit of integration in the x-direction.

 

yl

lower limit of integration in the y-direction.

 

yu

upper limit of integration in the y-direction.

 

Returns

The value of s2d integrated in x and y over the ranges [xl , xu ] and [yl , yu ], respectively.


ncm_spline2d_integ_dxdy_spline_y ()

gdouble
ncm_spline2d_integ_dxdy_spline_y (NcmSpline2d *s2d,
                                  gdouble xl,
                                  gdouble xu,
                                  gdouble yl,
                                  gdouble yu);

This function calls ncm_spline2d_integ_dy_spline and integrates the resulting NcmSpline over the interval [xl , xu ].

Parameters

s2d

a NcmSpline2d.

 

xl

lower limit of integration in the x-direction.

 

xu

upper limit of integration in the x-direction.

 

yl

lower limit of integration in the y-direction.

 

yu

upper limit of integration in the y-direction.

 

Returns

The value of s2d integrated in x and y over the ranges [xl , xu ] and [yl , yu ], respectively.


ncm_spline2dim_integ_total ()

gdouble
ncm_spline2dim_integ_total (NcmSpline2d *s2d);

Parameters

s2d

a NcmSpline2d.

 

Returns

The numerical integral in both x and y directions of an interpolated function over the entire valid ranges of x and y coordinates.

Types and Values

Property Details

The “spline” property

  “spline”                   NcmSpline *

NcmSpline object used internally.

Flags: Read / Write / Construct Only