fortran-lapack
Loading...
Searching...
No Matches
la_solve::solve Interface Reference

Solve a system of linear equations A * X = B. More...

Public Member Functions

real(sp) function, dimension(:), allocatable, target la_ssolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, real(sp)
 
real(dp) function, dimension(:), allocatable, target la_dsolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, real(dp)
 
real(qp) function, dimension(:), allocatable, target la_qsolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, real(qp)
 
complex(sp) function, dimension(:), allocatable, target la_csolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, complex(sp)
 
complex(dp) function, dimension(:), allocatable, target la_zsolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, complex(dp)
 
complex(qp) function, dimension(:), allocatable, target la_wsolve_one (a, b, overwrite_a, err)
 Linear system solve, _one, complex(qp)
 
real(sp) function, dimension(:,:), allocatable, target la_ssolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, real(sp)
 
real(dp) function, dimension(:,:), allocatable, target la_dsolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, real(dp)
 
real(qp) function, dimension(:,:), allocatable, target la_qsolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, real(qp)
 
complex(sp) function, dimension(:,:), allocatable, target la_csolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, complex(sp)
 
complex(dp) function, dimension(:,:), allocatable, target la_zsolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, complex(dp)
 
complex(qp) function, dimension(:,:), allocatable, target la_wsolve_multiple (a, b, overwrite_a, err)
 Linear system solve, _multiple, complex(qp)
 

Detailed Description

Solve a system of linear equations A * X = B.

This function computes the solution to a real system of linear equations:

\( A \cdot X = B \)

where A is an n x n square matrix, and B is either a vector (n) or a matrix (n x nrhs). The solution X is returned as an allocatable array.

Parameters
[in,out]AThe input square matrix of size n x n. If overwrite_a is true, the contents of A may be modified during computation.
[in]BThe right-hand side vector (size n) or matrix (size n x nrhs).
[in]overwrite_a(Optional) If true, A may be overwritten and destroyed. Default is false.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the function will stop execution.
Returns
Solution matrix X of size n (for a single right-hand side) or n x nrhs.
Note
This function relies on LAPACK LU decomposition based solvers *GESV.
Warning
If overwrite_a is enabled, the original contents of A may be lost.

Solve a system of linear equations A * X = B into a pre-allocated array.

Summary

Subroutine interface for solving a linear system through an LU factorization.

Description

This interface solves the linear system

\( A \cdot X = B \)

writing the result into the caller's array x instead of returning a new one. Storage for the pivot indices may also be provided; when both x and pivot are given and overwrite_a is set, the call performs no internal allocation. One (b(:)) or many (b(:,:)) right-hand sides are solved at once.

Note
The solution is based on LAPACK's LU decomposition solvers GESV.
Parameters
[in,out]aThe input square matrix of size n x n. If overwrite_a is true, the contents of A may be modified during computation.
[in]bThe right-hand side vector (size n) or matrix (size n x nrhs).
[in,out]xThe solution vector (size n) or matrix (size n x nrhs), overwritten on return.
[in,out]pivot(Optional) Storage array for the n diagonal pivot indices.
[in]overwrite_a(Optional) If true, A may be overwritten and destroyed. Default is false.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the subroutine will stop execution.
Warning
If overwrite_a is enabled, the original contents of A may be lost.

Solve a Hermitian positive definite system A * X = B.

Summary

Subroutine interface for factorizing and solving a Cholesky system in one call.

Description

This interface computes the Cholesky factorization of the real symmetric or complex Hermitian positive definite matrix A and solves

\( A \cdot X = B \)

for one (b(:)) or many (b(:,:)) right-hand sides, writing the result into the caller's array x. Only the triangle lower selects is read.

Note
The solution is based on LAPACK's POSV drivers.
Parameters
[in,out]aThe input matrix of size n x n. If overwrite_a is true, it is overwritten with its Cholesky factor.
[in]bThe right-hand side vector (size n) or matrix (size n x nrhs).
[in,out]xThe solution vector (size n) or matrix (size n x nrhs), overwritten on return.
[in]lower(Optional) If true, the lower triangle of A is used. Default is true.
[in]overwrite_a(Optional) If true, A may be overwritten and destroyed. Default is false.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the subroutine will stop execution.
Warning
If overwrite_a is enabled, the original contents of A may be lost.

Solve A * X = B from a pre-computed lower Cholesky factor.

Summary

Subroutine interface for solving with the lower triangular factor of \( A = L \cdot L^H \).

