library.lapacklin Submodule

Module Summary

Interfaces for the NAG Mark 29.3 lapacklin Chapter.

lapacklin - Linear Equations (LAPACK)

This module provides functions for the solution of systems of simultaneous linear equations, and associated computations. It provides functions for

matrix factorizations;

solution of linear equations;

estimating matrix condition numbers;

computing error bounds for the solution of linear equations;

matrix inversion;

computing scaling factors to equilibrate a matrix.

Functions are provided for both real and complex data.

For a general introduction to the solution of systems of linear equations, you should turn first to the F04 Introduction. The decision trees, in the F04 Introduction, direct you to the most appropriate functions in submodule linsys or submodule lapacklin for solving your particular problem. In particular, submodule linsys and submodule lapacklin contain Black Box (or driver) functions which enable some standard types of problem to be solved by a call to a single function. Where possible, functions in submodule linsys call submodule lapacklin functions to perform the necessary computational tasks.

There are two types of driver functions in this module: simple drivers which just return the solution to the linear equations; and expert drivers which also return condition and error estimates and, in many cases, also allow equilibration. The simple drivers for real matrices have names of the form and for complex matrices have names of the form The expert drivers for real matrices have names of the form and for complex matrices have names of the form

The functions in this module (submodule lapacklin) handle only dense and band matrices (not matrices with more specialised structures, or general sparse matrices).

The functions in this module have all been derived from the LAPACK project (see Anderson et al. (1999)). They have been designed to be efficient on a wide range of high-performance computers, without compromising efficiency on conventional serial machines.

See Also

naginterfaces.library.examples.lapacklin :

This subpackage contains examples for the lapacklin module. See also the Examples subsection.

Functionality Index

Apply iterative refinement to the solution and compute error estimates

after factorizing the matrix of coefficients

complex band matrix: zgbrfs()

complex Hermitian indefinite matrix: zherfs()

complex Hermitian indefinite matrix, packed storage: zhprfs()

complex Hermitian positive definite band matrix: zpbrfs()

complex Hermitian positive definite matrix: zporfs()

complex Hermitian positive definite matrix, packed storage: zpprfs()

complex Hermitian positive definite tridiagonal matrix: zptrfs()

complex matrix: zgerfs()

complex symmetric indefinite matrix: zsyrfs()

complex symmetric indefinite matrix, packed storage: zsprfs()

complex tridiagonal matrix: zgtrfs()

real band matrix: dgbrfs()

real matrix: dgerfs()

real symmetric indefinite matrix: dsyrfs()

real symmetric indefinite matrix, packed storage: dsprfs()

real symmetric positive definite band matrix: dpbrfs()

real symmetric positive definite matrix: dporfs()

real symmetric positive definite matrix, packed storage: dpprfs()

real symmetric positive definite tridiagonal matrix: dptrfs()

real tridiagonal matrix: dgtrfs()

Compute error estimates

complex triangular band matrix: ztbrfs()

complex triangular matrix: ztrrfs()

complex triangular matrix, packed storage: ztprfs()

real triangular band matrix: dtbrfs()

real triangular matrix: dtrrfs()

real triangular matrix, packed storage: dtprfs()

Compute row and column scalings

complex band matrix: zgbequ()

complex Hermitian positive definite band matrix: zpbequ()

complex Hermitian positive definite matrix: zpoequ()

complex Hermitian positive definite matrix, packed storage: zppequ()

complex matrix: zgeequ()

real band matrix: dgbequ()

real matrix: dgeequ()

real symmetric positive definite band matrix: dpbequ()

real symmetric positive definite matrix: dpoequ()

real symmetric positive definite matrix, packed storage: dppequ()

Condition number estimation

after factorizing the matrix of coefficients

complex band matrix: zgbcon()

complex Hermitian indefinite matrix: zhecon()

complex Hermitian indefinite matrix, packed storage: zhpcon()

complex Hermitian positive definite band matrix: zpbcon()

complex Hermitian positive definite matrix: zpocon()

