-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Disambiguate division and pseudo-division? #554
Comments
Just pointing out that I complained about this right soon you made this change JuliaLang/julia#23067 (comment) but no one seems to think the ambiguity was an issue for anyone. Also JuliaLang/julia#25431 |
I wouldn't have any problems with |
This is specified via the the choice of factorization. E.g. julia> bar(n) = qr(zeros(n, 3), Val(true)) \ zeros(n, 1)
bar (generic function with 1 method)
julia> bar(1)
3×1 Array{Float64,2}:
0.0
0.0
0.0
julia> bar(2)
3×1 Array{Float64,2}:
0.0
0.0
0.0
julia> bar(3)
3×1 Array{Float64,2}:
0.0
0.0
0.0
julia> bar(4)
3×1 Array{Float64,2}:
0.0
0.0
0.0 This should probably be better documented though.
I'd be reluctant to add more lazy array-like types. It will require a lot of work to support all the combinations. We still have quite some work to do because we are done with |
Yeah, though we may have to figure out something more general here. |
I think this ambiguity bit me (for a moment) today. I intended to do julia> [1, 1] / [1, 1]
2×2 Array{Float64,2}:
0.5 0.5
0.5 0.5 |
As @martinholters commented in JuliaLang/julia#44358, it'd be nice to get rid of the DWIM-y thing inherited from Matlab in 2.0. No clear idea of what the syntax for pinvs would like look though. I suggested |
...where division means "equivalent to multiplication with inverse" and pseudo-division means "equivalent to multiplication with pseudo-inverse" (with equivalence neglecting any numerical issues). Briefly came up in JuliaLang/julia#23067. Motivating example:
Here, it would be useful if there was a dedicated operator to ask for the least-squares solution. But if there was one,
\
should probably always mean exact solution and fail for rectangular matrices.So if we do this, it would be quite breaking. Is it justified? Should we explore this?
The text was updated successfully, but these errors were encountered: