Developer Reference

Intel® oneAPI Math Kernel Library LAPACK Examples

ID 766877
Date 12/20/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

LAPACK Routines: Linear Equations

The Intel® oneAPI Math Kernel Library includes LAPACK routines for solving systems of linear equations, factoring and inverting matrices, and estimating condition numbers.

To solve a particular problem, you can call two or more computational routines or call a corresponding driver routine that combines several tasks in one call, such as ?gesv for factoring and solving. For example, to solve a system of linear equations with a general matrix, call ?getrf (LU factorization) and then ?getrs (computing the solution). Call ?gerfs to refine the solution and get the error bounds. Alternatively, use the driver routine ?gesvx, which performs all these tasks in one call.

You can also find an appropriate routine using the characteristics of your data and the operations you need by using the oneMKL LAPACK Function Finding Advisor, which helps you find the routine that suits your needs best.

CAUTION:

The  standard LAPACK functions do not check the input data (matrices) for IEEE 754 floating point INFs or NANS. INFs and NANs will propagate through the computations and may cause unexpected results or instabilities. It is the user's responsibility to ensure that the input data do not contain INFs nor NaNs.

The LAPACKE (C interfaces to LAPACK) functions do check for NaNs in the input data (matrices) , and an error code is returned if a NAN is found.

Driver Routines for Solving Systems of Linear Equations
Routine Description Examples
?gesv Computes the solution to the system of linear equations with a square matrix A and multiple right-hand sides.

cgesv

dgesv

sgesv

zgesv

?posv Computes the solution to the system of linear equations with a symmetric or Hermitian positive definite matrix A and multiple right-hand sides.

cposv

dposv

sposv

zposv

?sysv Computes the solution to the system of linear equations with a real or complex symmetric matrix A and multiple right-hand sides.

csysv

dsysv

ssysv

zsysv

?hesv Computes the solution to the system of linear equations with a Hermitian matrix A and multiple right-hand sides.

chesv

zhesv