File: Chebyshev.pod

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (112 lines) | stat: -rw-r--r-- 2,777 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
%perlcode %{
@EXPORT_OK = qw/
               gsl_cheb_alloc
               gsl_cheb_free
               gsl_cheb_init
               gsl_cheb_eval
               gsl_cheb_eval_err
               gsl_cheb_eval_n
               gsl_cheb_eval_n_err
               gsl_cheb_eval_mode
               gsl_cheb_eval_mode_e
               gsl_cheb_calc_deriv
               gsl_cheb_calc_integ
             /;
%EXPORT_TAGS = ( all => [ @EXPORT_OK ] );

__END__

=encoding utf8

=head1 NAME

Math::GSL::Chebyshev - Univariate Chebyshev Series Approximation

=head1 SYNOPSIS

    use Math::GSL::Chebyshev qw/:all/;

    my $cheb             = gsl_cheb_alloc(40);
    my $function         = sub { sin(cos($_[0])) };

    gsl_cheb_init($cheb, $function, 0, 10);

    my $x                = gsl_cheb_eval($cheb, 5.5 );
    my ($status,$y,$err) = gsl_cheb_eval_err($cheb, 7.5 );
    gsl_cheb_free($cheb);

=head1 DESCRIPTION

=over

=item * C<gsl_cheb_alloc($size)>

    my $cheb = gsl_cheb_alloc(50);

Allocates a new Chebyshev object with $size sample points.

=item * C<gsl_cheb_free($cheb)>

Deallocates memory associated to $cheb. Returns void.

=item * C<gsl_cheb_init($cheb,$function, $lower, $upper)>

    gsl_cheb_init($cheb, sub { sin(cos($_[0])) }, 0, 10 );

Initiate a Chebyshev object with a function and upper and lower bounds.
Returns void.

=item * C<gsl_cheb_eval($function, $value)>

    my $evaluated = gsl_cheb_eval($cheb, 5 );

Returns a Perl scalar of the Chebyshev object $cheb evaluated at $value.

=item * C<gsl_cheb_eval_err($cheb, $value)>

    my ($status,$evaluated,$err) = gsl_cheb_eval($cheb, 5 );

Returns a list consisting of a GSL status code, the evaluate value and
the estimated error of the evaluation.

=item * C<gsl_cheb_eval_n >

=item * C<gsl_cheb_eval_n_err >

=item * C<gsl_cheb_eval_mode >

=item * C<gsl_cheb_eval_mode_e >

=item * C<gsl_cheb_calc_deriv($deriv,$cheb) >

   my $status = gsl_cheb_calc_deriv( $deriv, $cheb );

This will calculate the derivative of $cheb and stores it
in $deriv, which must be pre-allocated. Returns a GSL status code.

=item * C<gsl_cheb_calc_integ($integ,$cheb) >

   my $status = gsl_cheb_calc_integ( $deriv, $cheb );

This will calculate the derivative of $cheb and stores it
in $deriv, which must be pre-allocated. Returns a GSL status code.

=back

For more information on the functions, we refer you to the GSL official
documentation: L<http://www.gnu.org/software/gsl/manual/html_node/>

=head1 AUTHORS

Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

%}