# p?getf2

Computes an LU factorization of a general matrix, using partial pivoting with row interchanges (local blocked algorithm).

## Syntax

call psgetf2(m, n, a, ia, ja, desca, ipiv, info)

call pdgetf2(m, n, a, ia, ja, desca, ipiv, info)

call pcgetf2(m, n, a, ia, ja, desca, ipiv, info)

call pzgetf2(m, n, a, ia, ja, desca, ipiv, info)

## Description

This routine computes an LU factorization of a general m-by-n distributed matrix sub(A) = `A(ia:ia+m-1`, `ja:ja+n-1)` using partial pivoting with row interchanges.

The factorization has the form `sub(A) = P * L* U`, where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if `m>n`), and U is upper triangular (upper trapezoidal if `m < n`). This is the right-looking Parallel Level 2 BLAS version of the algorithm.

## Input Parameters

m

  (global). INTEGER.

  The number of rows to be operated on, that is, the number of rows of the distributed submatrix sub(A). `(m≥0)`.

n

  (global).INTEGER. The number of columns to be operated on, that is, the number of columns of the distributed submatrix sub(A). `(nb_a - mod(ja-1, nb_a)≥n≥0)`.

a

  (local).

  REAL for psgetf2

  DOUBLE PRECISION for pdgetf2

  COMPLEX for pcgetf2

  COMPLEX*16 for pzgetf2.

  Pointer into the local memory to an array of DIMENSION`(lld_a, LOCc(ja+n-1))`.

  On entry, this array contains the local pieces of the m-by-n distributed matrix sub(A).

ia, ja

  (global) INTEGER. The row and column indices in the global array a indicating the first row and the first column of the submatrix sub(A), respectively.

desca

  (global and local) INTEGER array, DIMENSION (dlen_). The array descriptor for the distributed matrix A.

## Output Parameters

ipiv

  (local). INTEGER.

  Array, DIMENSION`(LOCr(m_a) + mb_a)`. This array contains the pivoting information. `ipiv(i) ->` The global row that local row i was swapped with. This array is tied to the distributed matrix A.

info

  (local). INTEGER.

  If `info = 0`: successful exit.

  If info < 0:

  - if the i-th argument is an array and the j-entry had an illegal value, then `info = -(i*100+j)`,

  - if the i-th argument is a scalar and had an illegal value, then `info = - i`.

  If `info > 0`: If `info = k`, `u(ia+k-1`, `ja+k-1 )` is exactly zero. The factorization has been completed, but the factor u is exactly singular, and division by zero will occur if it is used to solve a system of equations.

Parent topic: Auxiliary Routines