f11 Chapter Contents
f11 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_sparse_nsym_basic_diagnostic (f11bfc)

## 1  Purpose

nag_sparse_nsym_basic_diagnostic (f11bfc) is the third in a suite of three functions for the iterative solution of a real general (nonsymmetric) system of simultaneous linear equations (see Golub and Van Loan (1996)). nag_sparse_nsym_basic_diagnostic (f11bfc) returns information about the computations during an iteration and/or after this has been completed. The first function of the suite, nag_sparse_nsym_basic_setup (f11bdc), is a setup function; the second function, nag_sparse_nsym_basic_solver (f11bec), is the iterative solver itself.
These three functions are suitable for the solution of large sparse general (nonsymmetric) systems of equations.

## 2  Specification

 #include #include
 void nag_sparse_nsym_basic_diagnostic (Integer *itn, double *stplhs, double *stprhs, double *anorm, double *sigmax, const double work[], Integer lwork, NagError *fail)

## 3  Description

nag_sparse_nsym_basic_diagnostic (f11bfc) returns information about the solution process. It can be called either during a monitoring step of nag_sparse_nsym_basic_solver (f11bec) or after nag_sparse_nsym_basic_solver (f11bec) has completed its tasks. Calling nag_sparse_nsym_basic_diagnostic (f11bfc) at any other time will result in an error condition being raised.
For further information you should read the documentation for nag_sparse_nsym_basic_setup (f11bdc) and nag_sparse_nsym_basic_solver (f11bec).

## 4  References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## 5  Arguments

1:     itnInteger *Output
On exit: the number of iterations carried out by nag_sparse_nsym_basic_solver (f11bec).
2:     stplhsdouble *Output
On exit: the current value of the left-hand side of the termination criterion used by nag_sparse_nsym_basic_solver (f11bec).
3:     stprhsdouble *Output
On exit: the current value of the right-hand side of the termination criterion used by nag_sparse_nsym_basic_solver (f11bec).
4:     anormdouble *Output
On exit: if ${\mathbf{iterm}}=1$ in the previous call to nag_sparse_nsym_basic_setup (f11bdc) then anorm contains ${‖A‖}_{p}$, where $p=1$, $2$ or $\infty$, either supplied or, in the case of $1$ or $\infty$ estimated by nag_sparse_nsym_basic_solver (f11bec); otherwise ${\mathbf{anorm}}=0.0$.
5:     sigmaxdouble *Output
On exit: if ${\mathbf{iterm}}=2$ in the previous call to nag_sparse_nsym_basic_setup (f11bdc), the current estimate of the largest singular value ${\sigma }_{1}\left(\stackrel{-}{A}\right)$ of the preconditioned iteration matrix, either when it has been supplied to nag_sparse_nsym_basic_setup (f11bdc) or it has been estimated by nag_sparse_nsym_basic_solver (f11bec) (see also Sections 3 and 5 in nag_sparse_nsym_basic_setup (f11bdc)); otherwise, ${\mathbf{sigmax}}=0.0$ is returned.
6:     work[lwork]const doubleCommunication Array
On entry: the array work as returned by nag_sparse_nsym_basic_solver (f11bec) (see also Sections 3 and 5 in nag_sparse_nsym_basic_solver (f11bec)).
7:     lworkIntegerInput
On entry: the dimension of the array work (see also Section 5 in nag_sparse_nsym_basic_setup (f11bdc)).
Constraint: ${\mathbf{lwork}}\ge 100$.
Note: although the minimum value of lwork ensures the correct functioning of nag_sparse_nsym_basic_diagnostic (f11bfc), a larger value is required by the iterative solver nag_sparse_nsym_basic_solver (f11bec) (see also Section 5 in nag_sparse_nsym_basic_setup (f11bdc)).
8:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

On entry, argument number $〈\mathit{\text{value}}〉$ had an illegal value.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INT
On entry, ${\mathbf{lwork}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{lwork}}\ge 100$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_OUT_OF_SEQUENCE
nag_sparse_nsym_basic_diagnostic (f11bfc) has been called out of sequence.

Not applicable.