nag_complex_lu_solve_mult_rhs (f04akc) (PDF version)
f04 Chapter Contents
f04 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_complex_lu_solve_mult_rhs (f04akc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_complex_lu_solve_mult_rhs (f04akc) calculates the approximate solution of a set of complex linear equations with multiple right-hand sides AX = B , where A  has been factorized by nag_complex_lu (f03ahc).

2  Specification

#include <nag.h>
#include <nagf04.h>
void  nag_complex_lu_solve_mult_rhs (Integer n, Integer nrhs, const Complex a[], Integer tda, const Integer pivot[], Complex b[], Integer tdb, NagError *fail)

3  Description

To solve a set of complex linear equations AX = B , the function must be preceded by a call to nag_complex_lu (f03ahc) which computes an LU  factorization of A  with partial pivoting, PA = LU , where P  is a permutation matrix, L  is lower triangular and U  is unit upper triangular. The columns x  of the solution X  are found by forward and backward substitution in Ly = Pb  and Ux = y , where b  is a column of the right-hand side.

4  References

Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

5  Arguments

1:     nIntegerInput
On entry: n , the order of the matrix A .
Constraint: n1 .
2:     nrhsIntegerInput
On entry: r , the number of right-hand sides.
Constraint: nrhs1 .
3:     a[n×tda]const ComplexInput
Note: the i,jth element of the matrix A is stored in a[i-1×tda+j-1].
On entry: details of the LU  factorization, as returned by nag_complex_lu (f03ahc).
4:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: tdan .
5:     pivot[n]const IntegerInput
On entry: details of the row interchanges as returned by nag_complex_lu (f03ahc).
6:     b[n×tdb]ComplexInput/Output
Note: the i,jth element of the matrix B is stored in b[i-1×tdb+j-1].
On entry: the n  by r  right-hand side matrix B .
On exit: B  is overwritten by the solution matrix X .
7:     tdbIntegerInput
On entry: the stride separating matrix column elements in the array b.
Constraint: tdbnrhs .
8:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, tda=value  while n=value . These arguments must satisfy tdan .
On entry, tdb=value  while nrhs=value . These arguments must satisfy tdbnrhs .
NE_INT_ARG_LT
On entry, n=value.
Constraint: n1.
On entry, nrhs=value.
Constraint: nrhs1.

7  Accuracy

The accuracy of the computed solution depends on the conditioning of the original matrix. For a detailed error analysis see page 106 of Wilkinson and Reinsch (1971).

8  Further Comments

The time taken by nag_complex_lu_solve_mult_rhs (f04akc) is approximately proportional to n 2 r .

9  Example

To solve the set of linear equations AX = B  where
A = 1 1 + 2 i 2 + 10 i 1 + i 3 i -5 + 14 i 1 + i 5 i -8 + 20 i   and   B = 1 0 0 .

9.1  Program Text

Program Text (f04akce.c)

9.2  Program Data

Program Data (f04akce.d)

9.3  Program Results

Program Results (f04akce.r)


nag_complex_lu_solve_mult_rhs (f04akc) (PDF version)
f04 Chapter Contents
f04 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012