File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -432,11 +432,11 @@ end
432
432
(/ )(adjA:: Adjoint{<:Any,<:AbstractMatrix} , F:: Adjoint{<:Any,<:LU} ) = adjoint (F. parent \ adjA. parent)
433
433
function (/ )(trA:: Transpose{<:Any,<:AbstractVector} , F:: Adjoint{<:Any,<:LU} )
434
434
T = promote_type (eltype (trA), eltype (F))
435
- return adjoint (ldiv! (F. parent, convert (AbstractVector{T}, conj ( trA. parent))))
435
+ return adjoint (ldiv! (F. parent, conj! ( copy_oftype ( trA. parent, T ))))
436
436
end
437
437
function (/ )(trA:: Transpose{<:Any,<:AbstractMatrix} , F:: Adjoint{<:Any,<:LU} )
438
438
T = promote_type (eltype (trA), eltype (F))
439
- return adjoint (ldiv! (F. parent, convert (AbstractMatrix{T}, conj ( trA. parent))))
439
+ return adjoint (ldiv! (F. parent, conj! ( copy_oftype ( trA. parent, T ))))
440
440
end
441
441
442
442
function det (F:: LU{T} ) where T
Original file line number Diff line number Diff line change 360
360
end
361
361
end
362
362
363
+ @testset " transpose(A) / lu(B)' should not overwrite A (#36657)" begin
364
+ for elty in (Float16, Float64, ComplexF64)
365
+ A = randn (elty, 5 , 5 )
366
+ B = randn (elty, 5 , 5 )
367
+ C = copy (A)
368
+ a = randn (elty, 5 )
369
+ c = copy (a)
370
+ @test transpose (A) / lu (B)' ≈ transpose (A) / B'
371
+ @test transpose (a) / lu (B)' ≈ transpose (a) / B'
372
+ @test A == C
373
+ @test a == c
374
+ end
375
+ end
363
376
end # module TestLU
You can’t perform that action at this time.
0 commit comments