|
| pure real(sp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_s (a, rtol) |
| |
| real(sp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_err_s (a, rtol, err) |
| |
| pure real(dp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_d (a, rtol) |
| |
| real(dp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_err_d (a, rtol, err) |
| |
| pure complex(sp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_c (a, rtol) |
| |
| complex(sp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_err_c (a, rtol, err) |
| |
| pure complex(dp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_z (a, rtol) |
| |
| complex(dp) function, dimension(size(a, 2, kind=ilp), size(a, 1, kind=ilp)) | la_pseudoinverse_err_z (a, rtol, err) |
| |
Compute the pseudo-inverse of a matrix.
This function computes the Moore-Penrose pseudo-inverse of a real or complex matrix \( A \). The pseudo-inverse is computed using Singular Value Decomposition (SVD):
\( A^+ = V \Sigma^+ U^T \)
where \( U \) and \( V \) are unitary matrices, and \( \Sigma^+ \) is the pseudo-inverse of the singular values.
- Parameters
-
| [in] | A | The input matrix of size \( [m, n] \). |
| [in] | rtol | (Optional) Relative tolerance for singular value truncation. If not provided, a default value is used. |
| [out] | err | (Optional) A state return flag. Without it the function is pure, and an error stops execution. |
- Returns
- The pseudo-inverse matrix \( A^+ \) of size \( [n, m] \).
- Note
- This function relies on LAPACK's SVD routines (GESVD or GESDD).
- Warning
- If
rtol is too large, important singular values may be discarded, leading to inaccurate results.
Compute the pseudo-inverse of a matrix (subroutine version).
This subroutine computes the Moore-Penrose pseudo-inverse of a real or complex matrix \( A \), storing the result in a pre-allocated output matrix \( A^+ \). The computation is based on Singular Value Decomposition (SVD):
\( A^+ = V \Sigma^+ U^T \)
where \( U \) and \( V \) are unitary matrices, and \( \Sigma^+ \) is the pseudo-inverse of the singular values.
- Parameters
-
| [in,out] | A | The input matrix of size \( [m, n] \). Unchanged unless overwrite_a is true. |
| [out] | pinva | The output pseudo-inverse matrix of size \( [n, m] \). |
| [in] | rtol | (Optional) Relative tolerance for singular value truncation. |
| [in] | overwrite_a | (Optional) Can the SVD destroy A instead of working on a copy? Default: false. |
| [out] | err | (Optional) A state return flag. If an error occurs and err is not provided, the function will stop execution. |
- Note
- This subroutine is useful when the output matrix
pinva is already allocated and avoids memory allocation inside the routine.
- Warning
- With
overwrite_a=.true., the contents of A are destroyed.
Compute the pseudo-inverse of a matrix using the .pinv. operator.
This operator computes the Moore-Penrose pseudo-inverse of a real or complex matrix \( A \) using Singular Value Decomposition (SVD):
\( A^+ = V \Sigma^+ U^T \)
where \( U \) and \( V \) are unitary matrices, and \( \Sigma^+ \) is the pseudo-inverse of the singular values.
- Parameters
-
| [in] | A | The input matrix of size \( [m, n] \). |
- Returns
- The pseudo-inverse matrix \( A^+ \) of size \( [n, m] \).
- Note
- This operator is the
pure form of pinv(A), allowing expressions such as: \( X = .pinv.A \). Execution stops if the SVD fails.
- Warning
- The accuracy of the pseudo-inverse depends on the condition number of \( A \).
Compute the pseudo-inverse of a matrix.
This function computes the Moore-Penrose pseudo-inverse of a real or complex matrix \( A \). The pseudo-inverse is computed using Singular Value Decomposition (SVD):
\( A^+ = V \Sigma^+ U^T \)
where \( U \) and \( V \) are unitary matrices, and \( \Sigma^+ \) is the pseudo-inverse of the singular values.
- Parameters
-
| [in] | A | The input matrix of size \( [m, n] \). |
| [in] | rtol | (Optional) Relative tolerance for singular value truncation. If not provided, a default value is used. |
| [out] | err | (Optional) A state return flag. Without it the function is pure, and an error stops execution. |
- Returns
- The pseudo-inverse matrix \( A^+ \) of size \( [n, m] \).
- Note
- This function relies on LAPACK's SVD routines (
*GESVD or *GESDD).
- Warning
- If
rtol is too large, important singular values may be discarded, leading to inaccurate results.