-
-
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
Exponentiation of Diagonal{*Range}
fails
#40886
Comments
Should be easily fixable by (^)(D::Diagonal, a::Number) = Diagonal(D.diag .^ a) |
In which file should this be added/edited? |
It should be added to stdlib/LinearAlgebra/src/diagonal.jl
søn. 23. maj 2021 kl. 08.58 skrev Arun sanganal ***@***.***>:
… Should be easily fixable by
(^)(D::Diagonal, a::Number) = Diagonal(D.diag .^ a)
In which file should this be added/edited?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40886 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD3JKMRYXQOSCMP2YBC4DTTPCRPXANCNFSM45GRL67A>
.
|
This fails on 1.6, but seems to work on master:
|
How do i test it? :/ I m new to all this. I am still trying to figure out how to Test the changes before making a PR. |
You can just paste exactly what you quoted into the REPL. You can download a the "nightly" version of Julia from the main download page, and keep this alongside 1.6 on your computer, to try things out. Actual tests for a PR, you should find the right file in |
In this case, paste the whole diagonal.jl code into repl? And I did go to test/ but there was no file named diagonal.jl. |
No, you can literally paste my message in (the quoted part, for which github gives you a copy button). It is smart enough to remove the This is the test file: https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/test/diagonal.jl#L777 . You should be able to copy & run bits of it, without running all of Julia's tests. |
It fails because the
Diagonal{T,V}
constructor is being called with a diagonal matrix as argument (item [2] in the stacktrace above), whereas the constructor here expects a vector.Originally posted by @daanhb in #40831 (comment)
The text was updated successfully, but these errors were encountered: