... something for tomorrow.

It's apparently a problem with the gsl library:
/* This file: gsl_spmatrix.c Modify the following "-I..." and "-L..." arguments accordingly. Using the gsl-2.6 library that ships with Strawberry Perl 5.32.1-PDL, +build with: gcc -o gsl_spmatrix.exe gsl_spmatrix.c -ID:/sp/_64/sp-5.32.1-PDL/c/inc +lude -LD:/sp/_64/sp-5.32.1-PDL/c/lib -lgsl -lgslcblas -lm Then execute gsl_spmatrix.exe Using the gsl-2.7.1 library provided by Alien, build with: gcc -o gsl_spmatrix.exe gsl_spmatrix.c -ID:/sp/_64/sp-5.32.1/perl/site +/lib/auto/share/dist/Alien-GSL/include -LD:/sp/_64/sp-5.32.1/perl/sit +e/lib/auto/share/dist/Alien-GSL/lib -lgsl -lgslcblas -lm Then execute gsl_spmatrix.exe */ #include <stdio.h> #include <stdlib.h> #include <gsl/gsl_spmatrix.h> int main(void) { size_t v = 1; v <<= 32; v += 1; printf("size of size_t is %d bytes\n", sizeof(size_t)); gsl_spmatrix *m = gsl_spmatrix_alloc(1,1); gsl_spmatrix_set( m, 1, 0, 1.5 ); printf("1: got: %f\n", gsl_spmatrix_get( m, 1, 0)); printf("1: nnz: %d\n", gsl_spmatrix_nnz( m )); gsl_spmatrix_set( m, v, 0, 1.75 ); if (v >= m->size1) printf("will be reported as 'out of range'\n"); printf("2: got: %f\n", gsl_spmatrix_get( m, v, 0 )); printf("2: nnz: %d\n", gsl_spmatrix_nnz( m )); return 0; } /* As is, the built executable outputs (for both gsl-2.6 and gsl-2.7.1): D:\C>gsl_spmatrix.exe size of _size_t is 8 bytes 1: got: 1.500000 1: nnz: 1 will be reported as 'out of range' gsl: getset_source.c:27: ERROR: first index out of range Default GSL error handler invoked. But if the line "v += 1;" is changed to "v += 2" or to "v += 3" or to +"v += 0" then the output is: D:\C>gsl_spmatrix.exe size of _size_t is 8 bytes 1: got: 1.500000 1: nnz: 1 2: got: 1.750000 2: nnz: 2 */
I haven't yet reached an understanding of the problem.
I think it should be reported to the gsl developers unless that has already been done.

Cheers,
Rob

In reply to Re^4: Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to? by syphilis
in thread Math::GSL::SparseMatrix is broken if installed on latest 5.32.1.1 "Strawberry Perl PDL edition", whom to report this issue to? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.