Math::GSL::BLAS - Basic Linear Algebra Subprograms use Math::GSL::BLAS qw/:all/; The functions of this module are divised into 3 levels:

Level 1 - Vector operations

Level 2 - Matrix-vector operations

Level 3 - Matrix-matrix operations
You have to add the functions you want to use inside the qw /put_funtion_here /. You can also write use Math::GSL::BLAS qw/:all/ to use all avaible functions of the module. Other tags are also avaible, here is a complete list of all tags for this module : For more informations on the functions, we refer you to the GSL offcial documentation: <http://www.gnu.org/software/gsl/manual/html_node/> Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want This example shows how to do a matrix-matrix product of double numbers : use Math::GSL::Matrix qw/:all/; use Math::GSL::BLAS qw/:all/; my $A = Math::GSL::Matrix->new(2,2); $A->set_row(0, [1, 4]); ->set_row(1, [3, 2]); my $B = Math::GSL::Matrix->new(2,2); $B->set_row(0, [2, 1]); ->set_row(1, [5,3]); my $C = Math::GSL::Matrix->new(2,2); gsl_matrix_set_zero($C->raw); gsl_blas_dgemm($CblasNoTrans, $CblasNoTrans, 1, $A->raw, $B->raw, 1, $C->raw); my @got = $C->row(0)->as_list; print "The resulting matrix is: \n["; print "$got[0] $got[1]\n"; @got = $C->row(1)->as_list; print "$got[0] $got[1] ]\n"; This example shows how to compute the scalar product of two vectors : use Math::GSL::Vector qw/:all/; use Math::GSL::CBLAS qw/:all/; use Math::GSL::BLAS qw/:all/; my $vec1 = Math::GSL::Vector->new([1,2,3,4,5]); my $vec2 = Math::GSL::Vector->new([5,4,3,2,1]); my ($status, $result) = gsl_blas_ddot($vec1->raw, $vec2->raw); if($status == 0) { print "The function has succeeded. \n"; } print "The result of the vector multiplication is $result. \n"; Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> Copyright (C) 2008-2009 Jonathan Leto and Thierry Moisan This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.