inverse Interface

public interface inverse

Public interface for functions that calculate a matrix inverse.


Contents


Module Procedures

public pure function matrix_inverse_re(A) result(R)

Wrapper for matrix_inverse_cx that allows the procedure to be used for real matrices.

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:,:):: A

Matrix A [n×n]

Return Value real(kind=wp), dimension(size(A,1),size(A,1))

Matrix R=A¯¹

public pure function matrix_inverse_cx(A) result(R)

Invert a square n×n matrix using Gauss-Jordan elimination with partial pivoting. In the special case n=2, the inverse is evaluated using a cofactoring algorithm. [This implementation is based on Algorithm #2 in "Efficient matrix inversion via Gauss-Jordan elimination and its parallelization" by E.S. Quintana et al. (1998)]

Arguments

Type IntentOptional AttributesName
complex(kind=wp), intent(in), dimension(:,:):: A

Matrix A [n×n]

Return Value complex(kind=wp), dimension(size(A,1),size(A,1))

Matrix R=A¯¹