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

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

Public Member Functions

pure real(sp) function, dimension(:,:), allocatable la_inverse_s (a)
 
real(sp) function, dimension(:,:), allocatable la_inverse_err_s (a, err)
 
pure real(dp) function, dimension(:,:), allocatable la_inverse_d (a)
 
real(dp) function, dimension(:,:), allocatable la_inverse_err_d (a, err)
 
pure real(xdp) function, dimension(:,:), allocatable la_inverse_x (a)
 
real(xdp) function, dimension(:,:), allocatable la_inverse_err_x (a, err)
 
pure real(qp) function, dimension(:,:), allocatable la_inverse_q (a)
 
real(qp) function, dimension(:,:), allocatable la_inverse_err_q (a, err)
 
pure complex(sp) function, dimension(:,:), allocatable la_inverse_c (a)
 
complex(sp) function, dimension(:,:), allocatable la_inverse_err_c (a, err)
 
pure complex(dp) function, dimension(:,:), allocatable la_inverse_z (a)
 
complex(dp) function, dimension(:,:), allocatable la_inverse_err_z (a, err)
 
pure complex(xdp) function, dimension(:,:), allocatable la_inverse_y (a)
 
complex(xdp) function, dimension(:,:), allocatable la_inverse_err_y (a, err)
 
pure complex(qp) function, dimension(:,:), allocatable la_inverse_w (a)
 
complex(qp) function, dimension(:,:), allocatable la_inverse_err_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. Without it the function is pure, and an error stops 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.

This subroutine computes the inverse of a real or complex square matrix \( A \), either in-place or into a second matrix inva of the same shape. The inverse is computed using an LU decomposition with partial pivoting. Storage for the pivot indices may be provided, so that a repeated call performs no internal allocation of the pivot array.

Parameters
[in,out]AThe input square matrix of size \( [n, n] \). In the in-place form it is replaced by its inverse \( A^{-1} \); in the split form it is read only.
[out]inva(Split form only) The inverse matrix \( A^{-1} \), of size \( [n, n] \).
[in,out]pivot(Optional) Storage array for the n diagonal pivot indices.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the function will stop execution.
Note
The in-place form 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 the pure form of inv(A), allowing expressions such as: \( X = .inv.A \)
Warning
The matrix \( A \) must be non-singular. If it is singular or nearly singular, execution stops.

Member Function/Subroutine Documentation

◆ la_inverse_c()

pure complex(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_c ( complex(sp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_d()

pure real(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_d ( real(dp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_err_c()

complex(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_c ( complex(sp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_d()

real(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_d ( real(dp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_q()

real(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_q ( real(qp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_s()

real(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_s ( real(sp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_w()

complex(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_w ( complex(qp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_x()

real(xdp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_x ( real(xdp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_y()

complex(xdp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_y ( complex(xdp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_err_z()

complex(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_err_z ( complex(dp), dimension(:,:), intent(in) a,
type(la_state), intent(out) err )
Parameters
[in]aInput matrix a[n,n]
[out]errState return flag
Returns
Output matrix inverse (empty 0x0 on error)

◆ la_inverse_q()

pure real(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_q ( real(qp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_s()

pure real(sp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_s ( real(sp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_w()

pure complex(qp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_w ( complex(qp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_x()

pure real(xdp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_x ( real(xdp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_y()

pure complex(xdp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_y ( complex(xdp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

◆ la_inverse_z()

pure complex(dp) function, dimension(:,:), allocatable la_inverse::inv::la_inverse_z ( complex(dp), dimension(:,:), intent(in) a)
Parameters
[in]aInput matrix a[n,n]
Returns
Output matrix inverse

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