You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/stdlib_linalg.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -953,7 +953,7 @@ the full problem is solved. On reduced matrices (`shape(Q)==[m,k]`, `shape(R)==[
953
953
954
954
### Syntax
955
955
956
-
`call `[[stdlib_linalg(module):qr(interface)]]`(a, q, r, [, storage] [, overwrite_a] [, err])`
956
+
`call `[[stdlib_linalg(module):qr(interface)]]`(a, q, r [, pivots] [, overwrite_a] [, storage] [, err])`
957
957
958
958
### Arguments
959
959
@@ -963,15 +963,17 @@ the full problem is solved. On reduced matrices (`shape(Q)==[m,k]`, `shape(R)==[
963
963
964
964
`r`: Shall be a rank-2 array of the same kind as `a`, containing the upper triangular matrix `r`. It is an `intent(out)` argument. It should have a shape equal to either `[m,n]` or `[k,n]`, whether the full or the reduced problem is sought for.
965
965
966
-
`storage` (optional): Shall be a rank-1 array of the same type and kind as `a`, providing working storage for the solver. Its minimum size can be determined with a call to [[stdlib_linalg(module):qr_space(interface)]]. It is an `intent(out)` argument.
966
+
`pivots` (optional): Shall be an `integer` array of size `n`. If provided, QR factorization with column-pivoting is being computed.
967
967
968
968
`overwrite_a` (optional): Shall be an input `logical` flag (default: `.false.`). If `.true.`, input matrix `a` will be used as temporary storage and overwritten. This avoids internal data allocation. It is an `intent(in)` argument.
969
969
970
+
`storage` (optional): Shall be a rank-1 array of the same type and kind as `a`, providing working storage for the solver. Its minimum size can be determined with a call to [[stdlib_linalg(module):qr_space(interface)]]. It is an `intent(out)` argument.
971
+
970
972
`err` (optional): Shall be a `type(linalg_state_type)` value. It is an `intent(out)` argument.
971
973
972
974
### Return value
973
975
974
-
Returns the QR factorization matrices into the \( Q \) and \( R \) arguments.
976
+
Returns the QR factorization matrices into the \( Q \) and \( R \) arguments and the optional pivots in `pivots`.
975
977
976
978
Raises `LINALG_VALUE_ERROR` if any of the matrices has invalid or unsuitable size for the full/reduced problem.
977
979
Raises `LINALG_ERROR` on insufficient user storage space.
@@ -981,6 +983,8 @@ If the state argument `err` is not present, exceptions trigger an `error stop`.
981
983
982
984
```fortran
983
985
{!example/linalg/example_qr.f90!}
986
+
987
+
{!example/linalg/example_pivoting_qr.f90!}
984
988
```
985
989
986
990
## `qr_space` - Compute internal working space requirements for the QR factorization.
@@ -995,20 +999,24 @@ This subroutine computes the internal working space requirements for the QR fact
`a`: Shall be a rank-2 `real` or `complex` array containing the coefficient matrix. It is an `intent(in)` argument.
1003
1007
1004
1008
`lwork`: Shall be an `integer` scalar, that returns the minimum array size required for the working storage in [[stdlib_linalg(module):qr(interface)]] to factorize `a`.
1005
1009
1010
+
`pivoting` (optional): Shall a `logical` flag (default: `.false.`). If `.true.`, on exit `lwork` is the optimal workspace size for the QR factorization with column pivoting. If `.false.`, `lwork` is the optimal workspace size for the standard QR factorization.
1011
+
1006
1012
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
1007
1013
1008
1014
### Example
1009
1015
1010
1016
```fortran
1011
1017
{!example/linalg/example_qr_space.f90!}
1018
+
1019
+
{!example/linalg/example_pivoting_qr_space.f90!}
1012
1020
```
1013
1021
1014
1022
## `schur` - Compute the Schur decomposition of a matrix
0 commit comments