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

Missing element promotion in I(n)*F.Q' #801

Closed
olof3 opened this issue Dec 23, 2020 · 2 comments · Fixed by JuliaLang/julia#41248
Closed

Missing element promotion in I(n)*F.Q' #801

olof3 opened this issue Dec 23, 2020 · 2 comments · Fixed by JuliaLang/julia#41248

Comments

@olof3
Copy link
Contributor

olof3 commented Dec 23, 2020

Looking into some other problems with the Q in QR related to #800, I noticed that a method is missing. Not a big deal, and pretty much any change to this example makes it work. But perhaps it is convenient to fix this at the same time as #800.

I(n)*F.Q'
ERROR: MethodError: no method matching rmul!(::Matrix{Bool}, ::Adjoint{Float64, LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}}})
Closest candidates are:
@ArunS-tack
Copy link
Contributor

ArunS-tack commented Jun 15, 2021

When i try to change the rmul! method to accommodate Matrix{Bool}, it gives me a gemqrt! error which is weird.

MethodError: no method matching gemqrt!(::Char, ::Char, ::Matrix{Float64}, ::Matrix{Float64}, ::Matrix{Bool})
Closest candidates are:
  gemqrt!(::AbstractChar, ::AbstractChar, ::AbstractMatrix{Float64}, ::AbstractMatrix{Float64}, !Matched::AbstractVecOrMat{Float64}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:2903
  gemqrt!(::AbstractChar, ::AbstractChar, !Matched::AbstractMatrix{Float32}, !Matched::AbstractMatrix{Float32}, !Matched::AbstractVecOrMat{Float32}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:2903
  gemqrt!(::AbstractChar, ::AbstractChar, !Matched::AbstractMatrix{ComplexF64}, !Matched::AbstractMatrix{ComplexF64}, !Matched::AbstractVecOrMat{ComplexF64}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:2903
  ...
rmul!(A::Matrix{Bool}, adjB::Adjoint{Float64, LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}}}) at untitled-215ef2cca844deeb6458ec9e9f956dfb:4
*(D::Diagonal{Bool, Vector{Bool}}, adjQ::Adjoint{Float64, LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}}}) at diagonal.jl:270
top-level scope at untitled-215ef2cca844deeb6458ec9e9f956dfb:11
eval at boot.jl:360 [inlined]

Why is it not catching Char under AbstractChar?

@andreasnoack andreasnoack changed the title Missing method rmul!(::Matrix{Bool}, ::"Adjoint{QRCompactWYQ}") Missing element promotion in I(n)*F.Q' Jun 16, 2021
@andreasnoack
Copy link
Member

andreasnoack commented Jun 16, 2021

I've updated the title. The error is a bit misleading. We shouldn't have an rmul! method for Bool elements as there is no way that you can apply a reflection to a matrix of Booleans. Instead, the multiplication method should promote the elements to the element type of the Q matrix.

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

Successfully merging a pull request may close this issue.

3 participants