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.
1194
+
1195
+
`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`.
1196
+
1197
+
`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.
1198
+
1199
+
`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.
1200
+
1201
+
`err` (optional): Shall be a `type(linalg_state_type)` value. It is an `intent(out)` argument.
1202
+
1203
+
### Return values
1204
+
1205
+
The factorized matrix is returned in-place overwriting `a` if no other arguments are provided.
1206
+
Otherwise, it can be provided as a second argument `c`. In this case, `a` is not overwritten.
1207
+
The `logical` flag `lower` determines whether the lower- or the upper-triangular factorization should be performed.
1208
+
1209
+
Results are returned on the applicable triangular region of the output matrix, while the unused triangular region
1210
+
is filled by zeroes by default. Optional argument `other_zeroed`, if `.false.` allows the expert user to avoid zeroing the unused part;
1211
+
however, in this case, the unused region of the matrix is not accessed and will usually contain invalid values.
1212
+
1213
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1214
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1215
+
Exceptions trigger an `error stop`, unless argument `err` is present.
1216
+
1217
+
### Example
1218
+
1219
+
```fortran
1220
+
{!example/linalg/example_cholesky.f90!}
1221
+
```
1222
+
1223
+
## `chol` - Compute the Cholesky factorization of a rank-2 square array (matrix)
1224
+
1225
+
### Status
1226
+
1227
+
Experimental
1228
+
1229
+
### Description
1230
+
1231
+
This is a `pure` functional interface for the Cholesky factorization of a `real` or
1232
+
`complex` rank-2 square array (matrix) computed as \( A = L \cdot L^T \), or \( A = U^T \cdot U \).
1233
+
\( A \) is symmetric or complex Hermitian, and \( L \), \( U \) are lower- or upper-triangular, respectively.
1234
+
The solver is based on LAPACK's `*POTRF` backends.
1235
+
1236
+
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.
1245
+
1246
+
`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.
1247
+
1248
+
`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.
1249
+
1250
+
### Return values
1251
+
1252
+
Returns a rank-2 array `c` of the same size and kind as `a`, that contains the triangular Cholesky matrix `L` or `U`.
1253
+
1254
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1255
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1256
+
Exceptions trigger an `error stop`, unless argument `err` is present.
1257
+
1258
+
### Example
1259
+
1260
+
```fortran
1261
+
{!example/linalg/example_chol.f90!}
1262
+
```
1263
+
1264
+
1170
1265
## `.inv.` - Inverse operator of a square matrix
1171
1266
1172
1267
### Status
@@ -1196,7 +1291,6 @@ If an exception occurred on input errors, or singular matrix, `NaN`s will be ret
1196
1291
For fine-grained error control in case of singular matrices prefer the `subroutine` and the `function`
0 commit comments