fortran-lapack
Loading...
Searching...
No Matches
la_pseudoinverse::pinv Interface Reference

Compute the pseudo-inverse of a matrix. More...

Public Member Functions

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)
 

Detailed Description

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]AThe 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]AThe input matrix of size \( [m, n] \). Unchanged unless overwrite_a is true.
[out]pinvaThe 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]AThe 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]AThe 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.

Member Function/Subroutine Documentation

◆ la_pseudoinverse_c()

pure complex(sp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_c ( complex(sp), dimension(:,:), intent(in) a,
real(sp), intent(in), optional rtol )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_d()

pure real(dp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_d ( real(dp), dimension(:,:), intent(in) a,
real(dp), intent(in), optional rtol )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_err_c()

complex(sp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_err_c ( complex(sp), dimension(:,:), intent(in) a,
real(sp), intent(in), optional rtol,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
[out]errState return flag
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_err_d()

real(dp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_err_d ( real(dp), dimension(:,:), intent(in) a,
real(dp), intent(in), optional rtol,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
[out]errState return flag
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_err_s()

real(sp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_err_s ( real(sp), dimension(:,:), intent(in) a,
real(sp), intent(in), optional rtol,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
[out]errState return flag
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_err_z()

complex(dp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_err_z ( complex(dp), dimension(:,:), intent(in) a,
real(dp), intent(in), optional rtol,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
[out]errState return flag
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_s()

pure real(sp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_s ( real(sp), dimension(:,:), intent(in) a,
real(sp), intent(in), optional rtol )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
Returns
Matrix pseudo-inverse

◆ la_pseudoinverse_z()

pure complex(dp) function, dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)) la_pseudoinverse::pinv::la_pseudoinverse_z ( complex(dp), dimension(:,:), intent(in) a,
real(dp), intent(in), optional rtol )
Parameters
[in]aInput matrix a[m,n]
[in]rtol[optional] ....
Returns
Matrix pseudo-inverse

The documentation for this interface was generated from the following file: