NAG Library Routine Document

F12ABF

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

+− Contents

1 Purpose

F12ABF is an iterative solver used to find some of the eigenvalues (and optionally the corresponding eigenvectors) of a standard or generalized eigenvalue problem defined by real nonsymmetric matrices. This is part of a suite of routines that also includes F12AAF, F12ACF, F12ADF and F12AEF. It is

2 Specification

3 Description

The suite of routines is designed to calculate some of the eigenvalues, λ, (and optionally the corresponding eigenvectors, x) of a standard eigenvalue problem Ax=λx, or of a generalized eigenvalue problem Ax=λBx of order n, where n is large and the coefficient matrices A and B are sparse, real and nonsymmetric. The suite can also be used to find selected eigenvalues/eigenvectors of smaller scale dense, real and nonsymmetric problems.

F12ABF is a reverse communication routine, based on the ARPACK routine dnaupd, using the Implicitly Restarted Arnoldi iteration method. The method is described in Lehoucq and Sorensen (1996) and Lehoucq (2001) while its use within the ARPACK software is described in great detail in Lehoucq et al. (1998). An evaluation of software for computing eigenvalues of sparse nonsymmetric matrices is provided in Lehoucq and Scott (1996). This suite of routines offers the same functionality as the ARPACK software for real nonsymmetric problems, but the interface design is quite different in order to make the option setting clearer and to simplify the interface of F12ABF.

The setup routine F12AAF must be called before F12ABF, the reverse communication iterative solver. Options may be set for F12ABF by prior calls to the option setting routine F12ADF and a post-processing routine F12ACF must be called following a successful final exit from F12ABF. F12AEF, may be called following certain flagged, intermediate exits from F12ABF to provide additional monitoring information about the computation.

F12ABF uses reverse communication, i.e., it returns repeatedly to the calling program with the parameter IREVCM (see Section 5) set to specified values which require the calling program to carry out one of the following tasks:

– compute the matrix-vector product y=OPx, where OP is defined by the computational mode;

– compute the matrix-vector product y=Bx;

– notify the completion of the computation;

– allow the calling program to monitor the solution.

The problem type to be solved (standard or generalized), the spectrum of eigenvalues of interest, the mode used (regular, regular inverse, shifted inverse, shifted real or shifted imaginary) and other options can all be set using the option setting routine F12ADF (see Section 10.1 in F12ADF for details on setting options and of the default settings).

5 Parameters

Note: this routine uses reverse communication. Its use involves an initial entry, intermediate exits and re-entries, and a final exit, as indicated by the parameter IREVCM. Between intermediate exits and re-entries, all parameters other thanX, MX and COMM must remain unchanged.

1: IREVCM – INTEGERInput/Output

On initial entry: IREVCM=0, otherwise an error condition will be raised.

On intermediate re-entry: must be unchanged from its previous exit value. Changing IREVCM to any other value between calls will result in an error.

On intermediate exit:
has the following meanings.

IREVCM=-1

The calling program must compute the matrix-vector product y=OPx, where x is stored in X (by default) or in the array COMM (starting from the location given by the first element of ICOMM) when the option Pointers=YES is set in a prior call to F12ADF. The result y is returned in X (by default) or in the array COMM (starting from the location given by the second element of ICOMM) when the option Pointers=YES is set.

IREVCM=1

The calling program must compute the matrix-vector product y=OPx. This is similar to the case IREVCM=-1 except that the result of the matrix-vector product Bx (as required in some computational modes) has already been computed and is available in MX (by default) or in the array COMM (starting from the location given by the third element of ICOMM) when the option Pointers=YES is set.

IREVCM=2

The calling program must compute the matrix-vector product y=Bx, where x is stored as described in the case IREVCM=-1 and y is returned in the location described by the case IREVCM=1.

IREVCM=3

Compute the NSHIFT real and imaginary parts of the shifts where the real parts are to be returned in the first NSHIFT locations of the array X and the imaginary parts are to be returned in the first NSHIFT locations of the array MX. Only complex conjugate pairs of shifts may be applied and the pairs must be placed in consecutive locations. This value of IREVCM will only arise if the optional parameter Supplied Shifts is set in a prior call to F12ADF which is intended for experienced users only; the default and recommended option is to use exact shifts (see Lehoucq et al. (1998) for details).

IREVCM=4

Monitoring step: a call to F12AEF can now be made to return the number of Arnoldi iterations, the number of converged Ritz values, their real and imaginary parts, and the corresponding Ritz estimates.

On final exit: IREVCM=5: F12ABF has completed its tasks. The value of IFAIL determines whether the iteration has been successfully completed, or whether errors have been detected. On successful completion F12ACF must be called to return the requested eigenvalues and eigenvectors (and/or Schur vectors).

If Pointers=NO, MX contains the vector Bx when IREVCM returns the value +1.

On final exit: does not contain any useful data.

7: NSHIFT – INTEGEROutput

On intermediate exit:
if the option Supplied Shifts is set and IREVCM returns a value of 3, NSHIFT returns the number of complex shifts required.

8: COMM(*) – REAL (KIND=nag_wp) arrayCommunication Array

Note: the dimension of the array COMM
must be at least
max1,LCOMM (see F12AAF).

On initial entry: must remain unchanged following a call to the setup routine F12AAF.

On exit: contains data defining the current state of the iterative process.

9: ICOMM(*) – INTEGER arrayCommunication Array

Note: the dimension of the array ICOMM
must be at least
max1,LICOMM (see F12AAF).

On initial entry: must remain unchanged following a call to the setup routine F12AAF.

On exit: contains data defining the current state of the iterative process.

10: IFAIL – INTEGERInput/Output

On initial entry: IFAIL must be set to 0, -1​ 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​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if IFAIL≠0 on exit, the recommended value is -1. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.

On final exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry 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:

IFAIL=1

On initial entry, the maximum number of iterations ≤0, the option Iteration Limit has been set to a non-positive value.

The maximum number of iterations has been reached. Some Ritz values may have converged; a subsequent call to F12ACF will return the number of converged values and the converged values.

IFAIL=5

No shifts could be applied during a cycle of the implicitly restarted Arnoldi iteration. One possibility is to increase the size of NCV relative to NEV (see Section 5 in F12AAF for details of these parameters).

IFAIL=6

Could not build an Arnoldi factorization. Consider changing NCV or NEV in the initialization routine (see Section 5 in F12AAF for details of these parameters).

7 Accuracy

The relative accuracy of a Ritz value, λ, is considered acceptable if its Ritz estimate ≤Tolerance×λ. The default Tolerance used is the machine precision given by X02AJF.

8 Further Comments

None.

9 Example

This example solves Ax=λx in shift-invert mode, where A is obtained from the standard central difference discretization of the convection-diffusion operator ∂2u∂x2+∂2u∂y2+ρ∂u∂x on the unit square, with zero Dirichlet boundary conditions. The shift used is a real number.