[Top][All Lists]

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

Re: Possible extension/fix to the linear-algebra funm function

From: PhilipNienhuis
Subject: Re: Possible extension/fix to the linear-algebra funm function
Date: Mon, 30 Dec 2019 06:55:18 -0600 (CST)

José Abílio Matos wrote
> Hi,
>       when using funm from linear-algebra I have noticed a small 
> incompatibility with the corresponding matlab function.
>       funm does not accept as argument the functions "exp", "log" and 
> "sqrt". The reason for that is described in the function's documentation:
> ## Note that you should not use funm for 'sqrt', 'log' or 'exp'; instead
> ## use sqrtm, logm and expm as these are more robust.
> Yet reading the code this seems to be an outdated comment because if we
> add 
> them to the set of supported functions then funm will delegate the
> evaluation 
> to the thfm function that supports them (by calling the corresponding
> sqrtm, 
> logm and expm functions).
> So, at least for compatibility, I suggest to add those three functions to
> the 
> set of supported function since funm already does the right thing and thus
> I 
> also suggest to remove that comment from the documentation.
> I send an attached patch with the proposed trivial changes.
> What do you think?

Thanks José.
You're right in principle but IMO it is still better to directly call the
core functions logm, expm and sqrtm if only to avoid overhead.
Please upload your patch to the patch tracker if you want:

BTW, there's a much better funm.m looming here:

I hope that one can be absorbed one day in the linear-algebra package or
rather, core Octave.
AFAICS it works fine - but I only tested it for mathematically fairly easy
cases (positive-semidefinite (symmetric) matrices of limited size, max. size


Sent from:

reply via email to

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