complex Hermitian positive definite matrix, packed storage: zppcon()

complex Hermitian positive definite tridiagonal matrix: zptcon()

complex matrix: zgecon()

complex symmetric indefinite matrix: zsycon()

complex symmetric indefinite matrix, packed storage: zspcon()

complex tridiagonal matrix: zgtcon()

real band matrix: dgbcon()

real matrix: dgecon()

real symmetric indefinite matrix: dsycon()

real symmetric indefinite matrix, packed storage: dspcon()

real symmetric positive definite band matrix: dpbcon()

real symmetric positive definite matrix: dpocon()

real symmetric positive definite matrix, packed storage: dppcon()

real symmetric positive definite tridiagonal matrix: dptcon()

real tridiagonal matrix: dgtcon()

complex triangular band matrix: ztbcon()

complex triangular matrix: ztrcon()

complex triangular matrix, packed storage: ztpcon()

real triangular band matrix: dtbcon()

real triangular matrix: dtrcon()

real triangular matrix, packed storage: dtpcon()

factorization

complex Hermitian positive definite tridiagonal matrix: zpttrf()

real symmetric positive definite tridiagonal matrix: dpttrf()

or factorization

complex Hermitian positive definite band matrix: zpbtrf()

complex Hermitian positive definite matrix: zpotrf()

complex Hermitian positive definite matrix, packed storage: zpptrf()

complex Hermitian positive definite matrix, RFP storage: zpftrf()

complex Hermitian positive semidefinite matrix: zpstrf()

or factorization

real symmetric positive definite band matrix: dpbtrf()

real symmetric positive definite matrix: dpotrf()

real symmetric positive definite matrix, packed storage: dpptrf()

real symmetric positive definite matrix, RFP storage: dpftrf()

real symmetric positive semidefinite matrix: dpstrf()

factorization

complex band matrix: zgbtrf()

complex matrix: zgetrf()

complex tridiagonal matrix: zgttrf()

real band matrix: dgbtrf()

real matrix: dgetrf()

real tridiagonal matrix: dgttrf()

Matrix inversion

after factorizing the matrix of coefficients

complex Hermitian indefinite matrix: zhetri()

complex Hermitian indefinite matrix, packed storage: zhptri()

complex Hermitian positive definite matrix: zpotri()

complex Hermitian positive definite matrix, packed storage: zpptri()

complex Hermitian positive definite matrix, RFP storage: zpftri()

complex matrix: zgetri()

complex symmetric indefinite matrix: zsytri()

complex symmetric indefinite matrix, packed storage: zsptri()

real matrix: dgetri()

real symmetric indefinite matrix: dsytri()

real symmetric indefinite matrix, packed storage: dsptri()

real symmetric positive definite matrix: dpotri()

real symmetric positive definite matrix, packed storage: dpptri()

real symmetric positive definite matrix, RFP storage: dpftri()

complex triangular matrix: ztrtri()

complex triangular matrix, packed storage: ztptri()

complex triangular matrix, RFP storage

expert driver: ztftri()

real triangular matrix: dtrtri()

real triangular matrix, packed storage: dtptri()

real triangular matrix, RFP storage

expert driver: dtftri()

or factorization

complex Hermitian indefinite matrix: zhetrf()

complex Hermitian indefinite matrix, packed storage: zhptrf()

or factorization

complex symmetric indefinite matrix: zsytrf()

complex symmetric indefinite matrix, packed storage: zsptrf()

real symmetric indefinite matrix: dsytrf()

real symmetric indefinite matrix, packed storage: dsptrf()

Solution of simultaneous linear equations

after factorizing the matrix of coefficients

complex band matrix: zgbtrs()

complex Hermitian indefinite matrix: zhetrs()

complex Hermitian indefinite matrix, packed storage: zhptrs()

complex Hermitian positive definite band matrix: zpbtrs()

complex Hermitian positive definite matrix: zpotrs()

complex Hermitian positive definite matrix, packed storage: zpptrs()

complex Hermitian positive definite matrix, RFP storage: zpftrs()

