bugGNU Octave - Bugs: bug #32075, logm with an identity matrix

 
 

bug #32075: logm with an identity matrix

Submitter:  Guillaume <gyom>
Submitted:  Fri 07 Jan 2011 03:51:39 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 10 Jan 2011 07:55:51 PM UTC, comment #3: 

Thanks for the suggestion.  I did that, but also left my code in place because we need to ensure that


logm (full (eye (3))


also works.  I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/ff7e0776ba0f

I don't see a quick test to decide whether a full matrix has nonzero elements only on the diagonal.  Maybe we should have one.  If we did, we could speed things up a bit more.

I think this problem is fixed now, so I'm closing this report.

John W. Eaton <jwe>
Group administrator
Mon 10 Jan 2011 03:57:42 PM UTC, comment #2: 

Why not a behavior similar to expm? m is equal to 1 (not 0) only in the case s is the identity. The enclosed patch treats explicitly the scalar case and the diagonal case (in particular, the identity).

Marco

(file #22385)

Marco Caliari <caliari>
Group Member
Fri 07 Jan 2011 07:21:34 PM UTC, comment #1: 

I'm attaching a changeset that appears to fix the problem for me, but I'd like confirmation that this is the right thing to do from someone who understands this algorithm better than I do before I commit it.

(file #22373)

John W. Eaton <jwe>
Group administrator
Fri 07 Jan 2011 03:51:39 PM UTC, original submission:  

Computing the matrix logarithm of an identity matrix crashes with Octave dev:
octave> logm(eye(3))
error: gauss_legendre: A(I,J): row index out of bounds; value 1 out of bound 0
while it returns zeros(3) on Octave 3.2.4 and MATLAB.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22385:  logm.m.diff added by caliari (389B - text/x-patch)
file #22373:  diffs.txt added by jwe (972B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by caliari (Updated the item)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by jwe
  • -email is unavailable- added by jwe
  • -email is unavailable- added by jwe
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-10 jwe StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2011-01-10 caliari Attached File- Added logm.m.diff, #22385
    2011-01-07 jwe Attached File- Added diffs.txt, #22373
        StatusNone Patch Submitted
        Carbon-Copy- Added highegg
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code