@@ -8,7 +8,7 @@ Interfaces to LAPACK subroutines.
88using .. LinearAlgebra. BLAS: @blasfunc , chkuplo
99
1010using .. LinearAlgebra: libblastrampoline, BlasFloat, BlasInt, LAPACKException, DimensionMismatch,
11- SingularException, PosDefException, chkstride1, checksquare,triu, tril, dot
11+ SingularException, PosDefException, chkstride1, checksquare, triu, tril, dot
1212
1313using Base: iszero, require_one_based_indexing
1414
@@ -554,13 +554,12 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty
554554 # * .. Array Arguments ..
555555 # INTEGER IPIV( * )
556556 # DOUBLE PRECISION A( LDA, * )
557- function getrf! (A:: AbstractMatrix{$elty} ; check = true )
557+ function getrf! (A:: AbstractMatrix{$elty} , ipiv :: AbstractVector{BlasInt} ; check:: Bool = true )
558558 require_one_based_indexing (A)
559559 check && chkfinite (A)
560560 chkstride1 (A)
561561 m, n = size (A)
562562 lda = max (1 ,stride (A, 2 ))
563- ipiv = similar (A, BlasInt, min (m,n))
564563 info = Ref {BlasInt} ()
565564 ccall ((@blasfunc ($ getrf), libblastrampoline), Cvoid,
566565 (Ref{BlasInt}, Ref{BlasInt}, Ptr{$ elty},
@@ -679,15 +678,13 @@ Returns `A` and `tau` modified in-place.
679678gerqf! (A:: AbstractMatrix , tau:: AbstractVector )
680679
681680"""
682- getrf!(A) -> (A, ipiv, info)
683-
684- Compute the pivoted `LU` factorization of `A`, `A = LU`.
681+ getrf!(A, ipiv) -> (A, ipiv, info)
685682
686- Returns `A`, modified in-place, `ipiv `, the pivoting information, and an `info`
687- code which indicates success (`info = 0`), a singular value in `U`
688- (`info = i`, in which case `U[i,i]` is singular), or an error code (`info < 0`).
683+ Compute the pivoted `LU` factorization of `A `, `A = LU`. `ipiv` contains the pivoting
684+ information and `info` a code which indicates success (`info = 0`), a singular value
685+ in `U` (`info = i`, in which case `U[i,i]` is singular), or an error code (`info < 0`).
689686"""
690- getrf! (A:: AbstractMatrix , tau :: AbstractVector )
687+ getrf! (A:: AbstractMatrix , ipiv :: AbstractVector ; check :: Bool = true )
691688
692689"""
693690 gelqf!(A) -> (A, tau)
@@ -751,6 +748,17 @@ which parameterize the elementary reflectors of the factorization.
751748"""
752749gerqf! (A:: AbstractMatrix{<:BlasFloat} ) = ((m,n) = size (A); gerqf! (A, similar (A, min (m, n))))
753750
751+ """
752+ getrf!(A) -> (A, ipiv, info)
753+
754+ Compute the pivoted `LU` factorization of `A`, `A = LU`.
755+
756+ Returns `A`, modified in-place, `ipiv`, the pivoting information, and an `info`
757+ code which indicates success (`info = 0`), a singular value in `U`
758+ (`info = i`, in which case `U[i,i]` is singular), or an error code (`info < 0`).
759+ """
760+ getrf! (A:: AbstractMatrix{T} ; check:: Bool = true ) where {T <: BlasFloat } = ((m,n) = size (A); getrf! (A, similar (A, BlasInt, min (m, n)); check))
761+
754762# # Tools to compute and apply elementary reflectors
755763for (larfg, elty) in
756764 ((:dlarfg_ , Float64),
0 commit comments