inv Interface

public interface inv

Inverse of a square matrix (Specification)

Summary

This interface provides methods for computing the inverse of a square real or complex matrix. The inverse is defined such that .

Description

This function interface provides methods that return the inverse of a square matrix.
Supported data types include real and complex. The inverse matrix is returned as a function result. Exceptions are raised in case of singular matrix or invalid size, and trigger an error stop if the state flag err is not provided.

Note

The provided functions are intended for square matrices.


Functions

private module function stdlib_linalg_inverse_c(a, err) result(inva)

Arguments

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

Input matrix a[n,n]

type(linalg_state_type), intent(out), optional :: err

[optional] state return flag. On error if not requested, the code will stop

Return Value complex(kind=sp), allocatable, (:,:)

Output matrix inverse

private module function stdlib_linalg_inverse_d(a, err) result(inva)

Arguments

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

Input matrix a[n,n]

type(linalg_state_type), intent(out), optional :: err

[optional] state return flag. On error if not requested, the code will stop

Return Value real(kind=dp), allocatable, (:,:)

Output matrix inverse

private module function stdlib_linalg_inverse_s(a, err) result(inva)

Arguments

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

Input matrix a[n,n]

type(linalg_state_type), intent(out), optional :: err

[optional] state return flag. On error if not requested, the code will stop

Return Value real(kind=sp), allocatable, (:,:)

Output matrix inverse

private module function stdlib_linalg_inverse_z(a, err) result(inva)

Arguments

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

Input matrix a[n,n]

type(linalg_state_type), intent(out), optional :: err

[optional] state return flag. On error if not requested, the code will stop

Return Value complex(kind=dp), allocatable, (:,:)

Output matrix inverse