operator(.pinv.) Interface

public interface operator(.pinv.)

Pseudo-inverse operator of a matrix (Specification)

Summary

Operator interface for computing the Moore-Penrose pseudo-inverse of a real or complex matrix.

Description

This operator interface provides a convenient way to compute the Moore-Penrose pseudo-inverse of a matrix. Supported data types include real and complex. The pseudo-inverse is computed using singular value decomposition (SVD), with singular values below an internal threshold treated as zero.

For computational errors or invalid input, the function may return a matrix filled with NaNs.

Note

The provided functions are intended for both rectangular and square matrices.


Functions

private module function stdlib_linalg_pinv_c_operator(a) result(pinva)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in), target :: a(:,:)

Input matrix a[m,n]

Return Value complex(kind=sp), (size(a,2,kind=ilp),size(a,1,kind=ilp))

Result pseudo-inverse matrix

private module function stdlib_linalg_pinv_d_operator(a) result(pinva)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), target :: a(:,:)

Input matrix a[m,n]

Return Value real(kind=dp), (size(a,2,kind=ilp),size(a,1,kind=ilp))

Result pseudo-inverse matrix

private module function stdlib_linalg_pinv_s_operator(a) result(pinva)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in), target :: a(:,:)

Input matrix a[m,n]

Return Value real(kind=sp), (size(a,2,kind=ilp),size(a,1,kind=ilp))

Result pseudo-inverse matrix

private module function stdlib_linalg_pinv_z_operator(a) result(pinva)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in), target :: a(:,:)

Input matrix a[m,n]

Return Value complex(kind=dp), (size(a,2,kind=ilp),size(a,1,kind=ilp))

Result pseudo-inverse matrix