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

Bug in out of place ldiv! #577

Closed
gragusa opened this issue Oct 18, 2018 · 0 comments
Closed

Bug in out of place ldiv! #577

gragusa opened this issue Oct 18, 2018 · 0 comments

Comments

@gragusa
Copy link
Contributor

gragusa commented Oct 18, 2018

The out-of-place version of ldiv!(Y, A, B) incorrectly overwrite B when A is a factorization of a non square matrix.

using LinearAlgebra
A = [ -3.0  -6.0; 0.0 1.0; 1.0   2.0]
B = [0.0 1.0; 1.0   2.0; 2.0   3.0]
Bc = copy(B)
Y = Array{Float64}(undef, 3,3)
ldiv!(Y, qr(A), B)
Bc == B #false

The problem is in https://github.com/JuliaLang/julia/blob/367aab3dc15a5543bd14c73d1e38a3ce7e310f05/stdlib/LinearAlgebra/src/factorization.jl#L103 where ldiv!(Y, A, B) reduces to a call to ldiv!(A,B) which overwrites B.

gragusa referenced this issue in gragusa/julia Oct 22, 2018
KristofferC referenced this issue in JuliaLang/julia Nov 12, 2018
* Fix for #29713

* Add tests for #29713

* Fix for #29713

* Copy the argument in the right branch

* Copy the argument in the right branch - take 2

* Update qr.jl

(cherry picked from commit 8d712f6)
tkf referenced this issue in tkf/julia Nov 21, 2018
* Fix for #29713

* Add tests for #29713

* Fix for #29713

* Copy the argument in the right branch

* Copy the argument in the right branch - take 2

* Update qr.jl
KristofferC referenced this issue in JuliaLang/julia Dec 12, 2018
* Fix for #29713

* Add tests for #29713

* Fix for #29713

* Copy the argument in the right branch

* Copy the argument in the right branch - take 2

* Update qr.jl

(cherry picked from commit 8d712f6)
KristofferC referenced this issue in JuliaLang/julia Feb 11, 2019
* Fix for #29713

* Add tests for #29713

* Fix for #29713

* Copy the argument in the right branch

* Copy the argument in the right branch - take 2

* Update qr.jl

(cherry picked from commit 8d712f6)
KristofferC referenced this issue in JuliaLang/julia Feb 20, 2020
* Fix for #29713

* Add tests for #29713

* Fix for #29713

* Copy the argument in the right branch

* Copy the argument in the right branch - take 2

* Update qr.jl

(cherry picked from commit 8d712f6)
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
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

2 participants