From c1823106d47860077ef52eccad382a5ad21af815 Mon Sep 17 00:00:00 2001 From: victor-qin Date: Tue, 30 Sep 2025 17:48:56 -0400 Subject: [PATCH 1/2] removed custom getrf! definition --- src/utils.jl | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 72cc385..477e202 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -1,4 +1,4 @@ -struct NotImplementedError <: Exception +struct NotImplementedError <: Exception msg::String end @@ -10,7 +10,7 @@ end """ maxdiff(a, b) -Get the maximum difference between vectors. Equivalent to the infinity norm of the +Get the maximum difference between vectors. Equivalent to the infinity norm of the difference, but avoids forming the temporary difference vector. """ function maxdiff(a, b) @@ -27,26 +27,9 @@ using LinearAlgebra.BLAS: @blasfunc @static if VERSION < v"1.7" const libblas = LinearAlgebra.LAPACK.liblapack else - const libblas = LinearAlgebra.LAPACK.libblastrampoline -end -for (getrf,elty) in ((:dgetrf_, :Float64), (:sgetrf, :Float32)) - @eval begin - function LinearAlgebra.LAPACK.getrf!(A::AbstractMatrix{$elty}, ipiv::AbstractVector{BlasInt}) - LinearAlgebra.require_one_based_indexing(A) - LinearAlgebra.chkstride1(A) - m, n = size(A) - @assert length(ipiv) == min(m, n) - lda = max(1,stride(A, 2)) - info = Ref{BlasInt}() - ccall((@blasfunc($getrf), libblas), Cvoid, - (Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, - Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), - m, n, A, lda, ipiv, info) - LAPACK.chkargsok(info[]) - A, ipiv, info[] #Error code is stored in LU factorization type - end - end + const libblas = LinearAlgebra.LAPACK.libblastrampoline end + function LinearAlgebra.lu!(A::StridedMatrix{T}, ipiv::AbstractVector{BlasInt}; check::Bool=true) where T lpt = LAPACK.getrf!(A, ipiv) check && LinearAlgebra.checknonsingular(lpt[3]) From 2e0b542ffdd9290ba557e1aa7a7d4eced5a33cfa Mon Sep 17 00:00:00 2001 From: victor-qin Date: Wed, 1 Oct 2025 10:25:16 -0400 Subject: [PATCH 2/2] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 30d16dd..686623a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ test/Manifest.toml Manifest.toml docs/build +.vscode/