[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: variability in a test for eigs.cc
From: |
Ben Abbott |
Subject: |
Re: variability in a test for eigs.cc |
Date: |
Sun, 28 Mar 2010 19:46:03 -0400 |
On Mar 28, 2010, at 7:01 PM, David Bateman wrote:
> Ben Abbott wrote:
>> On Mar 28, 2010, at 4:07 PM, Michael D Godfrey wrote:
>>
>>
>>> On 03/28/2010 12:42 PM, Ben Abbott wrote:
>>>
>>>> Thanks. Perhaps the right thing to do is to loop through the test 3 times
>>>> and check that at least one result is less than 1e-11.
>>>>
>>>> If there is no objection, I'll try to push that change later today.
>>>>
>>>> Ben
>>>>
>>> I think it would be a good idea to let whoever has had responsibility
>>> for this algorithm to take a look and determine a few things like: what
>>> inputs produce largest errors and can anything be done about improving
>>> accuracy.
>>>
>>> Michael
>>>
>>
>> ok. It looks to me like David introduced these tests.
>>
>> I've cc'd him.
>>
>> David, do you have any suggestion for how to deal with the variability in
>> the eigs.cc test?
>>
>> The start of this thread is at the link below.
>>
>>
>> https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2010-March/015680.html
>>
>> Ben
>>
>
> This test as you've written it shouldn't use 'li'. The matrix is hermitian
> and the eigenvalues as real and so looking for the largest imaginary part of
> the eigenvalues will just give you noise. You should use 'lr' instead in this
> case.
>
> D.
David thanks for responding so quickly. If I infer correctly this test was
intended to use "li".
http://hg.savannah.gnu.org/hgweb/octave/rev/654bcfb937bf
How may the test below be rewritten so that a stable result is obtained?
%!test
%! [v1,d1] = eigs(A, k, 'li');
%! d1 = diag(d1);
%! for i=1:k
%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12)
%! endfor
Ben
Re: variability in a test for eigs.cc, Ben Abbott, 2010/03/30