Skip to content

Commit 75ca426

Browse files
authored
Merge pull request #84 from chriselrod/turbofindmax
Turbo findmax
2 parents 2837b3e + 753c558 commit 75ca426

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RecursiveFactorization"
22
uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
33
authors = ["Yingbo Ma <[email protected]>"]
4-
version = "0.2.19"
4+
version = "0.2.20"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/lu.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ end
144144
end
145145

146146
@inline function nsplit(::Type{T}, n) where {T}
147-
k = max(2, 512 ÷ (isbitstype(T) ? sizeof(T) : 8))
147+
k = max(2, 128 ÷ (isbitstype(T) ? sizeof(T) : 8))
148148
k_2 = k ÷ 2
149149
return n >= k ? ((n + k_2) ÷ k) * k_2 : n ÷ 2
150150
end
@@ -277,12 +277,11 @@ function _generic_lufact!(A, ::Val{Pivot}, ipiv, info) where {Pivot}
277277
kp = k
278278
if Pivot
279279
amax = abs(zero(eltype(A)))
280-
for i in k:m
280+
@turbo warn_check_args=false for i in k:m
281281
absi = abs(A[i, k])
282-
if absi > amax
283-
kp = i
284-
amax = absi
285-
end
282+
isnewmax = absi > amax
283+
kp = isnewmax ? i : kp
284+
amax = isnewmax ? absi : amax
286285
end
287286
ipiv[k] = kp
288287
end

0 commit comments

Comments
 (0)