Math::...eMatrix(3pm)
β¨ NAME β¨
Math::GSL::SparseMatrix β Sparse Matrices π¦ (and yes bestie, the man header literally renders it as Math::...eMatrix(3pm) because those long Perl module names cannot fit in the top line, it's giving cropped for the algorithm π
)
πΈ SYNOPSIS πΈ
use Math::GSL::SparseMatrix qw/:all/;
use Math::GSL::Matrix qw/gsl_matrix_alloc/;
my $sparse = gsl_spmatrix_alloc(100,100);
my $status = gsl_spmatrix_set($sparse,50,50,42.42);
my $value = gsl_spmatrix_get($sparse,50,50);
# multiply every element by 5
$status = gsl_spmatrix_scale($sparse, 5);
# get the number of non-zero elements
my $nnz = gsl_spmatrix_nnz($sparse);
# fine min and max values, other than zero elements
($status, $min, $max) = gsl_spmatrix_minmax($sparse);
# set all elements to zero
$status = gsl_spmatrix_set_zero($sparse);
my $dense = gsl_matrix_alloc(100,100);
# convert a sparse matrix to a dense matrix
$status = gsl_spmatrix_sp2d($dense, $sparse);
# convert a dense matrix to a sparse matrix
$status = gsl_spmatrix_d2sp($sparse, $dense);
okay so literally just skim that and you already know what this module does π it's sparse matrices, it's the whole vibe, no cap.
π DESCRIPTION π
NOTE: This module requires GSL 2.0 or higher. π
Like, do not even try it with anything older, it will simply not slay. β
For more information on the functions, we refer you to the GSL official documentation: <http://www.gnu.org/software/gsl/manual/html_node/> π
that's the source of truth bestie, go read it, it's iconic.
π«Ά AUTHORS π«Ά
Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
two absolute legends, we stan π
π COPYRIGHT AND LICENSE π
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. π
fr fr, same terms as Perl, that's the whole deal, no extra fine print, periodt.
perl v5.42.3 Β· 2026-08-20 Β· Math::...eMatrix(3pm) β that's the footer bestie, generated on that date by that perl, in the User Contributed Perl Documentation section of your friendly neighbourhood man π
bye now, go allocate something sparse π¦
π¦ where this page comes from
- ubuntu stonking: libmath-gsl-perl 0.49-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms