Skip to content
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

Method ambiguity for * #635

Open
baggepinnen opened this issue Jun 29, 2022 · 0 comments
Open

Method ambiguity for * #635

baggepinnen opened this issue Jun 29, 2022 · 0 comments

Comments

@baggepinnen
Copy link
Collaborator

julia> using Symbolics

julia> @variables u[1:2, 1:5]
1-element Vector{Symbolics.Arr{Num, 2}}:
 u[1:2,1:5]

julia> Q2 = I(2)
2×2 Diagonal{Bool, Vector{Bool}}:
 1  
   1

julia> dot(u, Q2, u)
ERROR: MethodError: *(::Diagonal{Bool, Vector{Bool}}, ::Symbolics.Arr{Num, 2}) is ambiguous. Candidates:
  *(A::AbstractMatrix, B::Symbolics.Arr{<:Any, 2}) in Symbolics at /home/fredrikb/.julia/packages/Symbolics/sDAUx/src/wrapper-types.jl:129
  *(D::Diagonal, A::AbstractMatrix) in LinearAlgebra at /home/fredrikb/julia-1.8.0-rc1/share/julia/stdlib/v1.8/LinearAlgebra/src/diagonal.jl:249
Possible fix, define
  *(::Diagonal, ::Symbolics.Arr{<:Any, 2})
Stacktrace:
 [1] dot(x::Symbolics.Arr{Num, 2}, A::Diagonal{Bool, Vector{Bool}}, y::Symbolics.Arr{Num, 2})
   @ LinearAlgebra ~/julia-1.8.0-rc1/share/julia/stdlib/v1.8/LinearAlgebra/src/generic.jl:916

julia> u'Q2*u
ERROR: MethodError: *(::Symbolics.Arr{Num, 2}, ::Diagonal{Bool, Vector{Bool}}) is ambiguous. Candidates:
  *(A::AbstractMatrix, D::Diagonal) in LinearAlgebra at /home/fredrikb/julia-1.8.0-rc1/share/julia/stdlib/v1.8/LinearAlgebra/src/diagonal.jl:247
  *(A::Symbolics.Arr{<:Any, 2}, B::AbstractMatrix) in Symbolics at /home/fredrikb/.julia/packages/Symbolics/sDAUx/src/wrapper-types.jl:129
Possible fix, define
  *(::Symbolics.Arr{<:Any, 2}, ::Diagonal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant