10 use Math
::GSL
::Test qw
/:all/;
11 use Math
::GSL
::Const qw
/:all/;
12 use Math
::GSL
::Errno qw
/:all/;
13 use Math
::GSL
::Vector qw
/:file/;
14 use Math
::GSL
::Machine qw
/:all/;
18 $GSL_MODE_DEFAULT $GSL_PREC_DOUBLE
19 $GSL_PREC_SINGLE $GSL_PREC_APPROX
23 our %EXPORT_TAGS = ( all => \@EXPORT_OK, );
25 our ($GSL_PREC_DOUBLE, $GSL_PREC_SINGLE, $GSL_PREC_APPROX ) = 0 .. 2;
26 our $GSL_MODE_DEFAULT = $GSL_PREC_DOUBLE;
27 our $VERSION = '0.17_01';
31 Math::GSL - Perl interface to the GNU Scientific Library (GSL)
39 use Math::GSL::Matrix;
40 my $matrix = Math::GSL::Matrix->new(5,5); # 5x5 zero matrix
41 # note that columns and rows are zero-based
42 $matrix->set_col(0, [1..5]) # set *first* column to 1,2,3,4,5
43 ->set_row(2, [5..9]); # set *third* column to 5,6,7,8,9
44 my @matrix = $matrix->as_list; # matrix as Perl list
45 my $gsl_matrix = $matrix->raw; # underlying GSL object
48 my $rng = Math::GSL::RNG->new;
49 my @random_numbers = map { $rng->get } (1 .. 1000);
51 use Math::GSL::Deriv qw/:all/;
52 my $function = sub { my $x=shift; sin($x**2) };
53 my ($status,$val,$err) = gsl_deriv_central($function, 5, 0.01 );
55 Each GSL subsystem has it's own module. For example, the random number generator
56 subsystem is Math::GSL::RNG. Many subsystems have a more Perlish and
57 object-oriented frontend which can be used, as the above example shows. The raw
58 GSL object is useful for using the low-level GSL functions, which in the case of
59 the Matrix subsytem, would be of the form gsl_matrix_* . Each module has further
60 documentation about the low-level C functions as well as using the more
61 intuitive (but slightly slower) object-oriented interface.
65 Math::GSL::BLAS - Linear Algebra Functions
66 Math::GSL::BSpline - BSplines
67 Math::GSL::CBLAS - Linear Algebra Functions
68 Math::GSL::CDF - Cumulative Distribution Functions
69 Math::GSL::Chebyshev - Chebyshev Polynomials
70 Math::GSL::Combination - Combinatoric Functions
71 Math::GSL::Complex - Complex Numbers
72 Math::GSL::Const - Various Constants
73 Math::GSL::DHT - Discrete Hilbert Transform
74 Math::GSL::Deriv - Numerical Derivative
75 Math::GSL::Eigen - Eigenvalues and Eigenvectors
76 Math::GSL::Errno - Error Handling
77 Math::GSL::FFT - Fast Fourier Transform
78 Math::GSL::Fit - Curve Fitting
79 Math::GSL::Heapsort - Sorting Heaps
80 Math::GSL::Histogram - Histograms
81 Math::GSL::Histogram2D - 2D Histograms
82 Math::GSL::Integration - Numerical Integration
83 Math::GSL::Interp - Interpolation
84 Math::GSL::Linalg - Linear Algebra
85 Math::GSL::Machine - Machine Specific Information
86 Math::GSL::Matrix - NxM Matrices
87 Math::GSL::Min - Minimization
88 Math::GSL::Monte - Monte Carlo Integrations
89 Math::GSL::Multifit - Multivariable Fitting
90 Math::GSL::Multimin - Multivariable Minimization
91 Math::GSL::Multiroots - Muiltvariable Root Finding
92 Math::GSL::NTuple - N Tuples
93 Math::GSL::ODEIV - Ordinary Differential Equation Solvers (Initial Value Problems)
94 Math::GSL::Permutation - Permutations
95 Math::GSL::Poly - Polynmials
96 Math::GSL::PowInt - Integer Power Functions
97 Math::GSL::QRNG - Quasi-Random Number Generators
98 Math::GSL::RNG - Random Number Generators
99 Math::GSL::Randist - Random Number Distributions
100 Math::GSL::Roots - Root Finding Algorithms
101 Math::GSL::SF - Special Functions
102 Math::GSL::Siman - Simulated Annealing
103 Math::GSL::Sort - Sorting
104 Math::GSL::Spline - Splines
105 Math::GSL::Statistics - Statistics Functions
106 Math::GSL::Sum - Summation
107 Math::GSL::Sys - Sytem utility functions
108 Math::GSL::Vector - N-dimensional Vectors
109 Math::GSL::Wavelet - Basic Wavelets
110 Math::GSL::Wavelet2D - 2D Wavelets
115 Jonathan Leto, C<< <jonathan@leto.net> >> and Thierry Moisan C<< <thierry.moisan@gmail.com> >>
119 This software is still in active development, we appreciate your detailed bug reports and
120 documentation patches. Please report any bugs or feature requests to the authors directly.
125 You can find documentation for this module with the perldoc command.
129 or online at L<http://leto.net/code/Math-GSL/>
133 =item * AnnoCPAN: Annotated CPAN documentation
135 L<http://annocpan.org/dist/Math::GSL>
139 L<http://cpanratings.perl.org/d/Math::GSL>
143 L<http://search.cpan.org/dist/Math::GSL>
149 If you would like the help develop Math::GSL, email the authors
152 git clone http://leto.net/code/Math-GSL.git
154 git checkout -b bleed # create new local branch
155 git pull origin bleed # pull in remote bleed
157 to get the latest source, which is a two-headed beast with branches master and
158 bleed. The master branch is our stable branch, which is periodically sync-ed
159 with bleed. To view the latest source code online, go to
160 L<http://leto.net/gitweb/>. The latest version of Git can be found at
163 =head1 ACKNOWLEDGEMENTS
165 Thanks to PDX.pm, The Perl Foundation and everyone at Google who makes
166 the Summer of Code happen each year. You rock.
170 This Perl module is dedicated in memory of Nick Ing-Simmons.
172 =head1 COPYRIGHT & LICENSE
174 Copyright 2008 Jonathan Leto, Thierry Moisan all rights reserved.
176 This program is free software; you can redistribute it and/or modify it
177 under the same terms as Perl itself.
183 my ($self,$args) = @_;
184 my $class = ref $self || $self || 'Math::GSL';
190 my ($file, $mode) = @_;
191 $mode .= '+b' if (is_windows() and $mode !~ /\+b/);
192 return Math::GSL::Vector::fopen($file, $mode);
198 return Math::GSL::Vector::fclose($file);