Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ true
function (\)(A::AbstractMatrix, B::AbstractVecOrMat)
require_one_based_indexing(A, B)
m, n = size(A)
T = promote_op(\, eltype(A), eltype(B))
if m == n
if istril(A)
if istriu(A)
Expand All @@ -1235,9 +1236,9 @@ function (\)(A::AbstractMatrix, B::AbstractVecOrMat)
if istriu(A)
return UpperTriangular(A) \ B
end
return lu(A) \ B
return _lu(_lucopy(A, T)) \ B
end
return qr(A, ColumnNorm()) \ B
return _qr(copy_similar(A, _qreltype(T)), ColumnNorm()) \ B
end

(\)(a::AbstractVector, b::AbstractArray) = pinv(a) * b
Expand Down
10 changes: 10 additions & 0 deletions test/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -954,4 +954,14 @@ end
@test Int[] Int[]
end

@testset "issue 930" begin
A = rand(Int, 2, 2)
B = rand(Int, 2, 3)
for M (A, B), T (Float32, BigFloat)
v = randn(T, 2)
x = @inferred M \ v
@test eltype(x) <: T
end
end

end # module TestGeneric