f07ar computes the LU factorization of a complex m by n matrix.


public static void f07ar(
	int m,
	int n,
	Complex[,] a,
	int[] ipiv,
	out int info
Visual Basic
Public Shared Sub f07ar ( _
	m As Integer, _
	n As Integer, _
	a As Complex(,), _
	ipiv As Integer(), _
	<OutAttribute> ByRef info As Integer _
Visual C++
static void f07ar(
	int m, 
	int n, 
	array<Complex,2>^ a, 
	array<int>^ ipiv, 
	[OutAttribute] int% info
static member f07ar : 
        m : int * 
        n : int * 
        a : Complex[,] * 
        ipiv : int[] * 
        info : int byref -> unit 


Type: System..::..Int32
On entry: m, the number of rows of the matrix A.
Constraint: m0.
Type: System..::..Int32
On entry: n, the number of columns of the matrix A.
Constraint: n0.
Type: array<NagLibrary..::..Complex,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1max1,m
Note: the second dimension of the array a must be at least max1,n.
On entry: the m by n matrix A.
On exit: the factors L and U from the factorization A=PLU; the unit diagonal elements of L are not stored.
Type: array<System..::..Int32>[]()[][]
An array of size [minm,n]
On exit: the pivot indices that define the permutation matrix. At the ith step, if ipiv[i-1]>i then row i of the matrix A was interchanged with row ipiv[i-1], for i=1,2,,minm,n. ipiv[i-1]i indicates that, at the ith step, a row interchange was not required.
Type: System..::..Int32%
On exit: info=0 unless the method detects an error (see [Error Indicators and Warnings]).


f07ar forms the LU factorization of a complex m by n matrix A as A=PLU, 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). Usually A is square m=n, and both L and U are triangular. The method uses partial pivoting, with row interchanges.


Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Error Indicators and Warnings

Some error messages may refer to parameters that are dropped from this interface (LDA) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
Element value of the diagonal 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.
An error occured, see message report.
Invalid Parameters value
Invalid dimension for array value
Negative dimension for array value
Invalid Parameters value
Invalid Parameters value


The computed factors L and U are the exact factors of a perturbed matrix A+E, where
cn is a modest linear function of n, and ε is the machine precision.

Parallelism and Performance


Further Comments

The total number of real floating-point operations is approximately 83n3 if m=n (the usual case), 43n23m-n if m>n and 43m23n-m if m<n.
A call to this method with m=n may be followed by calls to the methods:
  • f07as to solve AX=B, ATX=B or AHX=B;
  • (F07AUF not in this release) to estimate the condition number of A;
  • (F07AWF not in this release) to compute the inverse of A.
The real analogue of this method is (F07ADF not in this release).


This example computes the LU factorization of the matrix A, where
A= -1.34+2.55i 0.28+3.17i -6.39-2.20i 0.72-0.92i -0.17-1.41i 3.31-0.15i -0.15+1.34i 1.29+1.38i -3.29-2.39i -1.91+4.42i -0.14-1.35i 1.72+1.35i 2.41+0.39i -0.56+1.47i -0.83-0.69i -1.96+0.67i .

Example program (C#): f07are.cs

Example program data: f07are.d

Example program results: f07are.r

See Also