Skip to content

Commit e2eac02

Browse files
committed
Added specs.
1 parent 2bb062a commit e2eac02

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

doc/specs/stdlib_linalg.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ the full problem is solved. On reduced matrices (`shape(Q)==[m,k]`, `shape(R)==[
953953

954954
### Syntax
955955

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])`
957957

958958
### Arguments
959959

@@ -963,15 +963,17 @@ the full problem is solved. On reduced matrices (`shape(Q)==[m,k]`, `shape(R)==[
963963

964964
`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.
965965

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.
967967

968968
`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.
969969

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+
970972
`err` (optional): Shall be a `type(linalg_state_type)` value. It is an `intent(out)` argument.
971973

972974
### Return value
973975

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`.
975977

976978
Raises `LINALG_VALUE_ERROR` if any of the matrices has invalid or unsuitable size for the full/reduced problem.
977979
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`.
981983

982984
```fortran
983985
{!example/linalg/example_qr.f90!}
986+
987+
{!example/linalg/example_pivoting_qr.f90!}
984988
```
985989

986990
## `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
995999

9961000
### Syntax
9971001

998-
`call ` [[stdlib_linalg(module):qr_space(interface)]] `(a, lwork, [, err])`
1002+
`call ` [[stdlib_linalg(module):qr_space(interface)]] `(a, lwork, [, pivoting] [, err])`
9991003

10001004
### Arguments
10011005

10021006
`a`: Shall be a rank-2 `real` or `complex` array containing the coefficient matrix. It is an `intent(in)` argument.
10031007

10041008
`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`.
10051009

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+
10061012
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
10071013

10081014
### Example
10091015

10101016
```fortran
10111017
{!example/linalg/example_qr_space.f90!}
1018+
1019+
{!example/linalg/example_pivoting_qr_space.f90!}
10121020
```
10131021

10141022
## `schur` - Compute the Schur decomposition of a matrix

0 commit comments

Comments
 (0)