diff --git a/Project.toml b/Project.toml index 06b0306..82b8cd2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RecursiveFactorization" uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" authors = ["Yingbo Ma "] -version = "0.2.19" +version = "0.2.20" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/lu.jl b/src/lu.jl index f75ee0e..8fd3442 100644 --- a/src/lu.jl +++ b/src/lu.jl @@ -144,7 +144,7 @@ end end @inline function nsplit(::Type{T}, n) where {T} - k = max(2, 512 ÷ (isbitstype(T) ? sizeof(T) : 8)) + k = max(2, 128 ÷ (isbitstype(T) ? sizeof(T) : 8)) k_2 = k ÷ 2 return n >= k ? ((n + k_2) ÷ k) * k_2 : n ÷ 2 end @@ -277,12 +277,11 @@ function _generic_lufact!(A, ::Val{Pivot}, ipiv, info) where {Pivot} kp = k if Pivot amax = abs(zero(eltype(A))) - for i in k:m + @turbo warn_check_args=false for i in k:m absi = abs(A[i, k]) - if absi > amax - kp = i - amax = absi - end + isnewmax = absi > amax + kp = isnewmax ? i : kp + amax = isnewmax ? absi : amax end ipiv[k] = kp end