NAG Library Routine Document

f12abf  (real_iter)

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 f12adf need not be called. If, however, you wish to reset some or all of the settings please refer to Section 11 in f12adf for a detailed description of the specification of the optional parameters.

 Contents

    1  Purpose
    7  Accuracy

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

Fortran Interface
Subroutine f12abf ( irevcm, resid, v, ldv, x, mx, nshift, comm, icomm, ifail)
Integer, Intent (In):: ldv
Integer, Intent (Inout):: irevcm, icomm(*), ifail
Integer, Intent (Out):: nshift
Real (Kind=nag_wp), Intent (Inout):: resid(*), v(ldv,*), x(*), mx(*), comm(*)
C Header Interface
#include nagmk26.h
void  f12abf_ ( Integer *irevcm, double resid[], double v[], const Integer *ldv, double x[], double mx[], Integer *nshift, double comm[], Integer icomm[], Integer *ifail)

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 argument irevcm (see Section 5) set to specified values which require the calling program to carry out one of the following tasks:
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 11.1 in f12adf for details on setting options and of the default settings).

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

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 argument irevcm. Between intermediate exits and re-entries, all arguments other than x, 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. If B is not symmetric semidefinite then the precomputed values in mx should not be used (see the explanation under irevcm=2).
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. This computation is requested when solving the Generalized problem using either Shifted Inverse Imaginary or Shifted Inverse Real; in these cases B is used as an inner-product space and requires that B be symmetric semidefinite. If neither A nor B is symmetric semidefinite then the problem should be reformulated in a Standard form.
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).
Constraint: on initial entry, irevcm=0; on re-entry irevcm must remain unchanged.
Note: any values you return to f12abf as part of the reverse communication procedure should not include floating-point NaN (Not a Number) or infinity values, since these are not handled by f12abf. If your code inadvertently does return any NaNs or infinities, f12abf is likely to produce unexpected results.
2:     resid* – Real (Kind=nag_wp) arrayInput/Output
Note: the dimension of the array resid must be at least n (see f12aaf).
On initial entry: need not be set unless the option Initial Residual has been set in a prior call to f12adf in which case resid should contain an initial residual vector, possibly from a previous run.
On intermediate re-entry: must be unchanged from its previous exit. Changing resid to any other value between calls may result in an error exit.
On intermediate exit: contains the current residual vector.
On final exit: contains the final residual vector.
3:     vldv* – Real (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array v must be at least max1,ncv (see f12aaf).
On initial entry: need not be set.
On intermediate re-entry: must be unchanged from its previous exit.
On intermediate exit: contains the current set of Arnoldi basis vectors.
On final exit: contains the final set of Arnoldi basis vectors.
4:     ldv – IntegerInput
On entry: the first dimension of the array v as declared in the (sub)program from which f12abf is called.
Constraint: ldvn.
5:     x* – Real (Kind=nag_wp) arrayInput/Output
Note: the dimension of the array x must be at least n if Pointers=NO (default) and at least 1 if Pointers=YES (see f12aaf).
On initial entry: need not be set, it is used as a convenient mechanism for accessing elements of comm.
On intermediate re-entry: if Pointers=YES, x need not be set.
If Pointers=NO, x must contain the result of y=OPx when irevcm returns the value -1 or +1. It must return the real parts of the computed shifts when irevcm returns the value 3.
On intermediate exit: if Pointers=YES, x is not referenced.
If Pointers=NO, x contains the vector x when irevcm returns the value -1 or +1.
On final exit: does not contain useful data.
6:     mx* – Real (Kind=nag_wp) arrayInput/Output
Note: the dimension of the array mx must be at least n if Pointers=NO (default) and at least 1 if Pointers=YES (see f12aaf).
On initial entry: need not be set, it is used as a convenient mechanism for accessing elements of comm.
On intermediate re-entry: if Pointers=YES, mx need not be set.
If Pointers=NO, mx must contain the result of y=Bx when irevcm returns the value 2. It must return the imaginary parts of the computed shifts when irevcm returns the value 3.
On intermediate exit: if Pointers=YES, mx is not referenced.
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 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​ 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 arguments may be useful even if ifail0 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 intermediate exit: the value of ifail is meaningless and should be ignored.
On final exit: (i.e., when irevcm=5) 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.
ifail=2
The options Generalized and Regular are incompatible.
ifail=3
The option Initial Residual was selected but the starting vector held in resid is zero.
ifail=4
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 arguments).
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 arguments).
ifail=7
Unexpected error in internal call to compute eigenvalues and corresponding error bounds of the current upper Hessenberg matrix. Please contact NAG.
ifail=8
Either the initialization routine f12aaf has not been called prior to the first call of this routine or a communication array has become corrupted.
ifail=9
An unexpected error has occurred. Please contact NAG.
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.
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

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
Parallelism and Performance

f12abf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f12abf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9
Further Comments

None.

10
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.

10.1
Program Text

Program Text (f12abfe.f90)

10.2
Program Data

Program Data (f12abfe.d)

10.3
Program Results

Program Results (f12abfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017