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
`a`: Shall be a rank-2 square `real` or `complex` array containing the coefficient matrix of size `[n,n]`. It is an `intent(inout)` argument, but returns unchanged if the argument `c` is present.
1271
+
1272
+
`c` (optional): Shall be a rank-2 square `real` or `complex` of the same size and kind as `a`. It is an `intent(out)` argument, that returns the triangular Cholesky matrix `L` or `U`.
1273
+
1274
+
`lower`: Shall be an input `logical` flag. If `.true.`, the lower triangular decomposition \( A = L \cdot L^T \) will be performed. If `.false.`, the upper decomposition \( A = U^T \cdot U \) will be performed.
1275
+
1276
+
`other_zeroed` (optional): Shall be an input `logical` flag. If `.true.`, the unused part of the output matrix will contain zeroes. Otherwise, it will not be accessed. This saves cpu time. By default, `other_zeroed=.true.`. It is an `intent(in)` argument.
1277
+
1278
+
`err` (optional): Shall be a `type(linalg_state_type)` value. It is an `intent(out)` argument.
1279
+
1280
+
### Return values
1281
+
1282
+
The factorized matrix is returned in-place overwriting `a` if no other arguments are provided.
1283
+
Otherwise, it can be provided as a second argument `c`. In this case, `a` is not overwritten.
1284
+
The `logical` flag `lower` determines whether the lower- or the upper-triangular factorization should be performed.
1285
+
1286
+
Results are returned on the applicable triangular region of the output matrix, while the unused triangular region
1287
+
is filled by zeroes by default. Optional argument `other_zeroed`, if `.false.` allows the expert user to avoid zeroing the unused part;
1288
+
however, in this case, the unused region of the matrix is not accessed and will usually contain invalid values.
1289
+
1290
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1291
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1292
+
Exceptions trigger an `error stop`, unless argument `err` is present.
1293
+
1294
+
### Example
1295
+
1296
+
```fortran
1297
+
{!example/linalg/example_cholesky.f90!}
1298
+
```
1299
+
1300
+
## `chol` - Compute the Cholesky factorization of a rank-2 square array (matrix)
1301
+
1302
+
### Status
1303
+
1304
+
Experimental
1305
+
1306
+
### Description
1307
+
1308
+
This is a `pure` functional interface for the Cholesky factorization of a `real` or
1309
+
`complex` rank-2 square array (matrix) computed as \( A = L \cdot L^T \), or \( A = U^T \cdot U \).
1310
+
\( A \) is symmetric or complex Hermitian, and \( L \), \( U \) are lower- or upper-triangular, respectively.
1311
+
The solver is based on LAPACK's `*POTRF` backends.
1312
+
1313
+
Result matrix `c` has the same size and kind as `a`, and returns the lower or upper triangular factor.
`a`: Shall be a rank-2 square `real` or `complex` array containing the coefficient matrix of size `[n,n]`. It is an `intent(inout)` argument, but returns unchanged if argument `c` is present.
1322
+
1323
+
`lower`: Shall be an input `logical` flag. If `.true.`, the lower triangular decomposition \( A = L \cdot L^T \) will be performed. If `.false.`, the upper decomposition \( A = U^T \cdot U \) will be performed.
1324
+
1325
+
`other_zeroed` (optional): Shall be an input `logical` flag. If `.true.`, the unused part of the output matrix will contain zeroes. Otherwise, it will not be accessed. This saves cpu time. By default, `other_zeroed=.true.`. It is an `intent(in)` argument.
1326
+
1327
+
### Return values
1328
+
1329
+
Returns a rank-2 array `c` of the same size and kind as `a`, that contains the triangular Cholesky matrix `L` or `U`.
1330
+
1331
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1332
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1333
+
Exceptions trigger an `error stop`, unless argument `err` is present.
1334
+
1335
+
### Example
1336
+
1337
+
```fortran
1338
+
{!example/linalg/example_chol.f90!}
1339
+
```
1340
+
1341
+
1247
1342
## `.inv.` - Inverse operator of a square matrix
1248
1343
1249
1344
### Status
@@ -1273,7 +1368,6 @@ If an exception occurred on input errors, or singular matrix, `NaN`s will be ret
1273
1368
For fine-grained error control in case of singular matrices prefer the `subroutine` and the `function`
0 commit comments