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-4
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,8 @@ end interface axpy
104
104
Note that the 128-bit functions are only provided by `stdlib` and always point to the internal implementation.
105
105
Because 128-bit precision is identified as [stdlib_kinds(module):qp], initials for 128-bit procedures were
106
106
labelled as `q` (quadruple-precision reals) and `w` ("wide" or quadruple-precision complex numbers).
107
-
Extended precision ([stdlib_kinds(module):xdp]) calculations are currently not supported.
107
+
Extended precision ([stdlib_kinds(module):xdp]) calculations are labelled as `x` (extended-precision reals).
108
+
and `y` (extended-precision complex numbers).
108
109
109
110
### Example
110
111
@@ -779,7 +780,7 @@ Result vector `x` returns the approximate solution that minimizes the 2-norm \(
779
780
780
781
`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.
781
782
782
-
`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.
783
+
`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.
783
784
784
785
`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.
785
786
@@ -881,15 +882,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.
1227
+
If `inva` is provided, it is an `intent(in)` argument.
1228
+
If `inva` is not provided, it is an `intent(inout)` argument: on output, it is replaced by the inverse of `a`.
1229
+
1230
+
`inva` (optional): Shall be a rank-2, square, `real` or `complex` array with the same size, and kind as `a`.
1231
+
On output, it contains the inverse of `a`.
1232
+
1233
+
`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.
1234
+
1235
+
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
1236
+
1237
+
### Return value
1238
+
1239
+
Computes the inverse of the matrix \( A \), \(A^{-1}\, and returns it either in \( A \) or in another matrix.
1240
+
1241
+
Raises `LINALG_ERROR` if the matrix is singular or has invalid size.
1242
+
Raises `LINALG_VALUE_ERROR` if `inva` and `a` do not have the same size.
1243
+
If `err` is not present, exceptions trigger an `error stop`.
1244
+
1245
+
### Example
1246
+
1247
+
```fortran
1248
+
{!example/linalg/example_inverse_inplace.f90!}
1249
+
```
1250
+
1251
+
```fortran
1252
+
{!example/linalg/example_inverse_subroutine.f90!}
1253
+
```
1254
+
1255
+
## `inv` - Inverse of a square matrix.
1256
+
1257
+
### Status
1258
+
1259
+
Experimental
1260
+
1261
+
### Description
1262
+
1263
+
This function returns the inverse of a square `real` or `complex` matrix in-place.
1264
+
The inverse, \( A^{-1} \), is defined such that \( A \cdot A^{-1} = A^{-1} \cdot A = I_n \).
1265
+
1266
+
The solver is based on LAPACK's `*GETRF` and `*GETRI` backends.
0 commit comments