|
From: | Markus Mützel |
Subject: | [Octave-bug-tracker] [bug #60738] logm returning incorrect result with some real non-symmetric matrices |
Date: | Thu, 17 Jun 2021 12:45:29 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36 Edg/91.0.864.48 |
Follow-up Comment #7, bug #60738 (project octave): Thanks for the patch. (Unfortunately, it didn't apply for me.) I pushed the part of it that adds the tolerance to the check for real negative values in a complex vector here: https://hg.savannah.gnu.org/hgweb/octave/rev/fe06c183cc4e Additionally, I pushed a patch that fixes e.g. `logm (zeros (3))` here: https://hg.savannah.gnu.org/hgweb/octave/rev/4778b21b1386 I'm not sure about the impact of the other changes in your patch. Maybe those should better go to the default branch? I tried `logm(ones(3))` in Matlab and it gives a different result: >> logm(ones(3)) Warning: Principal matrix logarithm is not defined for A with nonpositive real eigenvalues. A non-principal matrix logarithm is returned. > In logm (line 63) ans = -24.713572198920126 + 2.094395102393196i 13.566584297695865 - 1.047197551196598i 12.245600189892365 - 1.047197551196598i 13.566584297695865 - 1.047197551196598i -24.713572198920119 + 2.094395102393195i 12.245600189892361 - 1.047197551196597i 12.245600189892365 - 1.047197551196598i 12.245600189892361 - 1.047197551196597i -23.392588091116618 + 2.094395102393195i I don't know if one or the other is "more correct" though. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?60738> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |