Skip to content
Merged
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
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ lu!(A::AbstractMatrix, pivot::Union{RowMaximum,NoPivot,RowNonZero} = lupivottype
generic_lufact!(A, pivot; check = check)
function generic_lufact!(A::AbstractMatrix{T}, pivot::Union{RowMaximum,NoPivot,RowNonZero} = lupivottype(T);
check::Bool = true) where {T}
LAPACK.chkfinite(A)
check && LAPACK.chkfinite(A)
# Extract values
m, n = size(A)
minmn = min(m,n)
Expand Down
7 changes: 7 additions & 0 deletions stdlib/LinearAlgebra/test/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,11 @@ end
@test Matrix(F1) ≈ Matrix(F2) ≈ C
end

@testset "matrix with Nonfinite" begin
lu(fill(NaN, 2, 2), check=false)
lu(fill(Inf, 2, 2), check=false)
LinearAlgebra.generic_lufact!(fill(NaN, 2, 2), check=false)
LinearAlgebra.generic_lufact!(fill(Inf, 2, 2), check=false)
end

end # module TestLU