F12 Chapter Contents
F12 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF12ASF

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.
Note: this routine uses optional parameters to define choices in the problem specification. If you wish to use default settings for all of the optional parameters, then the option setting routine F12ARF need not be called. If, however, you wish to reset some or all of the settings please refer to Section 10 in F12ARF for a detailed description of the specification of the optional parameters.

## 1  Purpose

F12ASF can be used to return additional monitoring information during computation. It is in a suite of routines consisting of F12ANF, F12APF, F12AQF, F12ARF and F12ASF.

## 2  Specification

 SUBROUTINE F12ASF ( NITER, NCONV, RITZ, RZEST, ICOMM, COMM)
 INTEGER NITER, NCONV, ICOMM(*) COMPLEX (KIND=nag_wp) RITZ(*), RZEST(*), COMM(*)

## 3  Description

The suite of routines is designed to calculate some of the eigenvalues, $\lambda$, (and optionally the corresponding eigenvectors, $x$) of a standard complex eigenvalue problem $Ax=\lambda x$, or of a generalized complex eigenvalue problem $Ax=\lambda Bx$ of order $n$, where $n$ is large and the coefficient matrices $A$ and $B$ are sparse and complex. The suite can also be used to find selected eigenvalues/eigenvectors of smaller scale dense complex problems.
On an intermediate exit from F12APF with ${\mathbf{IREVCM}}=4$, F12ASF may be called to return monitoring information on the progress of the Arnoldi iterative process. The information returned by F12ASF is:
 – the number of the current Arnoldi iteration; – the number of converged eigenvalues at this point; – the converged eigenvalues; – the error bounds on the converged eigenvalues.
F12ASF does not have an equivalent routine from the ARPACK package which prints various levels of detail of monitoring information through an output channel controlled via a parameter value (see Lehoucq et al. (1998) for details of ARPACK routines). F12ASF should not be called at any time other than immediately following an ${\mathbf{IREVCM}}=4$ return from F12APF.

## 4  References

Lehoucq R B (2001) Implicitly restarted Arnoldi methods and subspace iteration SIAM Journal on Matrix Analysis and Applications 23 551–562
Lehoucq R B and Scott J A (1996) An evaluation of software for computing eigenvalues of sparse nonsymmetric matrices Preprint MCS-P547-1195 Argonne National Laboratory
Lehoucq R B and Sorensen D C (1996) Deflation techniques for an implicitly restarted Arnoldi iteration SIAM Journal on Matrix Analysis and Applications 17 789–821
Lehoucq R B, Sorensen D C and Yang C (1998) ARPACK Users' Guide: Solution of Large-scale Eigenvalue Problems with Implicitly Restarted Arnoldi Methods SIAM, Philidelphia

## 5  Parameters

1:     NITER – INTEGEROutput
On exit: the number of the current Arnoldi iteration.
2:     NCONV – INTEGEROutput
On exit: the number of converged eigenvalues so far.
3:     RITZ($*$) – COMPLEX (KIND=nag_wp) arrayOutput
Note: the dimension of the array RITZ must be at least ${\mathbf{NCV}}$ (see F12ANF).
On exit: the first NCONV locations of the array RITZ contain the converged approximate eigenvalues.
4:     RZEST($*$) – COMPLEX (KIND=nag_wp) arrayOutput
Note: the dimension of the array RZEST must be at least ${\mathbf{NCV}}$ (see F12ANF).
On exit: the first NCONV locations of the array RZEST contain the complex Ritz estimates on the converged approximate eigenvalues.
5:     ICOMM($*$) – INTEGER arrayCommunication Array
Note: the dimension of the array ICOMM must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{LICOMM}}\right)$, where LICOMM is passed to the setup routine  (see F12ANF).
On entry: the array ICOMM output by the preceding call to F12APF.
6:     COMM($*$) – COMPLEX (KIND=nag_wp) arrayCommunication Array
Note: the dimension of the array COMM must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{LCOMM}}\right)$, where LCOMM is passed to the setup routine  (see F12ANF).
On entry: the array COMM output by the preceding call to F12APF.

None.

## 7  Accuracy

A Ritz value, $\lambda$, is deemed to have converged if the magnitude of its Ritz estimate $\le {\mathbf{Tolerance}}×\left|\lambda \right|$. The default Tolerance used is the machine precision given by X02AJF.

None.

## 9  Example

This example solves $Ax=\lambda Bx$ in shifted-inverse mode, where $A$ and $B$ are obtained from the standard central difference discretization of the one-dimensional convection-diffusion operator $\frac{{d}^{2}u}{d{x}^{2}}+\rho \frac{du}{dx}$ on $\left[0,1\right]$, with zero Dirichlet boundary conditions. The shift, $\sigma$, is a complex number, and the operator used in the shifted-inverse iterative process is $\mathrm{OP}=\text{inv}\left(A-\sigma B\right)×B$.

### 9.1  Program Text

Program Text (f12asfe.f90)

### 9.2  Program Data

Program Data (f12asfe.d)

### 9.3  Program Results

Program Results (f12asfe.r)