-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
norm is not type-stable #6056
Labels
Comments
Hopefully, I will have a |
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Mar 5, 2014
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Mar 5, 2014
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Mar 5, 2014
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Mar 10, 2014
stevengj
added a commit
to stevengj/julia
that referenced
this issue
Mar 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
As discussed on the mailing list, I was working on a new
vecnorm(x,p)
function (generalizing and replacingnormfro
) which computes a p-norm of any iterable container as if it were a vector. I noticed that it is quite tricky to make it type stable, and that in fact our currentnorm
function is not type-stableObviously, the "0-norm" needs to be promoted to a floating-point type. Similarly for the 1-norm of integer arrays.
(What's not as obvious to me is whether the norm of a
Float32
array should beFloat32
. I'd much rather accumulate the sum in double precision, and I don't see the point of returning a single-precision result. However, sincesum
of aFloat32
array is also single-precision, I suppose doing the same thing fornorm
makes a certain amount of sense.)cc: @toivoh
The text was updated successfully, but these errors were encountered: