bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] array, vector indices out-of-bounds in "linalg/bidiag.c"


From: Kort Travis
Subject: [Bug-gsl] array, vector indices out-of-bounds in "linalg/bidiag.c"
Date: Sun, 20 Apr 2008 00:37:31 -0500
User-agent: Thunderbird 1.5.0.12 (X11/20070719)

Hi:

In porting the code in gsl-1.11 "linalg/bidiag.c" to work with complex matrices 
I found the following array/vector indices will most definitely be out-of-bounds when 
j==N:

linalg/bidiag.c:  lines 308-317:

     for (j = N; j > 0 && j--;)
       {
         /* Householder column transformation to accumulate U */
         double tj = gsl_vector_get (tau_U, j);
         double Ajj = gsl_matrix_get (A, j, j);
         gsl_matrix_view m = gsl_matrix_submatrix (A, j, j, M-j, N-j);

         gsl_vector_set (tau_U, j, Ajj);
         gsl_linalg_householder_hm1 (tj, &m.matrix);
       }


Note here that the _size_ of matrix A is M x N, with M >= N, and the _size_ of 
vector tau_U is min(M,N).

Almost certainly the index of the for loop should read:

"for (j = N-1; j > 0 && j--;)".


I hope that this can help the maintainers of this section!  Unfortunately, at 
this point I work exclusively in C++, otherwise I would definitely offer more 
help to this project.


Thanks,



--
Kort Travis

--
Biomedical Optics and Nanodiagnostics
Sokolov research group, ENS 30
--

Department of Physics, RLM 5.208
University of Texas at Austin
Austin, TX 78712

email:   address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]