fortran-lapack
Loading...
Searching...
No Matches
la_inverse::inv Interface Reference

Compute the inverse of a square matrix. More...

Public Member Functions

real(sp) function, dimension(:,:), allocatable la_inverse_s (a, err)
 
real(dp) function, dimension(:,:), allocatable la_inverse_d (a, err)
 
real(qp) function, dimension(:,:), allocatable la_inverse_q (a, err)
 
complex(sp) function, dimension(:,:), allocatable la_inverse_c (a, err)
 
complex(dp) function, dimension(:,:), allocatable la_inverse_z (a, err)
 
complex(qp) function, dimension(:,:), allocatable la_inverse_w (a, err)
 

Detailed Description

Compute the inverse of a square matrix.

This function computes the inverse of a real or complex square matrix \( A \). The inverse is computed using an LU decomposition with partial pivoting.

Parameters
[in]AThe input square matrix of size \( [n, n] \).
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the function will stop execution.
Returns
The inverse matrix \( A^{-1} \) of size \( [n, n] \).
Note
This function relies on LAPACK's LU decomposition routines (GETRF and GETRI).
Warning
The matrix \( A \) must be non-singular. If it is singular or nearly singular, the function will fail.

Compute the inverse of a square matrix in-place.

This subroutine computes the inverse of a real or complex square matrix \( A \) in-place. The inverse is computed using an LU decomposition with partial pivoting.

Parameters
[in,out]AThe input square matrix of size \( [n, n] \). It is replaced by its inverse \( A^{-1} \).
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the function will stop execution.
Note
This subroutine is useful when memory efficiency is a priority, as it avoids additional allocations.
Warning
The matrix \( A \) must be non-singular. If it is singular or nearly singular, the computation will fail.

Compute the inverse of a square matrix using the .inv. operator.

This operator computes the inverse of a real or complex square matrix \( A \) using an LU decomposition with partial pivoting.

Parameters
[in]AThe input square matrix of size \( [n, n] \).
Returns
The inverse matrix \( A^{-1} \) of size \( [n, n] \).
Note
This operator is a shorthand for calling inv(A), allowing expressions such as: \( X = .inv.A \)
Warning
The matrix \( A \) must be non-singular. If it is singular or nearly singular, the computation will fail.

Member Function/Subroutine Documentation

◆ la_inverse_c()

complex(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_c ( complex(sp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_inverse_d()

real(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_d ( real(dp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_inverse_q()

real(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_q ( real(qp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_inverse_s()

real(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_s ( real(sp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_inverse_w()

complex(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_w ( complex(qp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

◆ la_inverse_z()

complex(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_z ( complex(dp), dimension(:,:), intent(in) a,
type(la_state), intent(out), optional err )
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse
Parameters
[out]err[optional] state return flag. On error if not requested, the code will stop

The documentation for this interface was generated from the following file: