# NAG Library Routine Document

## 1Purpose

f11gtf is the third in a suite of three routines for the iterative solution of a complex Hermitian system of simultaneous linear equations (see Golub and Van Loan (1996)). f11gtf returns information about the computations during an iteration and/or after this has been completed. The first routine of the suite, f11grf, is a setup routine, the second routine, f11gsf is the proper iterative solver.
These three routines are suitable for the solution of large sparse complex Hermitian systems of equations.

## 2Specification

Fortran Interface
 Subroutine f11gtf ( itn, its, work,
 Integer, Intent (In) :: lwork Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: itn, its Real (Kind=nag_wp), Intent (Out) :: stplhs, stprhs, anorm, sigmax, sigerr Complex (Kind=nag_wp), Intent (In) :: work(lwork)
C Header Interface
#include nagmk26.h
 void f11gtf_ ( Integer *itn, double *stplhs, double *stprhs, double *anorm, double *sigmax, Integer *its, double *sigerr, const Complex work[], const Integer *lwork, Integer *ifail)

## 3Description

f11gtf returns information about the solution process. It can be called both during a monitoring step of the solver f11gsf or after this solver has completed its tasks. Calling f11gtf at any other time will result in an error condition being raised.
For further information you should read the documentation for f11grf and f11gsf.
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## 5Arguments

1:     $\mathbf{itn}$ – IntegerOutput
On exit: the number of iterations carried out by f11gsf.
2:     $\mathbf{stplhs}$ – Real (Kind=nag_wp)Output
On exit: the current value of the left-hand side of the termination criterion used by f11gsf.
3:     $\mathbf{stprhs}$ – Real (Kind=nag_wp)Output
On exit: the current value of the right-hand side of the termination criterion used by f11gsf.
4:     $\mathbf{anorm}$ – Real (Kind=nag_wp)Output
On exit: the norm ${‖A‖}_{1}={‖A‖}_{\infty }$ when either it has been supplied to f11grf or it has been estimated by f11gsf (see also Sections 3 and 5 in f11grf).
Otherwise, ${\mathbf{anorm}}=0.0$ is returned.
5:     $\mathbf{sigmax}$ – Real (Kind=nag_wp)Output
On exit: the current estimate of the largest singular value ${\sigma }_{1}\left(\stackrel{-}{A}\right)$ of the preconditioned iteration matrix $\stackrel{-}{A}={E}^{-1}A{E}^{-\mathrm{H}}$, when either it has been supplied to f11grf or it has been estimated by f11gsf (see also Sections 3 and 5 in f11grf). Note that if ${\mathbf{its}}<{\mathbf{itn}}$ then sigmax contains the final estimate. If, on final exit from f11gsf, ${\mathbf{its}}={\mathbf{itn}}$, the estimation of ${\sigma }_{1}\left(\stackrel{-}{A}\right)$ may have not converged: in this case you should look at the value returned in sigerr. Otherwise, ${\mathbf{sigmax}}=0.0$ is returned.
6:     $\mathbf{its}$ – IntegerOutput
On exit: the number of iterations employed so far in the computation of the estimate of ${\sigma }_{1}\left(\stackrel{-}{A}\right)$, the largest singular value of the preconditioned matrix $\stackrel{-}{A}={E}^{-1}A{E}^{-\mathrm{H}}$, when ${\sigma }_{1}\left(\stackrel{-}{A}\right)$ has been estimated by f11gsf using the bisection method (see also Sections 3, 5 and 9 in f11grf). Otherwise, ${\mathbf{its}}=0$ is returned.
7:     $\mathbf{sigerr}$ – Real (Kind=nag_wp)Output
On exit: if ${\sigma }_{1}\left(\stackrel{-}{A}\right)$ has been estimated by f11gsf using bisection,
 $sigerr=maxσ1k-σ1k-1σ1k,σ1k-σ1k-2σ1k ,$
where $k={\mathbf{its}}$ denotes the iteration number. The estimation has converged if ${\mathbf{sigerr}}\le {\mathbf{sigtol}}$ where sigtol is an input argument to f11grf.
Otherwise, ${\mathbf{sigerr}}=0.0$ is returned.
8:     $\mathbf{work}\left({\mathbf{lwork}}\right)$ – Complex (Kind=nag_wp) arrayCommunication Array
On entry: the array work as returned by f11gsf (see also Section 3 in f11gsf).
9:     $\mathbf{lwork}$ – IntegerInput
On entry: the dimension of the array work as declared in the (sub)program from which f11gtf is called (see also Section 5 in f11grf).
Constraint: ${\mathbf{lwork}}\ge 120$.
Note:  although the minimum value of lwork ensures the correct functioning of f11gtf, a larger value is required by the iterative solver f11gsf (see also Section 5 in f11grf).
10:   $\mathbf{ifail}$ – IntegerInput/Output
On entry: ifail must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-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}}=-i$
On entry, the $i$th argument had an illegal value.
${\mathbf{ifail}}=1$
f11gtf has been called out of sequence. For example, the last call to f11gsf did not return ${\mathbf{irevcm}}=3$ or $4$.
${\mathbf{ifail}}=-99$
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

Not applicable.

## 8Parallelism and Performance

f11gtf is not threaded in any implementation.

None.

## 10Example

See Section 10 in f11grf.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017