I'm pretty confident that the code is correct, as the francis module has been tested extensively on lots of different matrices. I think the confusion is between C indexing starting at 0, and matrix notation using 1 as the first row/column.

On 11/02/2014 04:04 PM, Kurt Alan Franke wrote:
Hello all,

My first post. I am looking at the francis.c file of gsl-1.16, lines 560.. and 
found:

           /* q = max(1, i - 1) */
           q = (1 > ((int)i - 1)) ? 0 : (i - 1);

           /* r = min(i + 3, N - 1) */
           r = ((i + 3) < (N - 1)) ? (i + 3) : (N - 1);

The first comment doesn’t appear to agree with the code below.

i   q   max(1,i-1)
0  0  1 <--
1  0  1 <--
2  1  1
3  2  2
…

Is the comment wrong, or is there an error in the code? I assume the comment 
must be wrong. (?)
Does someone have the Golub book to check?

Kind regards,
Kurt



Reply via email to