Skip to content

Commit

Permalink
Add check call to getrf! (#50134)
Browse files Browse the repository at this point in the history
* Add check call to getrf!

`lu!(A; check=false)` is supposed to disable the checking and leave it to the user:

> When check = true, an error is thrown if the decomposition fails. When check = false, responsibility for checking the decomposition's validity (via issuccess) lies with the user.

However, this is not quite true since `lu!` calls `getrf!` which internally does a check for `chkfinite` which does throw an error. This updates the `getrf!` function to have a `check` argument which is then used by `lu!` to fully disable the error throwing checks.

* Update lapack.jl
  • Loading branch information
ChrisRackauckas committed Jun 12, 2023
1 parent 75bda64 commit d69b1a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stdlib/LinearAlgebra/src/lapack.jl
Expand Up @@ -554,9 +554,9 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty
# * .. Array Arguments ..
# INTEGER IPIV( * )
# DOUBLE PRECISION A( LDA, * )
function getrf!(A::AbstractMatrix{$elty})
function getrf!(A::AbstractMatrix{$elty}; check = true)
require_one_based_indexing(A)
chkfinite(A)
check && chkfinite(A)
chkstride1(A)
m, n = size(A)
lda = max(1,stride(A, 2))
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/lu.jl
Expand Up @@ -79,7 +79,7 @@ transpose(F::LU{<:Real}) = TransposeFactorization(F)
# the following method is meant to catch calls to lu!(A::LAPACKArray) without a pivoting stategy
lu!(A::StridedMatrix{<:BlasFloat}; check::Bool = true) = lu!(A, RowMaximum(); check=check)
function lu!(A::StridedMatrix{T}, ::RowMaximum; check::Bool = true) where {T<:BlasFloat}
lpt = LAPACK.getrf!(A)
lpt = LAPACK.getrf!(A; check)
check && checknonsingular(lpt[3])
return LU{T,typeof(lpt[1]),typeof(lpt[2])}(lpt[1], lpt[2], lpt[3])
end
Expand Down

2 comments on commit d69b1a2

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.