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 argument `c` is present.
1015
+
1016
+
`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`.
1017
+
1018
+
`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.
1019
+
1020
+
`other_zeroed` (optional): Shall be an input `logical` flag. If `.true.`, the unused part of the output matrix will contains zeroes. Otherwise, it will not be accessed. This saves cpu time. By default, `other_zeroed=.true.`. It is an `intent(in)` argument.
1021
+
1022
+
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
1023
+
1024
+
### Return values
1025
+
1026
+
The factorized matrix is returned in-place overwriting `a` if no other arguments are provided.
1027
+
Otherwise, it can be provided as a second argument `c`. In this case, `a` is not overwritten.
1028
+
The `logical` flag `lower` determines whether the lower- or the upper-triangular factorization should be performed.
1029
+
1030
+
Results are returned on the applicable triangular region of the output matrix, while the unused triangular region
1031
+
is filled by zeroes by default. Optional argument `other_zeroed`, if `.false.` allows the expert user to avoid zeroing the unused part;
1032
+
however, in this case, the unused region of the matrix is not accessed and will usually contain invalid values.
1033
+
1034
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1035
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1036
+
Exceptions trigger an `error stop`, unless argument `err` is present.
1037
+
1038
+
### Example
1039
+
1040
+
```fortran
1041
+
{!example/linalg/example_cholesky.f90!}
1042
+
```
1043
+
1044
+
## `chol` - Compute the Cholesky factorization of a rank-2 square array (matrix).
1045
+
1046
+
### Status
1047
+
1048
+
Experimental
1049
+
1050
+
### Description
1051
+
1052
+
This is a `pure` functional interface for Cholesky factorization. The Cholesky factorization of a `real` or
1053
+
`complex` rank-2 square array (matrix) is computed, \( A = L \cdot L^T \), or \( A = U^T \cdot U \).
1054
+
\( A \) is symmetric or complex Hermitian, and \( L \), \( U \) are lower- or upper-triangular, respectively.
1055
+
The solver is based on LAPACK's `*POTRF` backends.
1056
+
1057
+
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.
1066
+
1067
+
`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.
1068
+
1069
+
`other_zeroed` (optional): Shall be an input `logical` flag. If `.true.`, the unused part of the output matrix will contains zeroes. Otherwise, it will not be accessed. This saves cpu time. By default, `other_zeroed=.true.`. It is an `intent(in)` argument.
1070
+
1071
+
### Return values
1072
+
1073
+
Returns a rank-2 array `c` of the same size and kind as `a`, that contains the triangular Cholesky matrix `L` or `U`.
1074
+
1075
+
Raises `LINALG_ERROR` if the underlying process did not converge.
1076
+
Raises `LINALG_VALUE_ERROR` if the matrix or any of the output arrays invalid/incompatible sizes.
1077
+
Exceptions trigger an `error stop`, unless argument `err` is present.
0 commit comments