Apply nan/inf handling patch from Sisyphus
[Math-GSL.git] / BSpline.i
blob3ec39428836277adb4665d9ec654b92c7ffdc006
1 %module "Math::GSL::BSpline"
2 %{
3 #include "gsl/gsl_bspline.h"
4 #include "gsl/gsl_vector.h"
5 %}
7 %include "gsl/gsl_bspline.h"
8 %include "gsl/gsl_vector.h"
11 %perlcode %{
12 @EXPORT_OK = qw/
13 gsl_bspline_alloc
14 gsl_bspline_free
15 gsl_bspline_ncoeffs
16 gsl_bspline_order
17 gsl_bspline_nbreak
18 gsl_bspline_breakpoint
19 gsl_bspline_knots
20 gsl_bspline_knots_uniform
21 gsl_bspline_eval
23 %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
25 __END__
27 =head1 NAME
29 Math::GSL::BSpline - Functions for the computation of smoothing basis splines
31 =head1 SYNOPSIS
33 use Math::GSL::BSpline qw/:all/;
35 =head1 DESCRIPTION
37 Here is a list of all the functions included in this module :
39 gsl_bspline_alloc($k, $nbreak) - This function allocates a workspace for computing B-splines of order $k. The number of breakpoints is given by $nbreak. This leads to n = $nbreak + $k - 2 basis functions. Cubic B-splines are specified by $k = 4.
40 gsl_bspline_free($w) - This function frees the memory associated with the workspace $w.
41 gsl_bspline_ncoeffs($w) - This function returns the number of B-spline coefficients given by n = nbreak + k - 2.
42 gsl_bspline_order
43 gsl_bspline_nbreak
44 gsl_bspline_breakpoint
45 gsl_bspline_knots($breakpts, $w) - This function computes the knots associated with the given breakpoints inside the vector $breakpts and stores them internally in $w->{knots}.
46 gsl_bspline_knots_uniform($a, $b, $w) - This function assumes uniformly spaced breakpoints on [$a,$b] and constructs the corresponding knot vector using the previously specified nbreak parameter. The knots are stored in $w->{knots}.
47 gsl_bspline_eval($x, $B, $w) - This function evaluates all B-spline basis functions at the position $x and stores them in the vector $B, so that the ith element of $B is B_i($x). $B must be of length n = $nbreak + $k - 2. This value may also be obtained by calling gsl_bspline_ncoeffs. It is far more efficient to compute all of the basis functions at once than to compute them individually, due to the nature of the defining recurrence relation.
49 For more informations on the functions, we refer you to the GSL offcial documentation:
50 http://www.gnu.org/software/gsl/manual/html_node/
51 Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want
53 =head1 EXAMPLES
56 =head1 AUTHORS
58 Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
60 =head1 COPYRIGHT AND LICENSE
62 Copyright (C) 2008 Jonathan Leto and Thierry Moisan
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
67 =cut