-
-
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
Triangular constructor doesn't get the type #144
Comments
It's simply because the compiler only tracks and specializes on argument types, not argument values. |
Thank you for explaining it again. I don't know why I didn't realise it here. A while ago I tried to find a solution to almost the exact same problem here https://github.com/andreasnoack/LinearAlgebra.jl/blob/master/src/LinearAlgebra.jl by introducing a dummy parametric immutable for dispatch purposes. Could something like that work? |
It is really convenient to dispatch on One solution could be the one I mentioned above where we define a parametrised immutable, say Another would be to have four different functions: |
Well, you'd never have to type that in the REPL, because a definition like
would work equally well. |
but you'd want to specify if the matrix is upper or lower and if has unit diagonal. |
I think a good API would look like |
Since this comes up a lot, should we put
into Base? I'm not arguing that |
Yes we should do that. I'd prefer a short name, like
Not quite sure what to call it though. |
If we switch to using |
Something like that would be great. It would also make the |
@jakebolewski I haven't thought about tuple types with arbitrary values as elements. It's a problem, since it implies that I prefer using |
I'm fine with |
I'm not super keen on the name |
Alternative suggestions welcome. |
Is |
|
How about |
This is just for creating tokens to dispatch on, not general singleton |
Is it necessary that It would really be convenient to use that notation because we all seem to want a short name and consider none of the names appropriate. |
Fixed by JuliaLang/julia#9779 |
As noticed in 2e046cd74b3173dc8472f9c57b41ed6482e3044f and JuliaLang/julia#8751, this constructor can't get the
UpLo
andIsUnit
parameters right. E.g.Is there something wrong in defining the constructor like this or is the problem somewhere else?
The text was updated successfully, but these errors were encountered: