@@ -592,18 +592,29 @@ Returns `A` and `tau` modified in-place.
592
592
geqlf! (A:: AbstractMatrix , tau:: AbstractVector )
593
593
594
594
"""
595
- geqp3!(A, jpvt, tau)
595
+ geqp3!(A, [ jpvt, tau]) -> (A, tau, jpvt )
596
596
597
597
Compute the pivoted `QR` factorization of `A`, `AP = QR` using BLAS level 3.
598
598
`P` is a pivoting matrix, represented by `jpvt`. `tau` stores the elementary
599
- reflectors. `jpvt` must have length length greater than or equal to `n` if `A`
600
- is an `(m x n)` matrix. `tau` must have length greater than or equal to the
601
- smallest dimension of `A`.
599
+ reflectors. The arguments `jpvt` and `tau` are optional and allow
600
+ for passing preallocated arrays. When passed, `jpvt` must have length greater
601
+ than or equal to `n` if `A` is an `(m x n)` matrix and `tau` must have length
602
+ greater than or equal to the smallest dimension of `A`.
602
603
603
604
`A`, `jpvt`, and `tau` are modified in-place.
604
605
"""
605
606
geqp3! (A:: AbstractMatrix , jpvt:: AbstractVector{BlasInt} , tau:: AbstractVector )
606
607
608
+ function geqp3! (A:: AbstractMatrix{<:BlasFloat} , jpvt:: AbstractVector{BlasInt} )
609
+ m, n = size (A)
610
+ geqp3! (A, jpvt, similar (A, min (m, n)))
611
+ end
612
+
613
+ function geqp3! (A:: AbstractMatrix{<:BlasFloat} )
614
+ m, n = size (A)
615
+ geqp3! (A, zeros (BlasInt, n), similar (A, min (m, n)))
616
+ end
617
+
607
618
"""
608
619
geqrt!(A, T)
609
620
@@ -725,34 +736,6 @@ which parameterize the elementary reflectors of the factorization.
725
736
"""
726
737
gerqf! (A:: AbstractMatrix{<:BlasFloat} ) = ((m,n) = size (A); gerqf! (A, similar (A, min (m, n))))
727
738
728
- """
729
- geqp3!(A, jpvt) -> (A, jpvt, tau)
730
-
731
- Compute the pivoted `QR` factorization of `A`, `AP = QR` using BLAS level 3.
732
- `P` is a pivoting matrix, represented by `jpvt`. `jpvt` must have length
733
- greater than or equal to `n` if `A` is an `(m x n)` matrix.
734
-
735
- Returns `A` and `jpvt`, modified in-place, and `tau`, which stores the elementary
736
- reflectors.
737
- """
738
- function geqp3! (A:: AbstractMatrix{<:BlasFloat} , jpvt:: AbstractVector{BlasInt} )
739
- m, n = size (A)
740
- geqp3! (A, jpvt, similar (A, min (m, n)))
741
- end
742
-
743
- """
744
- geqp3!(A) -> (A, jpvt, tau)
745
-
746
- Compute the pivoted `QR` factorization of `A`, `AP = QR` using BLAS level 3.
747
-
748
- Returns `A`, modified in-place, `jpvt`, which represents the pivoting matrix `P`,
749
- and `tau`, which stores the elementary reflectors.
750
- """
751
- function geqp3! (A:: AbstractMatrix{<:BlasFloat} )
752
- m, n = size (A)
753
- geqp3! (A, zeros (BlasInt, n), similar (A, min (m, n)))
754
- end
755
-
756
739
# # Tools to compute and apply elementary reflectors
757
740
for (larfg, elty) in
758
741
((:dlarfg_ , Float64),
0 commit comments