Tue 14 Nov 2017 05:45:29 AM UTC, comment #13:
I applied all 3 patches from this bug report including some cleanup of my own.
http://hg.savannah.gnu.org/hgweb/octave/rev/1310d8b50ec2
http://hg.savannah.gnu.org/hgweb/octave/rev/97e628756971
http://hg.savannah.gnu.org/hgweb/octave/rev/0350da83c049
http://hg.savannah.gnu.org/hgweb/octave/rev/6bd7d2eb6434
Marking as fixed and closing report.
|
Tue 18 Apr 2017 07:48:37 AM UTC, comment #12:
@Rik: c605fc872418 solves the bug here. 77f18770506c is an improvement of the current code, and should be applied to default, only. fecd38e4cb88 solves a compatibility issure not yet reported.
|
Mon 17 Apr 2017 03:51:35 AM UTC, comment #11:
@Marco: I checked your repository and I see the following:
You mentioned only cset c605fc872418. Do the other two also need to be applied?
|
Wed 12 Apr 2017 06:11:29 PM UTC, comment #10:
@Rik: as written to the dev mailing list, now I have a bookmark eigs starting from default on a personal repository on bitbucket https://bitbucket.org/caliari/octave
The changeset is c605fc8 (it is an improved version wrt the patch here). What is the easiest way, to fix on default and merge to stable or the other way round?
|
Wed 12 Apr 2017 04:36:04 PM UTC, comment #9:
@Marco: Should your patch be committed to stable or dev?
|
Wed 29 Mar 2017 06:43:09 PM UTC, comment #8:
Finally, I have a patch to the stable branch. I think there was already a tentative to give the exact number of required eigenvalues, but not working, and buggy in fact. See the new test containing isnan. The same test showed a differente bug in ARPACK itself ( https://github.com/opencollab/arpack-ng/issues/58).
I also fixed bug #47236, somehow related. Now eigs returns the correct number of eigenvalues and "essentially" in the same order for the calls [v1,d1] = eigs(...) and d2 = eigs(...). Some discrepancies are still possible, however, when conjugate pairs are present. For instance, it is possible that
and
This is ARPACK. I also allowed p to take the value n (as in Matlab and ARPACK), since it can speed up the convergence.
Please revise my patch.
(file #40201)
|
Fri 24 Mar 2017 06:10:27 PM UTC, comment #7:
@Carnë: you said eig, but here it is eigs. eigs.m calls _eigs_.cc which calls eigs-base.cc.
|
Fri 24 Mar 2017 01:37:24 PM UTC, comment #6:
With reference to comment #4, the matrix is almost singular. Therefore, the weird results are expected for 'sm' mode. In fact, it coincides with shift 0 and therefore OP is inv(A-0*I) which is almost singular. The singularity of A is not detected (the estimated condition number is slightly larger than eps) and the code does not break nor return a warning. The same happens on Matlab and plain ARPACK.
Coming back to the original bug (number of eigenvalues), it is not correct to simply remove the last one. In fact, it may happen it is not one of the smallest in magnitude. Try
So, we should sort the eigenvalues and then discard the opposite of the required ones. I think this is also related to #47236. In a word, the fix requires some time.
|
Thu 23 Mar 2017 04:43:29 PM UTC, comment #5:
I would just add that since eig is in liboctave, it would be nice if the fix could be done there.
|
Thu 23 Mar 2017 12:26:55 PM UTC, comment #4:
I discovered that the result for this my_matrix is simply wrong (not only the number of eigenvalues), even with the two recent changesets to eigs. Please, ignore the attached patch.
|
Tue 21 Mar 2017 03:50:19 PM UTC, comment #3:
So, I propose the attach patch.
(file #40049)
|
Fri 17 Mar 2017 03:11:30 PM UTC, comment #2:
For real problems, ARPACK always gives back the possible conjugate pairs. Therefore, it may happen that it gives back one additional eigenvalue. In this case, if the output is 17 eigenvalues, we should keep the 16 with smallest magnitute 'sm'. I think it is possible to use the select subfunction already in eigs.m. Comments?
|
Wed 20 May 2015 11:08:10 PM UTC, comment #1:
Thanks for your bug report. Can you check bug #44004 and see if it is describing the same problem you are experiencing?
|
Wed 20 May 2015 06:54:41 PM UTC, original submission:
When running the eigs function on a matrix (attached) while requesting a fixed number of eigenvectors, eigs doesn't always return the requested number of eigenvectors.
In the following example, I requested the 16 smallest eigenvectors:
Running this code several times in succession sometimes returns 16 eigenvalues and vectors, and sometimes 17:
In this example the matrix is sparse, but the same thing happens for the equivalent full matrix.
|