Solves the linear system for the unknown vector from a square matrix . (Specification)
Subroutine interface for solving a linear system using LU decomposition.
This interface provides methods for computing the solution of a linear matrix system using
a subroutine. Supported data types include real
and complex
. No assumption is made on the matrix
structure. Preallocated space for the solution vector x
is user-provided, and it 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.
The function can solve simultaneously either one (from a 1-d right-hand-side vector b(:)
)
or several (from a 2-d right-hand-side vector b(:,:)
) systems.
Note
The solution is based on LAPACK's generic LU decomposition based solvers *GESV
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
complex(kind=sp), | intent(in) | :: | b(:,:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
complex(kind=sp), | intent(inout), | contiguous, target | :: | x(:,:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
complex(kind=sp), | intent(in) | :: | b(:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
complex(kind=sp), | intent(inout), | contiguous, target | :: | x(:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
real(kind=dp), | intent(in) | :: | b(:,:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
real(kind=dp), | intent(inout), | contiguous, target | :: | x(:,:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
real(kind=dp), | intent(in) | :: | b(:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
real(kind=dp), | intent(inout), | contiguous, target | :: | x(:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
real(kind=sp), | intent(in) | :: | b(:,:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
real(kind=sp), | intent(inout), | contiguous, target | :: | x(:,:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
real(kind=sp), | intent(in) | :: | b(:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
real(kind=sp), | intent(inout), | contiguous, target | :: | x(:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
complex(kind=dp), | intent(in) | :: | b(:,:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
complex(kind=dp), | intent(inout), | contiguous, target | :: | x(:,:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(inout), | target | :: | a(:,:) |
Input matrix a[n,n] |
|
complex(kind=dp), | intent(in) | :: | b(:) |
Right hand side vector or array, b[n] or b[n,nrhs] |
||
complex(kind=dp), | intent(inout), | contiguous, target | :: | x(:) |
Result array/matrix x[n] or x[n,nrhs] |
|
integer(kind=ilp), | intent(inout), | optional, | target | :: | pivot(:) |
[optional] Storage array for the diagonal pivot indices |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[optional] Can A data be overwritten and destroyed? |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |