gesv#

Functions

void sgesv(
    const INT           n,
    const INT           nrhs,
          f32* restrict A,
    const INT           lda,
          INT* restrict ipiv,
          f32* restrict B,
    const INT           ldb,
          INT*          info
);
void sgesv(const INT n, const INT nrhs, f32 *restrict A, const INT lda, INT *restrict ipiv, f32 *restrict B, const INT ldb, INT *info)#

SGESV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

The LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

in
n

The number of linear equations, i.e., the order of the matrix A (n >= 0).

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B (nrhs >= 0).

inout
A

On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. Array of dimension (lda, n).

in
lda

The leading dimension of the array A (lda >= max(1,n)).

out
ipiv

The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv[i]. Array of dimension n, 0-based.

inout
B

On entry, the N-by-NRHS matrix of right hand side matrix B. On exit, if info = 0, the N-by-NRHS solution matrix X. Array of dimension (ldb, nrhs).

in
ldb

The leading dimension of the array B (ldb >= max(1,n)).

out
info

Exit status:

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i, U(i-1,i-1) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.

Functions

void dgesv(
    const INT           n,
    const INT           nrhs,
          f64* restrict A,
    const INT           lda,
          INT* restrict ipiv,
          f64* restrict B,
    const INT           ldb,
          INT*          info
);
void dgesv(const INT n, const INT nrhs, f64 *restrict A, const INT lda, INT *restrict ipiv, f64 *restrict B, const INT ldb, INT *info)#

DGESV computes the solution to a real system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

The LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

in
n

The number of linear equations, i.e., the order of the matrix A (n >= 0).

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B (nrhs >= 0).

inout
A

On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. Array of dimension (lda, n).

in
lda

The leading dimension of the array A (lda >= max(1,n)).

out
ipiv

The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv[i]. Array of dimension n, 0-based.

inout
B

On entry, the N-by-NRHS matrix of right hand side matrix B. On exit, if info = 0, the N-by-NRHS solution matrix X. Array of dimension (ldb, nrhs).

in
ldb

The leading dimension of the array B (ldb >= max(1,n)).

out
info

Exit status:

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i, U(i-1,i-1) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.

Functions

void cgesv(
    const INT           n,
    const INT           nrhs,
          c64* restrict A,
    const INT           lda,
          INT* restrict ipiv,
          c64* restrict B,
    const INT           ldb,
          INT*          info
);
void cgesv(const INT n, const INT nrhs, c64 *restrict A, const INT lda, INT *restrict ipiv, c64 *restrict B, const INT ldb, INT *info)#

CGESV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

The LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

in
n

The number of linear equations, i.e., the order of the matrix A (n >= 0).

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B (nrhs >= 0).

inout
A

On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. Array of dimension (lda, n).

in
lda

The leading dimension of the array A (lda >= max(1,n)).

out
ipiv

The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv[i]. Array of dimension n, 0-based.

inout
B

On entry, the N-by-NRHS matrix of right hand side matrix B. On exit, if info = 0, the N-by-NRHS solution matrix X. Array of dimension (ldb, nrhs).

in
ldb

The leading dimension of the array B (ldb >= max(1,n)).

out
info

Exit status:

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i, U(i-1,i-1) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.

Functions

void zgesv(
    const INT            n,
    const INT            nrhs,
          c128* restrict A,
    const INT            lda,
          INT*  restrict ipiv,
          c128* restrict B,
    const INT            ldb,
          INT*           info
);
void zgesv(const INT n, const INT nrhs, c128 *restrict A, const INT lda, INT *restrict ipiv, c128 *restrict B, const INT ldb, INT *info)#

ZGESV computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

The LU decomposition with partial pivoting and row interchanges is used to factor A as A = P * L * U, where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations A * X = B.

Parameters

in
n

The number of linear equations, i.e., the order of the matrix A (n >= 0).

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B (nrhs >= 0).

inout
A

On entry, the N-by-N coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. Array of dimension (lda, n).

in
lda

The leading dimension of the array A (lda >= max(1,n)).

out
ipiv

The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv[i]. Array of dimension n, 0-based.

inout
B

On entry, the N-by-NRHS matrix of right hand side matrix B. On exit, if info = 0, the N-by-NRHS solution matrix X. Array of dimension (ldb, nrhs).

in
ldb

The leading dimension of the array B (ldb >= max(1,n)).

out
info

Exit status:

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i, U(i-1,i-1) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.