bugGNU Octave - Bugs: bug #45153, eigs returning an incorrrect...

 
 

bug #45153: eigs returning an incorrrect number of eigenvalues

Submitted by:  None
Submitted on:  Wed 20 May 2015 06:54:41 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: RenanOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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.

Rik <rik5>
Project Administrator
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.

Marco Caliari <caliari>
Project Member
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?

Rik <rik5>
Project Administrator
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?

Marco Caliari <caliari>
Project Member
Wed 12 Apr 2017 04:36:04 PM UTC, comment #9:

@Marco: Should your patch be committed to stable or dev?

Rik <rik5>
Project Administrator
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)

Marco Caliari <caliari>
Project Member
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.

Marco Caliari <caliari>
Project Member
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.

Marco Caliari <caliari>
Project Member
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.

Carnë Draug <carandraug>
Project Member
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.

Marco Caliari <caliari>
Project Member
Tue 21 Mar 2017 03:50:19 PM UTC, comment #3:

So, I propose the attach patch.

(file #40049)

Marco Caliari <caliari>
Project Member
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?

Marco Caliari <caliari>
Project Member
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?

Mike Miller <mtmiller>
Project Administrator
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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40201:  eigs_stable.patch added by caliari (25KiB - text/x-patch)
file #34065:  my_matrix added by None (362KiB - application/octet-stream)
file #34066:  example.m added by None (69B - text/x-objcsrc)

 

Depends on the following items

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 14 Nov 2017 05:45:29 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 29 Mar 2017 06:43:09 PM UTCcaliariAttached File-=>Added eigs_stable.patch, #40201
      StatusConfirmed=>Patch Submitted
    Wed 29 Mar 2017 06:30:58 PM UTCcaliariAttached File#40049=>Removed
    Thu 23 Mar 2017 12:26:55 PM UTCcaliariOpen/ClosedClosed=>Open
      Release4.2.1=>dev
    Tue 21 Mar 2017 03:50:19 PM UTCcaliariAttached File-=>Added eigs_number.patch, #40049
    Fri 17 Mar 2017 03:11:30 PM UTCcaliariItem GroupInaccurate Result=>Incorrect Result
      StatusDuplicate=>Confirmed
      Release3.8.1=>4.2.1
    Mon 22 Feb 2016 12:44:02 AM UTCmtmillerStatusNeed Info=>Duplicate
      Open/ClosedOpen=>Closed
      Dependencies-=>Depends on bugs #44004
    Wed 20 May 2015 11:08:10 PM UTCmtmillerItem GroupNone=>Inaccurate Result
      StatusNone=>Need Info
    Wed 20 May 2015 06:54:41 PM UTCNoneAttached File-=>Added my_matrix, #34065
      Attached File-=>Added example.m, #34066

    Back to the top


    Powered by Savane 3.1-cleanup1