octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60738] logm returning incorrect result with s


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #60738] logm returning incorrect result with some real non-symmetric matrices
Date: Fri, 18 Jun 2021 03:04:46 -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 #10, bug #60738 (project octave):

The issue with the patch not applying might have been that there were local
changes before that change? At least, I cannot find hg id
9503a5411cce5cd4e11a995d02a850d6630ab58f in the public repository.

In general, patches are preferred over copies of the files with changes. One
advantage of patches is that they make clearer what the author intended to
change and make it easier to distinguish those changes from other ones that
might have occurred in the public repository in the mean time.

It's not clear to me why we would need to revert the changes we made so far. I
can't see why the current version would be any worse than what we had before.

Thanks for taking the time for explaining the motivation for the new code path
you propose. I think it should be save to apply those changes on the stable
branch. Please, check if the attached patch that applies to the current stable
branch fits your intensions.
I set you as the author of the patch. I hope that is ok with you.

I can't comment on why the algorithm uses `sqrtm`. But there are references to
the algorithm in the code:

## Reference: N. J. Higham, Functions of Matrices: Theory and Computation
##            (SIAM, 2008.)
[...]
    ## Algorithm 11.9 in "Function of matrices", by N. Higham


According to TheMathworks' documentation for that function[1], they are using
a different (newer) algorithm:
> [1] Al-Mohy, A. H. and Nicholas J. Higham, “Improved inverse scaling and
squaring algorithms for the matrix logarithm,” SIAM J. Sci. Comput., 34(4),
pp. C153–C169, 2012
>
> [2] Al-Mohy, A. H., Higham, Nicholas J. and Samuel D. Relton, “Computing
the Frechet derivative of the matrix logarithm and estimating the condition
number,” SIAM J. Sci. Comput.,, 35(4), pp. C394–C410, 2013

If we really wanted identical results to Matlab (I'm not sure if this is the
case), we would probably need to implement the same algorithm.

If there are issues with the algorithm used by `sqrtm`, we should probably
best tackle them in a separate report. Could you please open a new one for
that?
I didn't look in detail at the changes you proposed for `sqrtm`. But something
seems to be odd with the scoping of `colji` in the changed C++ code.

[1]: https://de.mathworks.com/help/matlab/ref/logm.html


(file #51579)
    _______________________________________________________

Additional Item Attachment:

File name: bug60738-logm-hermitian.patch  Size:3 KB
   
<https://file.savannah.gnu.org/file/bug60738-logm-hermitian.patch?file_id=51579>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60738>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]