Scroll to navigation

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

NAME

Math::GSL::Linalg - Functions for solving linear systems

SYNOPSIS

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

DESCRIPTION

Here is a list of all the functions included in this module :

Performs a Givens rotation on the vector ($a,$b) and stores the answer in $c and $s.
Performs a Givens rotation on the $i and $j-th elements of $v, storing them in $c and $s.
 You have to add the functions you want to use inside the qw /put_function_here / with spaces between each function. You can also write use Math::GSL::Complex qw/:all/ to use all available functions of the module.
    

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

EXAMPLES

This example shows how to compute the determinant of a matrix with the LU decomposition:

 use Math::GSL::Matrix qw/:all/;
 use Math::GSL::Permutation qw/:all/;
 use Math::GSL::Linalg qw/:all/;
 my $Matrix = gsl_matrix_alloc(4,4);
 map { gsl_matrix_set($Matrix, 0, $_, $_+1) } (0..3);
 gsl_matrix_set($Matrix,1, 0, 2);
 gsl_matrix_set($Matrix, 1, 1, 3);
 gsl_matrix_set($Matrix, 1, 2, 4);
 gsl_matrix_set($Matrix, 1, 3, 1);
 gsl_matrix_set($Matrix, 2, 0, 3);
 gsl_matrix_set($Matrix, 2, 1, 4);
 gsl_matrix_set($Matrix, 2, 2, 1);
 gsl_matrix_set($Matrix, 2, 3, 2);
 gsl_matrix_set($Matrix, 3, 0, 4);
 gsl_matrix_set($Matrix, 3, 1, 1);
 gsl_matrix_set($Matrix, 3, 2, 2);
 gsl_matrix_set($Matrix, 3, 3, 3);
 my $permutation = gsl_permutation_alloc(4);
 gsl_permutation_init($permutation);
 my ($result, $signum) = gsl_linalg_LU_decomp($Matrix, $permutation);
 my $det = gsl_linalg_LU_det($Matrix, $signum);
 print "The value of the determinant of the matrix is $det \n";

AUTHORS

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

COPYRIGHT AND LICENSE

Copyright (C) 2008-2023 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-03-07 perl v5.38.2