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
+127-4Lines changed: 127 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,8 @@ end interface axpy
98
98
Note that the 128-bit functions are only provided by `stdlib` and always point to the internal implementation.
99
99
Because 128-bit precision is identified as [stdlib_kinds(module):qp], initials for 128-bit procedures were
100
100
labelled as `q` (quadruple-precision reals) and `w` ("wide" or quadruple-precision complex numbers).
101
-
Extended precision ([stdlib_kinds(module):xdp]) calculations are currently not supported.
101
+
Extended precision ([stdlib_kinds(module):xdp]) calculations are labelled as `x` (extended-precision reals).
102
+
and `y` (extended-precision complex numbers).
102
103
103
104
### Example
104
105
@@ -775,7 +776,7 @@ Result vector `x` returns the approximate solution that minimizes the 2-norm \(
775
776
776
777
`cond` (optional): Shall be a scalar `real` value cut-off threshold for rank evaluation: `s_i >= cond*maxval(s), i=1:rank`. Shall be a scalar, `intent(in)` argument.
777
778
778
-
`singvals` (optional): Shall be a `real` rank-1 array of the same kind `a` and size at least `minval(shape(a))`, returning the list of singular values `s(i)>=cond*maxval(s)`, in descending order of magnitude. It is an `intent(out)` argument.
779
+
`singvals` (optional): Shall be a `real` rank-1 array of the same kind `a` and size at least `min(m,n)`, returning the list of singular values `s(i)>=cond*maxval(s)` from the internal SVD, in descending order of magnitude. It is an `intent(out)` argument.
779
780
780
781
`overwrite_a` (optional): Shall be an input `logical` flag. If `.true.`, input matrix `A` will be used as temporary storage and overwritten. This avoids internal data allocation. This is an `intent(in)` argument.
781
782
@@ -877,15 +878,15 @@ This interface is equivalent to the `pure` version of determinant [[stdlib_linal
`a`: Shall be a rank-2, square, `real` or `complex` array containing the coefficient matrix.
1223
+
If `inva` is provided, it is an `intent(in)` argument.
1224
+
If `inva` is not provided, it is an `intent(inout)` argument: on output, it is replaced by the inverse of `a`.
1225
+
1226
+
`inva` (optional): Shall be a rank-2, square, `real` or `complex` array with the same size, and kind as `a`.
1227
+
On output, it contains the inverse of `a`.
1228
+
1229
+
`pivot` (optional): Shall be a rank-1 array of the same kind and matrix dimension as `a`, that contains the diagonal pivot indices on return. It is an `intent(inout)` argument.
1230
+
1231
+
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
1232
+
1233
+
### Return value
1234
+
1235
+
Computes the inverse of the matrix \( A \), \(A^{-1}\, and returns it either in \( A \) or in another matrix.
1236
+
1237
+
Raises `LINALG_ERROR` if the matrix is singular or has invalid size.
1238
+
Raises `LINALG_VALUE_ERROR` if `inva` and `a` do not have the same size.
1239
+
If `err` is not present, exceptions trigger an `error stop`.
1240
+
1241
+
### Example
1242
+
1243
+
```fortran
1244
+
{!example/linalg/example_inverse_inplace.f90!}
1245
+
```
1246
+
1247
+
```fortran
1248
+
{!example/linalg/example_inverse_subroutine.f90!}
1249
+
```
1250
+
1251
+
## `inv` - Inverse of a square matrix.
1252
+
1253
+
### Status
1254
+
1255
+
Experimental
1256
+
1257
+
### Description
1258
+
1259
+
This function returns the inverse of a square `real` or `complex` matrix in-place.
1260
+
The inverse, \( A^{-1} \), is defined such that \( A \cdot A^{-1} = A^{-1} \cdot A = I_n \).
1261
+
1262
+
The solver is based on LAPACK's `*GETRF` and `*GETRI` backends.
0 commit comments