help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] comment and code differ in francis.c, line 560,561


From: Patrick Alken
Subject: Re: [Help-gsl] comment and code differ in francis.c, line 560,561
Date: Mon, 03 Nov 2014 07:07:31 -0700
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

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

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