Skip to content

Commit c4aa5f3

Browse files
committed
simplified rank(::QRPivoted) implementation
1 parent d270bda commit c4aa5f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/qr.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,8 @@ end
538538
function rank(A::QRPivoted; atol::Real=0, rtol::Real=min(size(A)...) * eps(real(float(one(eltype(A.Q))))) * iszero(atol))
539539
m = min(size(A)...)
540540
m == 0 && return 0
541-
factors = getfield(A, :factors)
542-
tol = max(atol, rtol*abs(factors[1,1]))
543-
return something(findfirst(i -> abs(factors[i,i]) <= tol, 1:m), m+1) - 1
541+
tol = max(atol, rtol*abs(A.factors[1,1]))
542+
return something(findfirst(i -> abs(A.factors[i,i]) <= tol, 1:m), m+1) - 1
544543
end
545544

546545
# Julia implementation similar to xgelsy

0 commit comments

Comments
 (0)