|
From: | David Bateman |
Subject: | Re: 3.2.3 RC2 |
Date: | Thu, 03 Sep 2009 23:40:28 +0200 |
User-agent: | Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
Dmitri A. Sergatskov wrote:
I'd always had problems with ARPACK with matrices with lots of eigenvalues very close to each other and this test case was deliberately create to make life hard for ARPACK in this manner. Basically it seems iterative eigensolvers don't seem to like cases like that.On Wed, Sep 2, 2009 at 1:29 PM, John W. Eaton<address@hidden> wrote:The test is: n = 100; k = 7; a = sparse([3:n,1:n,1:(n-2)],[1:(n-2),1:n,3:n],[ones(1,n-2),0.4*n*ones(1,n),ones(1,n-2)]); [u,s,v] = svd(full(a)); s = diag(s); [dum, idx] = sort(abs(s)); s = s(idx); u = u(:,idx); v = v(:,idx); [u2,s2,v2,flag] = svds(a,k,0); s2 = diag(s2); assert(flag,!1); assert(s(k:-1:1), s2, 1e-10); If you run this repeatedly, do you see some successes and some failures? If it does fail, do you see that the first assert sometimes fails, and other times it is the second?
This test matrix has 100 real eigenvalues between 38 and 40, and it used to run fine for me, but I too am now seeing the same errors.. I suspect minor changes in the optimizations of the compiler that mean that the eigensolver no longer converges.
Choose a sigma of zero was to ensure that the smallest eigenvalues were always found and choosing a sigma closer to the actual minimum eigenvalue will improve the convergence. Changing the line
[u2,s2,v2,flag] = svds(a,k,0); to [u2,s2,v2,flag] = svds(a,k,38); or even [u2,s2,v2,flag] = svds(a,k,0.1);removes this issue for me. So if we just assume that this is a particularly nasty problem, that ARPACK has difficulties handling then I'd suggest making this change as a means of getting the tests to pass while still testing the functionality of svds
D.
It is alway seems to be in the second, but I get different warnings from time to time. Most often it is: warning: returning fewer singular values than requested warning: try increasing the value of sigma error: assert (s (k:-1:1),s2,1e-10) expected 38.034 38.034 38.015 38.015 38.004 38.004 but got 38.060 38.034 38.034 38.015 38.015 38.004 38.004 Dimensions don't match
WIth this issue you get a warning, so I'd consider this less of a problem..
but sometimes it is just: error: assert (s (k:-1:1),s2,1e-10) expected 38.060 38.060 38.034 38.034 38.015 38.015 38.004 but got 38.060 38.034 38.034 38.015 38.015 38.004 38.004 maximum absolute error 0.0263523 exceeds tolerance 1e-10
This one you don't get a warning and you're missing one of the pair of the minimum eigenvalue..
D.
I have not tried to debug the problem yet. David, I'm copying you because you wrote svds and might be able to see the problem and perhaps a fix more quickly than I could. Thanks, jweDmitri. --
-- David Bateman address@hidden 35 rue Gambetta +33 1 46 04 02 18 (Home) 92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
[Prev in Thread] | Current Thread | [Next in Thread] |