[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: norm of sparse matrices
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: norm of sparse matrices |
Date: |
Sat, 26 Nov 2011 19:35:09 -0500 |
2011/11/25 Jordi Gutiérrez Hermoso <address@hidden>:
> 2011/11/25 Marco Caliari <address@hidden>:
>> I gave a look at the paper and at Higham's code pnorm.m, but I don't see any
>> random initial guess. On the other hand, if look at this run
>>
>> octave:1> format long e
>> octave:2> S=sprand(5,5,0.5);
>> octave:3> norm(S)
>> ans = 1.25336637903553e+00
>> octave:4> norm(S)
>> ans = 1.25336637903553e+00
>> octave:5> norm(S)
>> ans = 1.25336638124303e+00
>> octave:6> norm(S)
>> ans = 1.25336638124303e+00
>> octave:7> norm(S)
>> ans = 1.25336638124303e+00
>> octave:8> norm(S)
>> ans = 1.25336638124303e+00
>> octave:9> norm(S)
>> ans = 1.25336638124303e+00
>> octave:10> norm(S)
>> ans = 1.25336638124303e+00
>>
>> you see that the norm changes at the third computation and then it remains
>> constant. This is not a random behaviour. Can anybody reproduce it? I can
>> *almost* always reproduce it.
>
> Yes, I was just able to reproduce that, and you're right, there's no
> randomisation in the algorithm. This may point to a deeper error,
> perhaps UB. I'm investigating with the debugger now...
I think I found the bug. There was some uninitialised memory getting
read. Can you test to see if this patch fixes the problem?
http://hg.savannah.gnu.org/hgweb/octave/rev/d672edef956e
Thanks,
- Jordi G. H.