diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 074ea5a..78c473f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,14 +12,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: ['1'] + julia-version: ['lts','1','pre'] threads: - '1' - '3' os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} - uses: actions/cache@v4 diff --git a/src/lu.jl b/src/lu.jl index 667e146..78854ad 100644 --- a/src/lu.jl +++ b/src/lu.jl @@ -21,6 +21,8 @@ function lu(A::AbstractMatrix, pivot = Val(true), thread = Val(false); kwargs... end const CUSTOMIZABLE_PIVOT = VERSION >= v"1.8.0-DEV.1507" +# Julia 1.11+ uses negative info for NoPivot() failures +const NOPIVOT_NEGATIVE_INFO = VERSION >= v"1.11.0-DEV" struct NotIPIV <: AbstractVector{BlasInt} len::Int @@ -235,7 +237,14 @@ function reckernel!(A::AbstractMatrix{T}, pivot::Val{Pivot}, m, n, ipiv, info, b # A21 <- P2 A21 Pivot && apply_permutation!(P2, A21, thread) - info != previnfo && (info += n1) + if info != previnfo + # Handle negative info for NoPivot (Julia 1.11+ convention) + if NOPIVOT_NEGATIVE_INFO && info < 0 + info -= n1 + else + info += n1 + end + end if Pivot @turbo warn_check_args=false for i in 1:n2 P2[i] += n1 @@ -303,6 +312,10 @@ function _generic_lufact!(A, ::Val{Pivot}, ipiv, info) where {Pivot} end elseif info == 0 info = k + # Julia 1.11+ convention: negative info for NoPivot + if !Pivot && NOPIVOT_NEGATIVE_INFO + info = -info + end end k == minmn && break # Update the rest