invert Interface

public interface invert

Inversion of a square matrix (Specification)

Summary

This interface provides methods for inverting a square real or complex matrix in-place. The inverse is defined such that .

Description

This subroutine interface provides a way to compute the inverse of a matrix.
Supported data types include real and complex. The user may provide a unique matrix argument a. In this case, a is replaced by the inverse matrix. on output. Otherwise, one may provide two separate arguments: an input matrix a and an output matrix inva. In this case, a will not be modified, and the inverse is returned in inva. Pre-allocated storage may be provided for the array of pivot indices, pivot. If all pre-allocated work spaces are provided, no internal memory allocations take place when using this interface.

Note

The provided subroutines are intended for square matrices.


Subroutines

private module subroutine stdlib_linalg_invert_inplace_c(a, pivot, err)

Arguments

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

Input matrix a[n,n]

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_inplace_d(a, pivot, err)

Arguments

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

Input matrix a[n,n]

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_inplace_s(a, pivot, err)

Arguments

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

Input matrix a[n,n]

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_inplace_z(a, pivot, err)

Arguments

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

Input matrix a[n,n]

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_split_c(a, inva, pivot, err)

Arguments

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

Input matrix a[n,n].

complex(kind=sp), intent(out) :: inva(:,:)

Inverse matrix a[n,n].

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_split_d(a, inva, pivot, err)

Arguments

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

Input matrix a[n,n].

real(kind=dp), intent(out) :: inva(:,:)

Inverse matrix a[n,n].

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_split_s(a, inva, pivot, err)

Arguments

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

Input matrix a[n,n].

real(kind=sp), intent(out) :: inva(:,:)

Inverse matrix a[n,n].

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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

private module subroutine stdlib_linalg_invert_split_z(a, inva, pivot, err)

Arguments

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

Input matrix a[n,n].

complex(kind=dp), intent(out) :: inva(:,:)

Inverse matrix a[n,n].

integer(kind=ilp), intent(inout), optional, target :: pivot(:)

[optional] Storage array for the diagonal pivot indices

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

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