f12 Chapter Contents
f12 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_real_symm_sparse_eigensystem_monit (f12fec)

Note: this function uses optional arguments to define choices in the problem specification. If you wish to use default settings for all of the optional arguments, then the option setting routine nag_real_symm_sparse_eigensystem_option (f12fdc) need not be called. If, however, you wish to reset some or all of the settings please refer to Section 10 in nag_real_symm_sparse_eigensystem_option (f12fdc) for a detailed description of the specification of the optional arguments.

## 1  Purpose

nag_real_symm_sparse_eigensystem_monit (f12fec) can be used to return additional monitoring information during computation. It is in a suite of functions which includes nag_real_symm_sparse_eigensystem_init (f12fac), nag_real_symm_sparse_eigensystem_iter (f12fbc), nag_real_symm_sparse_eigensystem_sol (f12fcc) and nag_real_symm_sparse_eigensystem_option (f12fdc).

## 2  Specification

 #include #include
 void nag_real_symm_sparse_eigensystem_monit (Integer *niter, Integer *nconv, double ritz[], double rzest[], const Integer icomm[], const double comm[])

## 3  Description

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

## 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  Arguments

1:     niterInteger *Output
On exit: the number of the current Arnoldi iteration.
2:     nconvInteger *Output
On exit: the number of converged eigenvalues so far.
3:     ritz[$\mathit{dim}$]doubleOutput
Note: the dimension, dim, of the array ritz must be at least ${\mathbf{ncv}}$ (see nag_real_symm_sparse_eigensystem_init (f12fac)).
On exit: the first nconv locations of the array ritz contain the real converged approximate eigenvalues.
4:     rzest[$\mathit{dim}$]doubleOutput
Note: the dimension, dim, of the array rzest must be at least ${\mathbf{ncv}}$ (see nag_real_symm_sparse_eigensystem_init (f12fac)).
On exit: the first nconv locations of the array rzest contain the Ritz estimates (error bounds) on the real nconv converged approximate eigenvalues.
5:     icomm[$\mathit{dim}$]const IntegerCommunication Array
Note: the dimension, dim, 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 function  (see nag_real_symm_sparse_eigensystem_init (f12fac)).
On entry: the array icomm output by the preceding call to nag_real_symm_sparse_eigensystem_iter (f12fbc).
6:     comm[$\mathit{dim}$]const doubleCommunication Array
Note: the dimension, dim, 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 function  (see nag_real_symm_sparse_eigensystem_init (f12fac)).
On entry: the array comm output by the preceding call to nag_real_symm_sparse_eigensystem_iter (f12fbc).

None.

## 7  Accuracy

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

None.

## 9  Example

This example solves $Kx=\lambda {K}_{G}x$ using the ${\mathbf{Buckling}}$ option (see nag_real_symm_sparse_eigensystem_option (f12fdc), where $K$ and ${K}_{G}$ are obtained by the finite element method applied to the one-dimensional discrete Laplacian operator $\frac{{\partial }^{2}u}{\partial {x}^{2}}$ on $\left[0,1\right]$, with zero Dirichlet boundary conditions using piecewise linear elements. The shift, $\sigma$, is a real number, and the operator used in the Buckling iterative process is $\mathrm{OP}=\text{inv}\left(K-\sigma {K}_{G}\right)×K$ and $B=K$.

### 9.1  Program Text

Program Text (f12fece.c)

### 9.2  Program Data

Program Data (f12fece.d)

### 9.3  Program Results

Program Results (f12fece.r)