-
Notifications
You must be signed in to change notification settings - Fork 61
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
Addition/subtraction of Matrix{Sym} and UniformScaling gives Matrix{Any} #359
Comments
Thanks, it comes down to
I'm not sure how to hint that the first return type should be |
Nope, I don't really have any good ideas, I'm afraid.
Note sure what you mean by |
Yes, I'm not sure what is broken or how to fix the promotion. As you see, but unfortunately
will work as desired, as |
* close issue #359; tweak travis * test newer versions only * tweak twice
Ran into this problem again, when the arguments were ordered differently. I guess a similar fix as previously should be alright. @syms a
A1 = [1 a; a 1]
# The first six cases work
@test typeof(A1 + a*I) == Matrix{Sym}
@test typeof(A1 - a*I) == Matrix{Sym}
@test typeof(-A1 + a*I) == Matrix{Sym}
@test typeof(-A1 - a*I) == Matrix{Sym}
@test typeof(-a*I + A1) == Matrix{Sym}
@test typeof(a*I + A1) == Matrix{Sym}
# The following two fails, returning Matrix{Any}
@test typeof(a*I - A1) == Matrix{Sym}
@test typeof(-a*I - A1) == Matrix{Sym}
# All of the following fails, returning Matrix{Any}
A2 = [1 2; 2 1]
@test typeof(A2 + a*I) == Matrix{Sym}
@test typeof(A2 - a*I) == Matrix{Sym}
@test typeof(-A2 + a*I) == Matrix{Sym}
@test typeof(-A2 - a*I) == Matrix{Sym}
@test typeof(-a*I + A2) == Matrix{Sym}
@test typeof(a*I + A2) == Matrix{Sym}
@test typeof(a*I - A2) == Matrix{Sym}
@test typeof(-a*I - A2) == Matrix{Sym} |
Thanks for the report! This is hopefully handled for good with the new PR which just adds more methods to catch the dispatch to the fallback. |
gives
Matrix{Any}
and notMatrix{Sym}
Multiplication seems to work though.
Not sure if the problem is with
SymPy.jl
or that the logic inLinearAlgebra
is too fragile?The text was updated successfully, but these errors were encountered: