Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The intent was to use sparse matrix (vector) with very large indices, expressed as 64-bit integers.
use strict; use warnings; use feature 'say'; use Math::GSL::SparseMatrix ':all'; my $m = gsl_spmatrix_alloc( 1, 1 ); die if gsl_spmatrix_set( $m, 0, 0, 1 ); say gsl_spmatrix_nnz( $m ); die if gsl_spmatrix_set( $m, 123 + 1 << 32, 0, 1 ); say gsl_spmatrix_nnz( $m ); die if gsl_spmatrix_set( $m, 456 + 1 << 32, 0, 1 ); say gsl_spmatrix_nnz( $m );
The "OK" output is "1 2 3" (newlines instead of spaces), failure, as observed, is "1 1 1".
I used to be able to do "OK" with 5.26 "Strawberry Perl PDL Edition", with relevant PDL, Math::GSL, Alien::GSL, etc., of a few years ago. Now (hours of tests and frustration skipped), output is "OK" with
Failure is with
I don't know whose bug is that. Only issue with Math::GSL, in my view, is it doesn't test against such failure, can't anticipate everything, maybe they'll add it in retrospect. Issue with PDL is it's in title of Perl distribution that fails, can't blame them. If it's issue with "Strawberry" pack, don't know how to prove it's their issue, besides unfortunately looks like it's nobody to prove it to anymore. Whew, at least it's documented here now and could save some poor soul hours of bug hunting.
|
---|