getri#

Functions

void sgetri(
    const INT           n,
          f32* restrict A,
    const INT           lda,
    const INT* restrict ipiv,
          f32* restrict work,
    const INT           lwork,
          INT*          info
);
void sgetri(const INT n, f32 *restrict A, const INT lda, const INT *restrict ipiv, f32 *restrict work, const INT lwork, INT *info)#

SGETRI computes the inverse of a matrix using the LU factorization computed by SGETRF.

This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).

Parameters

in
n

The order of the matrix A. n>=0.

inout
A

Array of dimension (lda, n). On entry, the factors L and U from the factorization A = P*L*U as computed by sgetrf. On exit, if info=0, the inverse of the original matrix A.

in
lda

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

in
ipiv

Array of dimension n. The pivot indices from sgetrf; row i was interchanged with row ipiv[i].

out
work

Workspace array of dimension (max(1,lwork)). On exit, if info=0, then work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n). For optimal performance lwork>=n*nb. If lwork=-1, a workspace query is assumed.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.

Functions

void dgetri(
    const INT           n,
          f64* restrict A,
    const INT           lda,
    const INT* restrict ipiv,
          f64* restrict work,
    const INT           lwork,
          INT*          info
);
void dgetri(const INT n, f64 *restrict A, const INT lda, const INT *restrict ipiv, f64 *restrict work, const INT lwork, INT *info)#

DGETRI computes the inverse of a matrix using the LU factorization computed by DGETRF.

This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).

Parameters

in
n

The order of the matrix A. n>=0.

inout
A

Array of dimension (lda, n). On entry, the factors L and U from the factorization A = P*L*U as computed by dgetrf. On exit, if info=0, the inverse of the original matrix A.

in
lda

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

in
ipiv

Array of dimension n. The pivot indices from dgetrf; row i was interchanged with row ipiv[i].

out
work

Workspace array of dimension (max(1,lwork)). On exit, if info=0, then work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n). For optimal performance lwork>=n*nb. If lwork=-1, a workspace query is assumed.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.

Functions

void cgetri(
    const INT           n,
          c64* restrict A,
    const INT           lda,
    const INT* restrict ipiv,
          c64* restrict work,
    const INT           lwork,
          INT*          info
);
void cgetri(const INT n, c64 *restrict A, const INT lda, const INT *restrict ipiv, c64 *restrict work, const INT lwork, INT *info)#

CGETRI computes the inverse of a matrix using the LU factorization computed by CGETRF.

This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).

Parameters

in
n

The order of the matrix A. n>=0.

inout
A

Array of dimension (lda, n). On entry, the factors L and U from the factorization A = P*L*U as computed by cgetrf. On exit, if info=0, the inverse of the original matrix A.

in
lda

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

in
ipiv

Array of dimension n. The pivot indices from cgetrf; row i was interchanged with row ipiv[i].

out
work

Workspace array of dimension (max(1,lwork)). On exit, if info=0, then work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n). For optimal performance lwork>=n*nb. If lwork=-1, a workspace query is assumed.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.

Functions

void zgetri(
    const INT            n,
          c128* restrict A,
    const INT            lda,
    const INT*  restrict ipiv,
          c128* restrict work,
    const INT            lwork,
          INT*           info
);
void zgetri(const INT n, c128 *restrict A, const INT lda, const INT *restrict ipiv, c128 *restrict work, const INT lwork, INT *info)#

ZGETRI computes the inverse of a matrix using the LU factorization computed by ZGETRF.

This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).

Parameters

in
n

The order of the matrix A. n>=0.

inout
A

Array of dimension (lda, n). On entry, the factors L and U from the factorization A = P*L*U as computed by zgetrf. On exit, if info=0, the inverse of the original matrix A.

in
lda

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

in
ipiv

Array of dimension n. The pivot indices from zgetrf; row i was interchanged with row ipiv[i].

out
work

Workspace array of dimension (max(1,lwork)). On exit, if info=0, then work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n). For optimal performance lwork>=n*nb. If lwork=-1, a workspace query is assumed.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.