Math::GSL::Integration(3pm) User Contributed Perl Documentation Math::GSL::Integration(3pm)

Math::GSL::Integration - Routines for performing numerical integration (quadrature) of a function in one dimension

    use Math::GSL::Integration qw /:all/;
    my $function = sub { $_[0]**2 } ;
    my ($lower, $upper ) = (0,1);
    my ($relerr,$abserr) = (0,1e-7);
    my ($status, $result, $abserr, $num_evals) = gsl_integration_qng ( $function,
                                                    $lower, $upper, $relerr, $abserr
                                                 );

This module allows you to numerically integrate a Perl subroutine. Depending on the properties of your function (singularities, smoothness) and the type of integration range (finite, infinite, semi-infinite), you will need to choose a quadrature routine that fits your needs.

This module also includes the following constants :

The following error constants are part of the Math::GSL::Errno module and can be returned by the gsl_integration_* functions :

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

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

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.

2024-10-15 perl v5.40.0