-
-
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
better names for norm functions? #1875
Comments
I actually really like the Matlab style |
It is pretty convenient to just be able to type It's also not clear to me that matrix and vector norms should necessarily have different names, since the two are closely related. Two possibilities:
|
Actually, the induced 1-norm (inf-norm) of a matrix is even easier to compute: sum the absolute values along the columns (rows), then maximize over the sums. (This can also be used to overestimate the induced 2-norm, since I have no idea about how to compute induced p-norms in general, though. I would still prefer for |
I think the proposed norm names are worse than what matlab does! I think that using symbols for stuff like Frobenius norm is a bit ugly, but a series of new names is uglier. |
I guess I'm alone on this one. I for one define |
I don't have strong preferences, but I confess to being sympathetic to this proposal. So you're not alone. |
I'm with you too, Stefan. Those norms are not different versions of the same function, they are just different functions. In matlab, the setup with a single |
It seems like a good compromise here might be to give names to the different ways we're going to provide for computing norms – i.e. the different if/else cases in the |
I don't think implementing both styles is an improvement; better to pick one style and stick with it than have a lot of redundant functions. I still think that |
The only redundant function then would be |
Following Matlab, we would then have the following norm functions: norm2(a)
norm1(a)
norminf(a)
normfrob(a)
normp(p,v) |
And would lose |
No, that could stay. |
I am not excited about having all these |
The most discoverable name for that case is probably |
Why not just |
I still think we just leave it as |
I increasingly think things should be called What They Are Called. To get the frobenius norm you call frobeniusnorm(). The syntax |
Obviously, I agree that |
Because this needs more opinions, I'm sympathetic to the argument for non-p norms, but prefer that the |
I agree with @pao that |
I'm ok with |
I do not like
|
I think the problem w/ I mildly prefer not splitting up |
I like Viral's suggestion here: |
Ok, I will update the implementation accordingly. A |
I've always found the convention of calling
norm
with a string or symbol argument indicating different norms both ugly and inconvenient and on the implementation side, checking various symbols is awful. It seems to me that vector and matrix norms deserve their own function names, so I'd like to propose better names, such as:We can either get rid the Matlab-style
norm
function or leave it for compatibility define it by calling the various primitive norm functions listed here.The text was updated successfully, but these errors were encountered: