Skip to content

Commit 3032fcb

Browse files
Shreyas-EkanathanChrisRackauckasclaude
authored
rebase (#1)
* Update README.md * 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]> * Update ci.yml * Update ci.yml * Add VERSION check for Julia 1.11+ negative info convention Only use negative info values for NoPivot() on Julia 1.11 and later. Earlier versions should continue using positive info values. - Added NOPIVOT_NEGATIVE_INFO constant that checks Julia version - Use this constant to conditionally apply negative info values - Ensures backward compatibility with Julia < 1.11 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update README.md --------- Co-authored-by: ChrisRackauckas <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Christopher Rackauckas <[email protected]>
1 parent be2d727 commit 3032fcb

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
julia-version: ['1']
15+
julia-version: ['lts','1','pre']
1616
threads:
1717
- '1'
1818
- '3'
1919
os: [ubuntu-latest, windows-latest, macOS-latest]
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: julia-actions/setup-julia@v1
22+
- uses: julia-actions/setup-julia@v2
2323
with:
2424
version: ${{ matrix.julia-version }}
2525
- uses: actions/cache@v4

src/lu.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ function lu(A::AbstractMatrix, pivot = Val(true), thread = Val(false); kwargs...
2121
end
2222

2323
const CUSTOMIZABLE_PIVOT = VERSION >= v"1.8.0-DEV.1507"
24+
# Julia 1.11+ uses negative info for NoPivot() failures
25+
const NOPIVOT_NEGATIVE_INFO = VERSION >= v"1.11.0-DEV"
2426

2527
struct NotIPIV <: AbstractVector{BlasInt}
2628
len::Int
@@ -235,7 +237,14 @@ function reckernel!(A::AbstractMatrix{T}, pivot::Val{Pivot}, m, n, ipiv, info, b
235237
# A21 <- P2 A21
236238
Pivot && apply_permutation!(P2, A21, thread)
237239

238-
info != previnfo && (info += n1)
240+
if info != previnfo
241+
# Handle negative info for NoPivot (Julia 1.11+ convention)
242+
if NOPIVOT_NEGATIVE_INFO && info < 0
243+
info -= n1
244+
else
245+
info += n1
246+
end
247+
end
239248
if Pivot
240249
@turbo warn_check_args=false for i in 1:n2
241250
P2[i] += n1
@@ -303,6 +312,10 @@ function _generic_lufact!(A, ::Val{Pivot}, ipiv, info) where {Pivot}
303312
end
304313
elseif info == 0
305314
info = k
315+
# Julia 1.11+ convention: negative info for NoPivot
316+
if !Pivot && NOPIVOT_NEGATIVE_INFO
317+
info = -info
318+
end
306319
end
307320
k == minmn && break
308321
# Update the rest

0 commit comments

Comments
 (0)