Skip to content

Commit 7ee1df9

Browse files
Merge pull request #419 from JuliaArrays/pivot
Fix pivot definition by version
2 parents 175cf1b + 61fa0eb commit 7ee1df9

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
version:
1717
- '1'
1818
- '1.6'
19+
- '1.7'
20+
- '1.8'
1921
steps:
2022
- uses: actions/checkout@v3
2123
- uses: julia-actions/setup-julia@v1

src/ArrayInterface.jl

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ Returns the number.
482482
"""
483483
bunchkaufman_instance(a::Any) = bunchkaufman(a, check = false)
484484

485-
@static if VERSION < v"1.7beta"
485+
@static if VERSION < v"1.8beta"
486486
const DEFAULT_CHOLESKY_PIVOT = Val(false)
487487
else
488488
const DEFAULT_CHOLESKY_PIVOT = LinearAlgebra.NoPivot()
@@ -498,10 +498,6 @@ end
498498
function cholesky_instance(A::Matrix{T}, pivot = DEFAULT_CHOLESKY_PIVOT) where {T}
499499
return cholesky(similar(A, 0, 0), pivot, check = false)
500500
end
501-
502-
function cholesky_instance(A::Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}}, pivot = DEFAULT_CHOLESKY_PIVOT)
503-
cholesky(sparse(similar(A, 1, 1)), check = false)
504-
end
505501
else
506502
"""
507503
cholesky_instance(A, pivot = LinearAlgebra.RowMaximum()) -> cholesky_factorization_instance
@@ -512,10 +508,10 @@ else
512508
function cholesky_instance(A::Matrix{T}, pivot = DEFAULT_CHOLESKY_PIVOT) where {T}
513509
return cholesky(similar(A, 0, 0), pivot)
514510
end
511+
end
515512

516-
function cholesky_instance(A::Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}}, pivot = DEFAULT_CHOLESKY_PIVOT)
517-
cholesky(sparse(similar(A, 1, 1)))
518-
end
513+
function cholesky_instance(A::Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}}, pivot = DEFAULT_CHOLESKY_PIVOT)
514+
cholesky(sparse(similar(A, 1, 1)), check = false)
519515
end
520516

521517
"""
@@ -553,14 +549,8 @@ function ldlt_instance(A::Matrix{T}) where {T}
553549
return ldlt(SymTridiagonal(similar(A, 0, 0)))
554550
end
555551

556-
@static if VERSION > v"1.9-"
557-
function ldlt_instance(A::SparseMatrixCSC)
558-
ldlt(sparse(similar(A, 1, 1)), check=false)
559-
end
560-
else
561-
function ldlt_instance(A::SparseMatrixCSC)
562-
ldlt(sparse(similar(A, 1, 1)))
563-
end
552+
function ldlt_instance(A::SparseMatrixCSC)
553+
ldlt(sparse(similar(A, 1, 1)), check=false)
564554
end
565555

566556
"""

0 commit comments

Comments
 (0)