JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.74k stars 5.48k forks source link

rdiv with transpose of LU on RHS no longer works #33177

Closed KristofferC closed 5 years ago

KristofferC commented 5 years ago

1.2:

julia> rand(2,2) / lu(rand(2,2))'
2×2 Array{Float64,2}:
 12.1934   -11.2846 
  4.12013   -2.74549

master

julia> rand(2,2) / lu(rand(2,2))'
ERROR: MethodError: no method matching ldiv!(::LU{Float64,Array{Float64,2}}, ::Adjoint{Float64,Array{Float64,2}})
Closest candidates are:
  ldiv!(::Number, ::AbstractArray) at /Users/kristoffer/julia/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/generic.jl:233
...
andreasnoack commented 5 years ago
a0d831ce6bddfb760bfc4a3d6815808f7eaec9ac is the first bad commit
commit a0d831ce6bddfb760bfc4a3d6815808f7eaec9ac
Author: Steven G. Johnson <stevenj@alum.mit.edu>
Date:   Fri May 17 14:31:08 2019 -0400

    (H+­μI) \ x solvers for Hessenberg factorizations (#31853)

:100644 100644 1b038c5b2b9bfe5ca6929e5903194106be719f92 43d0e2691622ed783d0d38da87fc9bf999d335d3 M  NEWS.md
:040000 040000 bbb9ced11c607d5358e45f7c4192b591da065df4 0c3c7451cebfaa3ea4b8817f4e195cece26dc69b M  stdlib

@stevengj Any idea which part of the change could have caused this?

stevengj commented 5 years ago

Probably the new function /(B::AbstractMatrix, adjF::Adjoint{<:Any,<:Factorization}) that calls rdiv!, which calls ldiv! on the adjoint.

Previously the fallback for /(A,B) called copy(adjoint(adjoint(B) \ adjoint(A))).

KristofferC commented 5 years ago

Bump, can we fix this? It is a blocker for 1.3. @stevengj

andreasnoack commented 5 years ago

See https://github.com/JuliaLang/julia/pull/33209