Added myself to the CREDITS file (after Jonathan Leto reminded me about it)
[Math-GSL.git] / pod / Sum.pod
blob4202c8401b5b4aad6ca199d88f306ce48542d1f6
1 %perlcode %{
2 @EXPORT_OK = qw/
3                gsl_sum_levin_u_alloc 
4                gsl_sum_levin_u_free 
5                gsl_sum_levin_u_accel 
6                gsl_sum_levin_u_minmax 
7                gsl_sum_levin_u_step 
8                gsl_sum_levin_utrunc_alloc 
9                gsl_sum_levin_utrunc_free 
10                gsl_sum_levin_utrunc_accel 
11                gsl_sum_levin_utrunc_minmax 
12                gsl_sum_levin_utrunc_step 
13              /;
14 %EXPORT_TAGS = ( all => \@EXPORT_OK );
16 __END__
18 =head1 NAME
20 Math::GSL::Sum - Functions to accelerate the convergence of a series using the Levin u-transform.
22 =head1 SYNOPSIS
24     use Math::GSL::Sum qw/:all/;
26     my $w = gsl_sum_levin_u_alloc(5);
27     $values = [8,2,3,4,6];
28     my ($status, $sum_accel, $abserr) = gsl_sum_levin_u_accel($values, 5, $w); 
29     gsl_sum_levin_u_free($w);
31     my $w2 = gsl_sum_levin_utrunc_alloc(5);
32     my ($status2, $sum_accel2, $abserr_trunc) = gsl_sum_levin_utrunc_accel($values, 5, $w2);
33     gsl_sum_levin_utrunc_free($w);
35 =head1 DESCRIPTION
37 Here is a list of all the functions included in this module :
39 =over
41 =item * gsl_sum_levin_u_alloc($n) - This function allocates a workspace for a Levin u-transform of $n terms.
43 =item * gsl_sum_levin_u_free($w) - This function frees the memory associated with the workspace $w. 
45 =item * gsl_sum_levin_u_accel($array, $array_size, $w) - This function takes the terms of a series in the array reference $array of size $array_size and computes the extrapolated limit of the series using a Levin u-transform. Additional working space must be provided in $w. The function returns multiple values in this order : 0 if the operation succeeded, 1 otherwise, the extrapolated sum and an estimate of the absolute error. The actual term-by-term sum is returned in $w->{sum_plain}. The algorithm calculates the truncation error (the difference between two successive extrapolations) and round-off error (propagated from the individual terms) to choose an optimal number of terms for the extrapolation. All the terms of the series passed in through array should be non-zero. 
47 =item * gsl_sum_levin_u_minmax 
49 =item * gsl_sum_levin_u_step 
51 =item * gsl_sum_levin_utrunc_alloc($n) - This function allocates a workspace for a Levin u-transform of $n terms, without error estimation. 
53 =item * gsl_sum_levin_utrunc_free($w) - This function frees the memory associated with the workspace $w. 
55 =item * gsl_sum_levin_utrunc_accel($array, $array_size, $w) - This function takes the terms of a series in the array reference $array of size $array_size and computes the extrapolated limit of the series using a Levin u-transform. Additional working space must be provided in $w. The function returns multiple values in this order : 0 if the operation succeeded, 1 otherwise, the extrapolated sum and an estimate of the error. The actual term-by-term sum is returned in $w->{sum_plain}. The algorithm terminates when the difference between two successive extrapolations reaches a minimum or is sufficiently small. To improve the reliability of the algorithm the extrapolated values are replaced by moving averages when calculating the truncation error, smoothing out any fluctuations.
57 =item * gsl_sum_levin_utrunc_minmax 
59 =item * gsl_sum_levin_utrunc_step 
61 =back
63 =head1 AUTHORS
65 Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
67 =head1 COPYRIGHT AND LICENSE
69 Copyright (C) 2008-2009 Jonathan Leto and Thierry Moisan
71 This program is free software; you can redistribute it and/or modify it
72 under the same terms as Perl itself.
74 =cut