@@ -8,7 +8,7 @@ Interfaces to LAPACK subroutines.
8
8
using .. LinearAlgebra. BLAS: @blasfunc , chkuplo
9
9
10
10
using .. LinearAlgebra: libblastrampoline, BlasFloat, BlasInt, LAPACKException, DimensionMismatch,
11
- SingularException, PosDefException, chkstride1, checksquare,triu, tril, dot
11
+ SingularException, PosDefException, chkstride1, checksquare, triu, tril, dot
12
12
13
13
using Base: iszero, require_one_based_indexing
14
14
@@ -554,13 +554,12 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty
554
554
# * .. Array Arguments ..
555
555
# INTEGER IPIV( * )
556
556
# DOUBLE PRECISION A( LDA, * )
557
- function getrf! (A:: AbstractMatrix{$elty} ; check = true )
557
+ function getrf! (A:: AbstractMatrix{$elty} , ipiv :: AbstractVector{BlasInt} ; check:: Bool = true )
558
558
require_one_based_indexing (A)
559
559
check && chkfinite (A)
560
560
chkstride1 (A)
561
561
m, n = size (A)
562
562
lda = max (1 ,stride (A, 2 ))
563
- ipiv = similar (A, BlasInt, min (m,n))
564
563
info = Ref {BlasInt} ()
565
564
ccall ((@blasfunc ($ getrf), libblastrampoline), Cvoid,
566
565
(Ref{BlasInt}, Ref{BlasInt}, Ptr{$ elty},
@@ -679,15 +678,13 @@ Returns `A` and `tau` modified in-place.
679
678
gerqf! (A:: AbstractMatrix , tau:: AbstractVector )
680
679
681
680
"""
682
- getrf!(A) -> (A, ipiv, info)
683
-
684
- Compute the pivoted `LU` factorization of `A`, `A = LU`.
681
+ getrf!(A, ipiv) -> (A, ipiv, info)
685
682
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`).
689
686
"""
690
- getrf! (A:: AbstractMatrix , tau :: AbstractVector )
687
+ getrf! (A:: AbstractMatrix , ipiv :: AbstractVector ; check :: Bool = true )
691
688
692
689
"""
693
690
gelqf!(A) -> (A, tau)
@@ -751,6 +748,17 @@ which parameterize the elementary reflectors of the factorization.
751
748
"""
752
749
gerqf! (A:: AbstractMatrix{<:BlasFloat} ) = ((m,n) = size (A); gerqf! (A, similar (A, min (m, n))))
753
750
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
+
754
762
# # Tools to compute and apply elementary reflectors
755
763
for (larfg, elty) in
756
764
((:dlarfg_ , Float64),
0 commit comments