complex Hermitian positive definite tridiagonal matrix: zpttrs()

complex matrix: zgetrs()

complex symmetric indefinite matrix: zsytrs()

complex symmetric indefinite matrix, packed storage: zsptrs()

complex tridiagonal matrix: zgttrs()

real band matrix: dgbtrs()

real matrix: dgetrs()

real symmetric indefinite matrix: dsytrs()

real symmetric indefinite matrix, packed storage: dsptrs()

real symmetric positive definite band matrix: dpbtrs()

real symmetric positive definite matrix: dpotrs()

real symmetric positive definite matrix, packed storage: dpptrs()

real symmetric positive definite matrix, RFP storage: dpftrs()

real symmetric positive definite tridiagonal matrix: dpttrs()

real tridiagonal matrix: dgttrs()

expert drivers (with condition and error estimation)

complex band matrix: zgbsvx()

complex Hermitian indefinite matrix: zhesvx()

complex Hermitian indefinite matrix, packed storage: zhpsvx()

complex Hermitian positive definite band matrix: zpbsvx()

complex Hermitian positive definite matrix: zposvx()

complex Hermitian positive definite matrix, packed storage: zppsvx()

complex Hermitian positive definite tridiagonal matrix: zptsvx()

complex matrix: zgesvx()

complex symmetric indefinite matrix: zsysvx()

complex symmetric indefinite matrix, packed storage: zspsvx()

complex tridiagonal matrix: zgtsvx()

real band matrix: dgbsvx()

real matrix: dgesvx()

real symmetric indefinite matrix: dsysvx()

real symmetric indefinite matrix, packed storage: dspsvx()

real symmetric positive definite band matrix: dpbsvx()

real symmetric positive definite matrix: dposvx()

real symmetric positive definite matrix, packed storage: dppsvx()

real symmetric positive definite tridiagonal matrix: dptsvx()

real tridiagonal matrix: dgtsvx()

simple drivers

complex band matrix: zgbsv()

complex Hermitian indefinite matrix: zhesv()

complex Hermitian indefinite matrix, packed storage: zhpsv()

complex Hermitian positive definite band matrix: zpbsv()

complex Hermitian positive definite matrix: zposv()

complex Hermitian positive definite matrix, packed storage: zppsv()

complex Hermitian positive definite matrix, using mixed precision: zcposv()

complex Hermitian positive definite tridiagonal matrix: zptsv()

complex matrix: zgesv()

complex matrix, using mixed precision: zcgesv()

complex symmetric indefinite matrix: zsysv()

complex symmetric indefinite matrix, packed storage: zspsv()

complex triangular band matrix: ztbtrs()

complex triangular matrix: ztrtrs()

complex triangular matrix, packed storage: ztptrs()

complex tridiagonal matrix: zgtsv()

real band matrix: dgbsv()

real matrix: dgesv()

real matrix, using mixed precision: dsgesv()

real symmetric indefinite matrix: dsysv()

real symmetric indefinite matrix, packed storage: dspsv()

real symmetric positive definite band matrix: dpbsv()

real symmetric positive definite matrix: dposv()

real symmetric positive definite matrix, packed storage: dppsv()

real symmetric positive definite matrix, using mixed precision: dsposv()

real symmetric positive definite tridiagonal matrix: dptsv()

real triangular band matrix: dtbtrs()

real triangular matrix: dtrtrs()

real triangular matrix, packed storage: dtptrs()

real tridiagonal matrix: dgtsv()

For full information please refer to the NAG Library document

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/f07/f07intro.html

Examples

naginterfaces.library.examples.lapacklin.dgesv_ex.main()[source]

Example for naginterfaces.library.lapacklin.dgesv().

Compute the solution to a real system of linear equations, .

>>> main()
naginterfaces.library.lapacklin.dgesv Python Example Results.
Solution of a square linear system with multiple right-hand sides.
Solution X:
[[ 1.]
 [-1.]
 [ 3.]
 [-5.]]
Pivots:
[2 2 3 4]