F11 Chapter Contents
F11 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF11JBF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F11JBF solves a system of linear equations involving the incomplete Cholesky preconditioning matrix generated by F11JAF.

## 2  Specification

 SUBROUTINE F11JBF ( N, A, LA, IROW, ICOL, IPIV, ISTR, CHECK, Y, X, IFAIL)
 INTEGER N, LA, IROW(LA), ICOL(LA), IPIV(N), ISTR(N+1), IFAIL REAL (KIND=nag_wp) A(LA), Y(N), X(N) CHARACTER(1) CHECK

## 3  Description

F11JBF solves a system of linear equations
 $Mx=y$
involving the preconditioning matrix $M=PLD{L}^{\mathrm{T}}{P}^{\mathrm{T}}$, corresponding to an incomplete Cholesky decomposition of a sparse symmetric matrix stored in symmetric coordinate storage (SCS) format (see Section 2.1.2 in the F11 Chapter Introduction), as generated by F11JAF.
In the above decomposition $L$ is a lower triangular sparse matrix with unit diagonal, $D$ is a diagonal matrix and $P$ is a permutation matrix. $L$ and $D$ are supplied to F11JBF through the matrix
 $C=L+D-1-I$
which is a lower triangular N by N sparse matrix, stored in SCS format, as returned by F11JAF. The permutation matrix $P$ is returned from F11JAF via the array IPIV.
It is envisaged that a common use of F11JBF will be to carry out the preconditioning step required in the application of F11GEF to sparse symmetric linear systems. F11JBF is used for this purpose by the Black Box routine F11JCF.
F11JBF may also be used in combination with F11JAF to solve a sparse symmetric positive definite system of linear equations directly (see Section 8.4 in F11JAF). This use of F11JBF is demonstrated in Section 9.
None.

## 5  Parameters

1:     N – INTEGERInput
On entry: $n$, the order of the matrix $M$. This must be the same value as was supplied in the preceding call to F11JAF.
Constraint: ${\mathbf{N}}\ge 1$.
2:     A(LA) – REAL (KIND=nag_wp) arrayInput
On entry: the values returned in the array A by a previous call to F11JAF.
3:     LA – INTEGERInput
On entry: the dimension of the arrays A, IROW and ICOL as declared in the (sub)program from which F11JBF is called. This must be the same value returned by the preceding call to F11JAF.
4:     IROW(LA) – INTEGER arrayInput
5:     ICOL(LA) – INTEGER arrayInput
6:     IPIV(N) – INTEGER arrayInput
7:     ISTR(${\mathbf{N}}+1$) – INTEGER arrayInput
On entry: the values returned in arrays IROW, ICOL, IPIV and ISTR by a previous call to F11JAF.
8:     CHECK – CHARACTER(1)Input
On entry: specifies whether or not the input data should be checked.
${\mathbf{CHECK}}=\text{'C'}$
Checks are carried out on the values of N, IROW, ICOL, IPIV and ISTR.
${\mathbf{CHECK}}=\text{'N'}$
No checks are carried out.
Constraint: ${\mathbf{CHECK}}=\text{'C'}$ or $\text{'N'}$.
9:     Y(N) – REAL (KIND=nag_wp) arrayInput
On entry: the right-hand side vector $y$.
10:   X(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the solution vector $x$.
11:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{CHECK}}\ne \text{'C'}$ or $\text{'N'}$.
${\mathbf{IFAIL}}=2$
 On entry, ${\mathbf{N}}<1$.
${\mathbf{IFAIL}}=3$
On entry, the SCS representation of the preconditioning matrix $M$ is invalid. Further details are given in the error message. Check that the call to F11JBF has been preceded by a valid call to F11JAF and that the arrays A, IROW, ICOL, IPIV and ISTR have not been corrupted between the two calls.

## 7  Accuracy

The computed solution $x$ is the exact solution of a perturbed system of equations $\left(M+\delta M\right)x=y$, where
 $δM≤cnεPLDLTPT,$
$c\left(n\right)$ is a modest linear function of $n$, and $\epsilon$ is the machine precision.

### 8.1  Timing

The time taken for a call to F11JBF is proportional to the value of NNZC returned from F11JAF.

### 8.2  Use of CHECK

It is expected that a common use of F11JBF will be to carry out the preconditioning step required in the application of F11GEF to sparse symmetric linear systems. In this situation F11JBF is likely to be called many times with the same matrix $M$. In the interests of both reliability and efficiency, you are recommended to set ${\mathbf{CHECK}}=\text{'C'}$ for the first of such calls, and to set ${\mathbf{CHECK}}=\text{'N'}$ for all subsequent calls.

## 9  Example

This example reads in a symmetric positive definite sparse matrix $A$ and a vector $y$. It then calls F11JAF, with ${\mathbf{LFILL}}=-1$ and ${\mathbf{DTOL}}=0.0$, to compute the complete Cholesky decomposition of $A$:
 $A=PLDLTPT.$
Finally it calls F11JBF to solve the system
 $PLDLTPTx=y.$

### 9.1  Program Text

Program Text (f11jbfe.f90)

### 9.2  Program Data

Program Data (f11jbfe.d)

### 9.3  Program Results

Program Results (f11jbfe.r)