Skip to main content

Inv

Returns inverse of matrix.

Calling example:

CALL Inv(A(:,:), InvA(:,:))
CALL Inv(A(:,:,:), InvA(:,:,:))
note

InvA should be allocated.

caution

Currently, Inv can compute inverse of matrix upto 4 by 4. To calculate inverse of big matrix use the following strategy:

First get LU decomposition:

CALL GetLU(A, LU, IPIV)

Then, calculate inverse by

CALL GetLU(A, invA, IPIV)

Interface 1

INTERFACE
MODULE PURE SUBROUTINE Inv(invA, A)
REAL(DFP), INTENT(INOUT) :: invA(:, :)
REAL(DFP), INTENT(IN) :: A(:, :)
END SUBROUTINE Inv
END INTERFACE

Interface 2

INTERFACE
MODULE PURE SUBROUTINE Inv(invA, A)
REAL(DFP), INTENT(INOUT) :: invA(:, :, :)
REAL(DFP), INTENT(IN) :: A(:, :, :)
END SUBROUTINE Inv
END INTERFACE