Skip to content
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

Deprecate norm(x,0) #596

Open
andreasnoack opened this issue Jan 23, 2019 · 6 comments
Open

Deprecate norm(x,0) #596

andreasnoack opened this issue Jan 23, 2019 · 6 comments
Labels
breaking This change will break code

Comments

@andreasnoack
Copy link
Member

It's not a norm and it's not p (in the same way as norm(x,p) for p>0). See the discussion in JuliaLang/julia#30631. It currently behaves as norm(x,p)^p -> norm(x,0) in p so it's questionable to bundle this functionality inside norm(x,p). Sure, it can be useful to count the number of non-zeros in an array but count(!iszero, x) should be just fine for that.

@andreasnoack andreasnoack added the breaking This change will break code label Jan 23, 2019
@StefanKarpinski
Copy link
Member

As I said on the other issue, would have to be a LinearAlgebra 2.0 change unless we genuinely believe that no one out there is using this feature.

@andreasnoack
Copy link
Member Author

I already added the "breaking" label. Is there another way to label 2.0 changes?

@StefanKarpinski
Copy link
Member

The 2.0 milestone.

@lostella
Copy link

Should the cases 0 < p < 1 be deprecated for the same reason? They're p, but they're not norms.

@andreasnoack
Copy link
Member Author

I think it's okay to allow 0 < p < 1 since it the same definition as for p >= 1.

@Jutho
Copy link
Contributor

Jutho commented May 7, 2020

Another option would be to not take the power 1/p for 0<=p<1. Even more breaking, but then the definition for p=0 remains continuous (and thus makes sense as the limit), and it is also continuous at p=1 (but probably not smooth?). This seems to be a choice that is sometimes (often?) made in the context of L^p spaces I think, but I am not very familiar with that.

@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code
Projects
None yet
Development

No branches or pull requests

4 participants