1 %module
"Math::GSL::Chebyshev"
3 %include
"gsl_typemaps.i"
5 #include
"gsl/gsl_chebyshev.h"
6 #include
"gsl/gsl_math.h"
7 #include
"gsl/gsl_mode.h"
9 %include
"gsl/gsl_chebyshev.h"
10 %include
"gsl/gsl_math.h"
11 %include
"gsl/gsl_mode.h"
28 %EXPORT_TAGS
= ( all
=> [ @EXPORT_OK
] );
34 Math
::GSL
::Chebyshev
- Univariate Chebyshev Series Approximation
38 use Math
::GSL
::Chebyshev qw
/:all
/;
40 my $cheb
= gsl_cheb_alloc
(40);
41 my $function
= sub
{ sin
(cos
($_
[0])) };
43 gsl_cheb_init
($cheb
, $function
, 0, 10);
45 my $x
= gsl_cheb_eval
($cheb
, 5.5 );
46 my
($status
,$y
,$err
) = gsl_cheb_eval_err
($cheb
, 7.5 );
51 Here is a list of all the functions in this module
:
55 =item
* C
<gsl_cheb_alloc
($size
)>
57 my $cheb
= gsl_cheb_alloc
(50);
59 Allocates a new Chebyshev object with $size sample points.
61 =item
* C
<gsl_cheb_free
($cheb
)>
63 Deallocates memory associated to $cheb. Returns void.
65 =item
* C
<gsl_cheb_init
($cheb
,$function
, $lower
, $upper
)>
67 gsl_cheb_init
($cheb
, sub
{ sin
(cos
($_
[0])) }, 0, 10 );
69 Initiate a Chebyshev object with a function and upper and lower bounds.
72 =item
* C
<gsl_cheb_eval
($function
, $value
)>
74 my $evaluated
= gsl_cheb_eval
($cheb
, 5 );
76 Returns a Perl scalar of the Chebyshev object $cheb evaluated at $value.
78 =item
* C
<gsl_cheb_eval_err
($cheb
, $value
)>
80 my
($status
,$evaluated
,$err
) = gsl_cheb_eval
($cheb
, 5 );
82 Returns a list consisting of a GSL status code
, the evaluate value and
83 the estimated error of the evaluation.
85 =item
* C
<gsl_cheb_eval_n
>
87 =item
* C
<gsl_cheb_eval_n_err
>
89 =item
* C
<gsl_cheb_eval_mode
>
91 =item
* C
<gsl_cheb_eval_mode_e
>
93 =item
* C
<gsl_cheb_calc_deriv
($deriv
,$cheb
) >
95 my $status
= gsl_cheb_calc_deriv
( $deriv
, $cheb
);
97 This will calculate the derivative of $cheb and stores it
98 in $deriv
, which must be pre-allocated. Returns a GSL status code.
100 =item
* C
<gsl_cheb_calc_integ
($integ
,$cheb
) >
102 my $status
= gsl_cheb_calc_integ
( $deriv
, $cheb
);
104 This will calculate the derivative of $cheb and stores it
105 in $deriv
, which must be pre-allocated. Returns a GSL status code.
109 For more informations on the functions
, we refer you to the GSL offcial
110 documentation
: L
<http
://www.gnu.org
/software
/gsl
/manual
/html_node
/>
112 Tip
: search on google
: site
:http
://www.gnu.org
/software
/gsl
/manual
/html_node
/ name_of_the_function_you_want
117 Jonathan Leto
<jonathan@leto.net
> and Thierry Moisan
<thierry.moisan@gmail.com
>
119 =head1 COPYRIGHT
AND LICENSE
121 Copyright
(C
) 2008 Jonathan Leto and Thierry Moisan
123 This program is free software
; you can redistribute it and
/or modify it
124 under the same terms as Perl itself.