Description

This interface solves \( A \cdot X = B \) for one or many right-hand sides, given the lower Cholesky factor of A as returned by cholesky with lower=.true.. The factor is not recomputed, so a repeated solve of the same system costs two triangular solves.

Note
The solution is based on LAPACK's POTRS routines.
Parameters
[in]lThe lower Cholesky factor of size n x n.
[in]bThe right-hand side vector (size n) or matrix (size n x nrhs).
[in,out]xThe solution vector (size n) or matrix (size n x nrhs), overwritten on return.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the subroutine will stop execution.

Solve A * X = B from a pre-computed upper Cholesky factor.

Summary

Subroutine interface for solving with the upper triangular factor of \( A = U^H \cdot U \).

Description

This interface solves \( A \cdot X = B \) for one or many right-hand sides, given the upper Cholesky factor of A as returned by cholesky with lower=.false.. The factor is not recomputed, so a repeated solve of the same system costs two triangular solves.

Note
The solution is based on LAPACK's POTRS routines.
Parameters
[in]uThe upper Cholesky factor of size n x n.
[in]bThe right-hand side vector (size n) or matrix (size n x nrhs).
[in,out]xThe solution vector (size n) or matrix (size n x nrhs), overwritten on return.
[out]err(Optional) A state return flag. If an error occurs and err is not provided, the subroutine will stop execution.

Member Function/Subroutine Documentation

◆ la_csolve_multiple()

complex(sp) function, dimension(:,:), allocatable, target la_solve::solve::la_csolve_multiple ( complex(sp), dimension(:,:), intent(inout), target a,
complex(sp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, complex(sp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_csolve_one()

complex(sp) function, dimension(:), allocatable, target la_solve::solve::la_csolve_one ( complex(sp), dimension(:,:), intent(inout), target a,
complex(sp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, complex(sp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_dsolve_multiple()

real(dp) function, dimension(:,:), allocatable, target la_solve::solve::la_dsolve_multiple ( real(dp), dimension(:,:), intent(inout), target a,
real(dp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, real(dp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_dsolve_one()

real(dp) function, dimension(:), allocatable, target la_solve::solve::la_dsolve_one ( real(dp), dimension(:,:), intent(inout), target a,
real(dp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, real(dp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_qsolve_multiple()

real(qp) function, dimension(:,:), allocatable, target la_solve::solve::la_qsolve_multiple ( real(qp), dimension(:,:), intent(inout), target a,
real(qp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, real(qp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_qsolve_one()

real(qp) function, dimension(:), allocatable, target la_solve::solve::la_qsolve_one ( real(qp), dimension(:,:), intent(inout), target a,
real(qp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, real(qp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_ssolve_multiple()

real(sp) function, dimension(:,:), allocatable, target la_solve::solve::la_ssolve_multiple ( real(sp), dimension(:,:), intent(inout), target a,
real(sp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, real(sp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_ssolve_one()

real(sp) function, dimension(:), allocatable, target la_solve::solve::la_ssolve_one ( real(sp), dimension(:,:), intent(inout), target a,
real(sp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, real(sp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_wsolve_multiple()

complex(qp) function, dimension(:,:), allocatable, target la_solve::solve::la_wsolve_multiple ( complex(qp), dimension(:,:), intent(inout), target a,
complex(qp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, complex(qp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_wsolve_one()

complex(qp) function, dimension(:), allocatable, target la_solve::solve::la_wsolve_one ( complex(qp), dimension(:,:), intent(inout), target a,
complex(qp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, complex(qp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_zsolve_multiple()

complex(dp) function, dimension(:,:), allocatable, target la_solve::solve::la_zsolve_multiple ( complex(dp), dimension(:,:), intent(inout), target a,
complex(dp), dimension(:,:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _multiple, complex(dp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

◆ la_zsolve_one()

complex(dp) function, dimension(:), allocatable, target la_solve::solve::la_zsolve_one ( complex(dp), dimension(:,:), intent(inout), target a,
complex(dp), dimension(:), intent(in) b,
logical(lk), intent(in), optional overwrite_a,
type(la_state), intent(out), optional err )

Linear system solve, _one, complex(dp)

Parameters
[in,out]aInput matrix a[n,n]
[in]bRight hand side vector or array, b[n] or b[n,nrhs]
[in]overwrite_a[optional] Can A data be overwritten and destroyed?
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Result array/matrix x[n] or x[n,nrhs]

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