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


bug #32075: logm with an identity matrix

Submitted by:  Guillaume <gyom>
Submitted on:  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

Add a New Comment (Rich Markup)

You are not logged in

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


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:


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>
Project 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).


(file #22385)

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

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)

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

    Only project 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 guyrt7@wfu.edu
        Carbon-Copy- => Added marco.caliari@univr.it

    Back to the top

    Powered by Savane 3.5