naginterfaces.library.sparseig.real_band_solve¶
- naginterfaces.library.sparseig.real_band_solve(kl, ku, ab, mb, sigmar, sigmai, resid, comm, io_manager=None)[source]¶
real_band_solve
is the main solver function in a suite of functions consisting ofreal_option()
,real_band_init()
andreal_band_solve
. It must be called following an initial call toreal_band_init()
and following any calls toreal_option()
.real_band_solve
returns approximations to selected eigenvalues, and (optionally) the corresponding eigenvectors, of a standard or generalized eigenvalue problem defined by real banded nonsymmetric matrices. The banded matrix must be stored using the LAPACK storage format for real banded nonsymmetric matrices.For full information please refer to the NAG Library document for f12ag
https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/f12/f12agf.html
- Parameters
- klint
The number of subdiagonals of the matrices and .
- kuint
The number of superdiagonals of the matrices and .
- abfloat, array-like, shape
Must contain the matrix in LAPACK banded storage format for nonsymmetric matrices (see the F07 Introduction).
- mbfloat, array-like, shape
Must contain the matrix in LAPACK banded storage format for nonsymmetric matrices (see the F07 Introduction).
- sigmarfloat
If one of the ‘Shifted Inverse Real’ modes (see
real_option()
) have been selected then must contain the real part of the shift used; otherwise is not referenced. the F12 Introduction describes the use of shift and inverse transformations.- sigmaifloat
If one of the ‘Shifted Inverse Real’ modes (see
real_option()
) have been selected then must contain the imaginary part of the shift used; otherwise is not referenced. the F12 Introduction describes the use of shift and inverse transformations.- residfloat, array-like, shape
Need not be set unless the option ‘Initial Residual’ has been set in a prior call to
real_option()
in which case must contain an initial residual vector.- commdict, communication object, modified in place
Communication structure.
This argument must have been initialized by a prior call to
real_band_init()
.- io_managerFileObjManager, optional
Manager for I/O in this routine.
- Returns
- nconvint
The number of converged eigenvalues.
- drfloat, ndarray, shape
The first locations of the array contain the real parts of the converged approximate eigenvalues. The number of eigenvalues returned may be one more than the number requested by since complex values occur as conjugate pairs and the second in the pair can be returned in position of the array.
- difloat, ndarray, shape
The first locations of the array contain the imaginary parts of the converged approximate eigenvalues. The number of eigenvalues returned may be one more than the number requested by since complex values occur as conjugate pairs and the second in the pair can be returned in position of the array.
- zfloat, ndarray, shape
If the default option has been selected then contains the final set of eigenvectors corresponding to the eigenvalues held in and . The complex eigenvector associated with the eigenvalue with positive imaginary part is stored in two consecutive columns. The first column holds the real part of the eigenvector and the second column holds the imaginary part. The eigenvector associated with the eigenvalue with negative imaginary part is simply the complex conjugate of the eigenvector associated with the positive imaginary part.
- residfloat, ndarray, shape
Contains the final residual vector.
- vfloat, ndarray, shape
If the option or (see
real_option()
) then the first elements of will contain approximate Schur vectors that span the desired invariant subspace.The th Schur vector is stored in the th column of .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , .
Constraint: .
- (errno )
The option ‘Shifted Inverse Imaginary’ has been selected and zero on entry; must be nonzero for this mode of operation.
- (errno )
The maximum number of iterations , the option ‘Iteration Limit’ has been set to .
- (errno )
The options ‘Generalized’ and ‘Regular’ are incompatible.
- (errno )
The option ‘Initial Residual’ was selected but the starting vector held in is zero.
- (errno )
Either the initialization function has not been called prior to the first call of this function or a communication array has become corrupted.
- (errno )
On entry, , but this is not yet implemented.
- (errno )
The number of eigenvalues found to sufficient accuracy is zero.
- (errno )
Could not build an Arnoldi factorization. The size of the current Arnoldi factorization .
- (errno )
Error in internal call to compute eigenvalues and corresponding error bounds of the current upper Hessenberg matrix. Please contact NAG.
- (errno )
During calculation of a real Schur form, there was a failure to compute a number of eigenvalues. Please contact NAG.
- (errno )
The computed Schur form could not be reordered by an internal call. Please contact NAG.
- (errno )
Error in internal call to compute eigenvectors. Please contact NAG.
- (errno )
Failure during internal factorization of real banded matrix. Please contact NAG.
- (errno )
Failure during internal solution of real banded matrix. Please contact NAG.
- (errno )
Failure during internal factorization of complex banded matrix. Please contact NAG.
- (errno )
Failure during internal solution of complex banded matrix. Please contact NAG.
- (errno )
The maximum number of iterations has been reached. The maximum number of . The number of converged eigenvalues .
- (errno )
No shifts could be applied during a cycle of the implicitly restarted Lanczos iteration.
- (errno )
Overflow occurred during transformation of Ritz values to those of the original problem.
- Notes
The suite of functions is designed to calculate some of the eigenvalues, , (and optionally the corresponding eigenvectors, ) of a standard eigenvalue problem , or of a generalized eigenvalue problem of order , where is large and the coefficient matrices and are banded, real and nonsymmetric.
Following a call to the initialization function
real_band_init()
,real_band_solve
returns the converged approximations to eigenvalues and (optionally) the corresponding approximate eigenvectors and/or an orthonormal basis for the associated approximate invariant subspace. The eigenvalues (and eigenvectors) are selected from those of a standard or generalized eigenvalue problem defined by real banded nonsymmetric matrices. There is negligible additional computational cost to obtain eigenvectors; an orthonormal basis is always computed, but there is an additional storage cost if both are requested.The banded matrices and must be stored using the LAPACK column ordered storage format for banded nonsymmetric matrices; please refer to the F07 Introduction for details on this storage format.
real_band_solve
is based on the banded driver functions dnbdr1 to dnbdr6 from the ARPACK package, which uses 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 functions offers the same functionality as the ARPACK banded driver software for real nonsymmetric problems, but the interface design is quite different in order to make the option setting clearer and to combine the different drivers into a general purpose function.real_band_solve
, is a general purpose function that must be called following initialization byreal_band_init()
.real_band_solve
uses options, set either by default or explicitly by callingreal_option()
, to return the converged approximations to selected eigenvalues and (optionally):the corresponding approximate eigenvectors;
an orthonormal basis for the associated approximate invariant subspace;
both.
Please note that for ‘Generalized’ problems, the ‘Shifted Inverse Imaginary’, ‘Shifted Inverse Real’ inverse modes are only appropriate if either or is symmetric semidefinite. Otherwise, if or is non-singular, the ‘Standard’ problem can be solved using the matrix (say).
- 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, Philadelphia