Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect pivot strategy (if given) in cholesky #51245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions stdlib/LinearAlgebra/src/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,13 @@ julia> C.L * C.U == A
true
```
"""
cholesky(A::AbstractMatrix, ::NoPivot=NoPivot(); check::Bool = true) =
_cholesky(cholcopy(A); check)
cholesky(A::AbstractMatrix, args...; kwargs...) =
_cholesky(cholcopy(A), args...; kwargs...)
@deprecate cholesky(A::Union{StridedMatrix,RealHermSymComplexHerm{<:Real,<:StridedMatrix}}, ::Val{false}; check::Bool = true) cholesky(A, NoPivot(); check) false

function cholesky(A::AbstractMatrix{Float16}, ::NoPivot=NoPivot(); check::Bool = true)
X = _cholesky(cholcopy(A); check = check)
cholesky(A::AbstractMatrix{Float16}; kwargs...) = cholesky(A, NoPivot(); kwargs...)
function cholesky(A::AbstractMatrix{Float16}, ::NoPivot; check::Bool = true)
X = _cholesky(cholcopy(A), NoPivot(); check)
return Cholesky{Float16}(X)
end
@deprecate cholesky(A::Union{StridedMatrix{Float16},RealHermSymComplexHerm{Float16,<:StridedMatrix}}, ::Val{false}; check::Bool = true) cholesky(A, NoPivot(); check) false
Expand Down Expand Up @@ -466,15 +467,13 @@ julia> l == C.L && u == C.U
true
```
"""
cholesky(A::AbstractMatrix, ::RowMaximum; tol = 0.0, check::Bool = true) =
_cholesky(cholcopy(A), RowMaximum(); tol, check)
@deprecate cholesky(A::Union{StridedMatrix,RealHermSymComplexHerm{<:Real,<:StridedMatrix}}, ::Val{true}; tol = 0.0, check::Bool = true) cholesky(A, RowMaximum(); tol, check) false

function cholesky(A::AbstractMatrix{Float16}, ::RowMaximum; tol = 0.0, check::Bool = true)
X = _cholesky(cholcopy(A), RowMaximum(); tol, check)
return CholeskyPivoted{Float16}(X)
end

@deprecate cholesky(A::Union{StridedMatrix,RealHermSymComplexHerm{<:Real,<:StridedMatrix}}, ::Val{true}; tol = 0.0, check::Bool = true) cholesky(A, RowMaximum(); tol, check) false

## Number
function cholesky(x::Number, uplo::Symbol=:U)
C, info = _chol!(x, uplo)
Expand Down