Skip to content

Commit c350410

Browse files
Fix negative info values for NoPivot() on Julia 1.11+
Julia 1.11 changed the convention for LU factorization info field when using NoPivot(). Now, when a zero diagonal is encountered during unpivoted LU factorization, the info field should be negative to distinguish it from pivoted factorization failures. This commit updates RecursiveFactorization to match Julia's convention: - In _generic_lufact!, return negative info when Pivot=false and zero diagonal found - In reckernel!, handle negative info values correctly when adjusting offsets Fixes #95 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3cb6959 commit c350410

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/lu.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,14 @@ function reckernel!(A::AbstractMatrix{T}, pivot::Val{Pivot}, m, n, ipiv, info, b
235235
# A21 <- P2 A21
236236
Pivot && apply_permutation!(P2, A21, thread)
237237

238-
info != previnfo && (info += n1)
238+
if info != previnfo
239+
# Handle negative info for NoPivot (Julia 1.11+ convention)
240+
if info < 0
241+
info -= n1
242+
else
243+
info += n1
244+
end
245+
end
239246
if Pivot
240247
@turbo warn_check_args=false for i in 1:n2
241248
P2[i] += n1
@@ -303,6 +310,10 @@ function _generic_lufact!(A, ::Val{Pivot}, ipiv, info) where {Pivot}
303310
end
304311
elseif info == 0
305312
info = k
313+
# Julia 1.11+ convention: negative info for NoPivot
314+
if !Pivot
315+
info = -info
316+
end
306317
end
307318
k == minmn && break
308319
# Update the rest

0 commit comments

Comments
 (0)