NAG Library Function Document
nag_real_lin_eqn (f04arc) calculates the approximate solution of a set of real linear equations with a single right-hand side, using an factorization with partial pivoting.
||nag_real_lin_eqn (Integer n,
const double b,
Given a set of linear equations, , the function first computes an factorization of with partial pivoting, , where is a permutation matrix, is lower triangular and is unit upper triangular. The approximate solution is found by forward and backward substitution in and , where is the right-hand side.
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.
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
b[n] – const doubleInput
On entry: the right-hand side vector .
x[n] – doubleOutput
On exit: the solution vector .
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, while . These arguments must satisfy .
Dynamic memory allocation failed.
On entry, .
The matrix is singular, possibly due to rounding errors.
The accuracy of the computed solution depends on the conditioning of the original matrix. For a detailed error analysis see page 107 of Wilkinson and Reinsch (1971)
The time taken by nag_real_lin_eqn (f04arc) is approximately proportional to .
To solve the set of linear equations
9.1 Program Text
Program Text (f04arce.c)
9.2 Program Data
Program Data (f04arce.d)
9.3 Program Results
Program Results (f04arce.r)