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

Compute the pseudo-inverse of a matrix (subroutine version). More...

Public Member Functions

pure subroutine la_pseudoinvert_s (a, pinva, rtol, overwrite_a, err)
 
pure subroutine la_pseudoinvert_d (a, pinva, rtol, overwrite_a, err)
 
pure subroutine la_pseudoinvert_c (a, pinva, rtol, overwrite_a, err)
 
pure subroutine la_pseudoinvert_z (a, pinva, rtol, overwrite_a, err)
 

Detailed Description

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.

Member Function/Subroutine Documentation

◆ la_pseudoinvert_c()

pure subroutine la_pseudoinverse::pseudoinvert::la_pseudoinvert_c ( complex(sp), dimension(:,:), intent(inout) a,
complex(sp), dimension(:,:), intent(inout) pinva,
real(sp), intent(in), optional rtol,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )
Parameters
[in,out]aInput matrix a[m,n]
[in,out]pinvaOutput pseudo-inverse matrix
[in]rtol[optional] ....
[in]overwrite_a[optional] Can A data be overwritten and destroyed? (default: no)
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_pseudoinvert_d()

pure subroutine la_pseudoinverse::pseudoinvert::la_pseudoinvert_d ( real(dp), dimension(:,:), intent(inout) a,
real(dp), dimension(:,:), intent(inout) pinva,
real(dp), intent(in), optional rtol,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )
Parameters
[in,out]aInput matrix a[m,n]
[in,out]pinvaOutput pseudo-inverse matrix
[in]rtol[optional] ....
[in]overwrite_a[optional] Can A data be overwritten and destroyed? (default: no)
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_pseudoinvert_s()

pure subroutine la_pseudoinverse::pseudoinvert::la_pseudoinvert_s ( real(sp), dimension(:,:), intent(inout) a,
real(sp), dimension(:,:), intent(inout) pinva,
real(sp), intent(in), optional rtol,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )
Parameters
[in,out]aInput matrix a[m,n]
[in,out]pinvaOutput pseudo-inverse matrix
[in]rtol[optional] ....
[in]overwrite_a[optional] Can A data be overwritten and destroyed? (default: no)
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_pseudoinvert_z()

pure subroutine la_pseudoinverse::pseudoinvert::la_pseudoinvert_z ( complex(dp), dimension(:,:), intent(inout) a,
complex(dp), dimension(:,:), intent(inout) pinva,
real(dp), intent(in), optional rtol,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )
Parameters
[in,out]aInput matrix a[m,n]
[in,out]pinvaOutput pseudo-inverse matrix
[in]rtol[optional] ....
[in]overwrite_a[optional] Can A data be overwritten and destroyed? (default: no)
[out]err[optional] state return flag. On error if not requested, the code will stop

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