NAG Library Function Document
nag_real_lu (f03afc) computes an factorization of a real matrix, with partial pivoting, and evaluates the determinant.
||nag_real_lu (Integer n,
nag_real_lu (f03afc) computes an factorization of a real matrix with partial pivoting: , where is a permutation matrix, is lower triangular and is unit upper triangular. The determinant of is the product of the diagonal elements of with the correct sign determined by the row interchanges.
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
n – IntegerInput
On entry: , the order of the matrix .
a – doubleInput/Output
Note: the th element of the matrix is stored in .
On entry: the by matrix .
On exit: is overwritten by the lower triangular matrix and the off-diagonal elements of the upper triangular matrix . The unit diagonal elements of are not stored.
tda – IntegerInput
: the stride separating matrix column elements in the array a
pivot[n] – IntegerOutput
On exit: gives the row index of the th pivot.
detf – double *Output
dete – Integer *Output
On exit: the determinant of is given by . It is given in this form to avoid overflow or underflow.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, while . The arguments must satisfy .
Dynamic memory allocation failed.
On entry, .
is singular, possibly due to rounding errors. The factorization could not be completed. detf
are set to zero.
The accuracy of the determinant depends on the conditioning of the original matrix. For a detailed error analysis, see Wilkinson and Reinsch (1971)
The time taken by nag_real_lu (f03afc) is approximately proportional to .
To compute the
factorization with partial pivoting, and calculate the determinant, of the real matrix
9.1 Program Text
Program Text (f03afce.c)
9.2 Program Data
Program Data (f03afce.d)
9.3 Program Results
Program Results (f03afce.r)