nag_real_cholesky_solve_mult_rhs (f04agc) (PDF version)
f04 Chapter Contents
f04 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_real_cholesky_solve_mult_rhs (f04agc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_real_cholesky_solve_mult_rhs (f04agc) calculates the approximate solution of a set of real symmetric positive definite linear equations with multiple right-hand sides, AX = B , where A  has been factorized by nag_real_cholesky (f03aec).

2  Specification

#include <nag.h>
#include <nagf04.h>
void  nag_real_cholesky_solve_mult_rhs (Integer n, Integer nrhs, double a[], Integer tda, double p[], const double b[], Integer tdb, double x[], Integer tdx, NagError *fail)

3  Description

To solve a set of real linear equations AX = B  where A  is symmetric positive definite, nag_real_cholesky_solve_mult_rhs (f04agc) must be preceded by a call to nag_real_cholesky (f03aec) which computes a Cholesky factorization of A  as A = LLT , where L  is lower triangular. The columns x  of the solution X  are found by forward and backward substitution in Ly = b  and LT x = y , where b  is a column of the right-hand sides.

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]doubleInput
Note: the i,jth element of the matrix A is stored in a[i-1×tda+j-1].
On entry: the upper triangle of the n  by n  positive definite symmetric matrix A , and the sub-diagonal elements of its Cholesky factor L , as returned by nag_real_cholesky (f03aec).
4:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: tdan .
5:     p[n]doubleInput
On entry: the reciprocals of the diagonal elements of L , as returned by nag_real_cholesky (f03aec).
6:     b[n×tdb]const doubleInput
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 . See also Section 9.
7:     tdbIntegerInput
On entry: the stride separating matrix column elements in the array b.
Constraint: tdbnrhs .
8:     x[n×tdx]doubleOutput
Note: the i,jth element of the matrix X is stored in x[i-1×tdx+j-1].
On exit: the n  by r  solution matrix X . See also Section 9.
9:     tdxIntegerInput
On entry: the stride separating matrix column elements in the array x.
Constraint: tdxnrhs .
10:   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 .
On entry, tdx=value  while nrhs=value . These arguments must satisfy tdxnrhs .
NE_INT_ARG_LT
On entry, n=value.
Constraint: n1.
On entry, nrhs=value.
Constraint: nrhs1.

7  Accuracy

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

8  Parallelism and Performance

Not applicable.

9  Further Comments

The time taken by nag_real_cholesky_solve_mult_rhs (f04agc) is approximately proportional to n 2 r .
The function may be called with the same actual array supplied for arguments b and x, in which case the solution vectors will overwrite the right-hand sides.

10  Example

This example solves the set of linear equations AX = B  where
A = 5 7 6 5 7 10 8 7 6 8 10 9 5 7 9 10   and   B = 23 32 33 31 .

10.1  Program Text

Program Text (f04agce.c)

10.2  Program Data

Program Data (f04agce.d)

10.3  Program Results

Program Results (f04agce.r)


nag_real_cholesky_solve_mult_rhs (f04agc) (PDF version)
f04 Chapter Contents
f04 Chapter Introduction
NAG Library Manual

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