-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix norms #41
Comments
I would tend to prefer just |
I am working on a package that is mostly aimed at a norm induced by a Schatten norm (i.e., completely bounded norm), which is non-trivial to compute, but I am throwing in the usual (easy to compute) Schatten norms in as well. I have them defined as I plan to make the package public this week. I suppose Higham's algorithm for Holder p norms should make a good package. |
@marcusps, the usual convention in Julia would be to name the functions |
So The |
Perhaps, similar to Perhaps |
|
@hayd, see the discussion in JuliaLang/julia#1875 on passing an extra argument to I don't have any problem with renaming |
I have to say I'm not fond of the |
In JuliaLang/julia#1875 was about removing symbols as arguments, using types is really an alternative solution. |
Writing |
|
I would hate to have I guess we could continue to use |
As usual, we don't actually reserve these things – you can still use |
But not as a type? |
In any particular scope you can use the global version or use the name as a local, not both. |
I still think shadowing exported base names with local variable names is bad practice and should generally be avoided, and leads to some confusing errors once in a while (e.g. JuliaPackaging/WinRPM.jl#24 (comment)). Could also dispatch on |
I like the original suggestion in JuliaLang/julia#1875 to have other norms in a separate package, and then use the full names there. e.g., Norm.schatten(A,p)
Norm.frobenius(A)
Norm.nuclear(A)
Norm.cb(A)
Norm.diamond(A) The ones that seem a bit odd are Norm.operator(A) # schatten(A,Inf)
Norm.trace(A) # schatten(A,1)
Norm.spectral(A) # == schatten(A,Inf) == norm(A,2) but maybe there is an argument to drop all aliases, refer to them in the docs, and focus on the more general name, e.g., It is a more verbose version of what @stevengj suggested, but I find it a bit more readable. |
Closing as we now have p-norms. |
Re-opening as we don't have the specific Hölder and Schatten matrix norms at issue here. |
Maybe good to open two separate issues, one for each norm and spell out the API that should be implemented? |
Could we recap what exactly is missing here? I can quickly code the missing items then. |
It's not at all clear that we want any additional norms in Base or LinearAlgebra, as opposed to adding packages for more specialized norms. |
The matrix
norm()
function could use a redesign to reflect the many matrix norms that are used in numerical analysis. The usefully computable norms can be divided into two classes:norm(A::Matrix, p::Number)
throws an error ifp
is not 1, 2, orInf
. The computation of suchp
-norms is not usually presented explicitly, since it is NP-hard to compute; however, Higham's estimation algorithm appears to work well in practice. (doi:10.1007/BF01396242, Algorithm Pnorm, p. 548)norm(svdvals(M),p)
. This reduces to the Frobenius normnormfro()
when p=2.We could fruitfully introduce an extra symbolic argument to specify the desired type matrix norm, e.g.
:fro
,:holder
,:schatten
.The text was updated successfully, but these errors were encountered: