NOTE: If if RVEC = 1 and a Schur basis is not required, the
array Z may be set equal to first NEV+1 columns of the Arnoldi basis
array V computed by ZNAUPD. In this case the Arnoldi basis will be
destroyed and overwritten with the eigenvector basis.

NOTE: If the array Z has been set equal to first NEV+1 columns
of the array V and RVEC = 1 and HOWMANY = 'A', then the Arnoldi basis
held by V has been overwritten by the desired Ritz vectors. If a
separate array Z has been passed then the first NCONV=IPARAM(5)
columns of V will contain approximate Schur vectors that span the
desired invariant subspace.

Note: IPNTR(9:13) contains the pointer into WORKL for
addresses of the above information computed by zneupd.

IPNTR(9): pointer to the NCV RITZ values of the original
system.

IPNTR(10): Not used

IPNTR(11): pointer to the NCV corresponding error
estimates.

IPNTR(12): pointer to the NCV by NCV upper triangular
Schur matrix for H.

IPNTR(13): pointer to the NCV by NCV matrix of
eigenvectors of the upper Hessenberg matrix H. Only referenced
by zneupd if RVEC = 1 See Remark 2 below.

INFO

Integer. (OUTPUT)

Error flag on output.

0: Normal exit.

1: The Schur form computed by LAPACK routine csheqr could
not be reordered by LAPACK routine ztrsen. Re-enter subroutine
zneupd with IPARAM(5) = NCV and increase the size of the array D
to have dimension at least dimension NCV and allocate at least
NCV columns for Z.

NOTE: Not necessary if Z and V share the same space.
Please notify the authors if this error occurs.

-1: N must be positive.

-2: NEV must be positive.

-3: NCV-NEV >= 1 and less than or equal to N.

-5: WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI',
'SI'.

-6: BMAT must be one of 'I' or 'G'.

-7: Length of private work WORKL array is not
sufficient.

-8: Error return from LAPACK eigenvalue calculation. This
should never happened.

-15: ZNEUPD got a different count of the number of
converged Ritz values than ZNAUPD got. This indicates the user
probably made an error in passing data from ZNAUPD to ZNEUPD or
that the data was modified before entering ZNEUPD.

Description

This subroutine returns the converged approximations to eigenvalues
of A * z = lambda * B * z and (optionally):

The corresponding approximate eigenvectors;

An orthonormal basis for the associated approximate invariant
subspace;

Both.

There is negligible additional cost to obtain eigenvectors. An
orthonormal basis is always computed.

There is an additional storage cost of n*nev if both are requested
(in this case a separate array Z must be supplied).

The approximate eigenvalues and eigenvectors of A * z = lambda * B * z are
derived from approximate eigenvalues and eigenvectors of of the linear
operator OP prescribed by the MODE selection in the call to ZNAUPD.

ZNAUPD must be called before this routine is called.

These approximate eigenvalues and vectors are commonly called Ritz
values and Ritz vectors respectively. They are referred to as such in the
comments that follow.

The computed orthonormal basis for the invariant subspace
corresponding to these Ritz values is referred to as a Schur basis.

The definition of OP as well as other terms and the relation of
computed Ritz values and vectors of OP with respect to the given problem
A*z = lambda*B*z may be found in the header of ZNAUPD. For a brief
description, see definitions of IPARAM(7), MODE and WHICH in the
documentation of ZNAUPD.

Remarks

Currently only HOWMNY = 'A' and 'P' are implemented.

Schur vectors are an orthogonal representation for the basis of
Ritz vectors. Thus, their numerical properties are often superior.

If RVEC = 1 then the relationship

A * V(:,1:IPARAM(5)) = V(:,1:IPARAM(5)) * T,

and

transpose( V(:,1:IPARAM(5)) ) * V(:,1:IPARAM(5)) = I

are approximately satisfied. Here T is the leading submatrix of
order IPARAM(5) of the upper triangular matrix stored
workl(ipntr(12)).

Example

// The following sets dimensions for this problem.nx=10;nev=3;ncv=6;bmat='I';which='LM';// Local Arraysiparam=zeros(11,1);ipntr=zeros(14,1);_select=zeros(ncv,1);d=zeros(nev+1,1)+0*%i;z=zeros(nx,nev)+0*%i;resid=zeros(nx,1)+0*%i;v=zeros(nx,ncv)+0*%i;workd=zeros(3*nx,1)+0*%i;workev=zeros(2*ncv,1)+0*%i;rwork=zeros(ncv,1);workl=zeros(3*ncv*ncv+5*ncv,1)+0*%i;// Build the complex test matrixA=diag(10*ones(nx,1)+%i*ones(nx,1));A(1:$-1,2:$)=A(1:$-1,2:$)+diag(6*ones(nx-1,1));A(2:$,1:$-1)=A(2:$,1:$-1)+diag(-6*ones(nx-1,1));tol=0;ido=0;ishfts=1;maxitr=300;mode1=1;iparam(1)=ishfts;iparam(3)=maxitr;iparam(7)=mode1;sigma=complex(0);info_znaupd=0;// M A I N L O O P (Reverse communication)while(ido<>99)// Repeatedly call the routine ZNAUPD and take actions indicated by parameter IDO until// either convergence is indicated or maxitr has been exceeded.[ido,resid,v,iparam,ipntr,workd,workl,rwork,info_znaupd]=znaupd(ido,bmat,nx,which,nev,tol,resid,ncv,v,iparam,ipntr,workd,workl,rwork,info_znaupd);if(info_znaupd<0)printf('\nError with znaupd, info = %d\n',info_znaupd);printf('Check the documentation of znaupd\n\n');endif(ido==-1|ido==1)// Perform matrix vector multiplicationworkd(ipntr(2):ipntr(2)+nx-1)=A*workd(ipntr(1):ipntr(1)+nx-1);endend// Post-Process using ZNEUPD.rvec=1;howmany='A';info_zneupd=0;[d,z,resid,iparam,ipntr,workd,workl,rwork,info_zneupd]=zneupd(rvec,howmany,_select,d,z,sigma,workev,bmat,nx,which,nev,tol,resid,ncv,v,...iparam,ipntr,workd,workl,rwork,info_zneupd);if(info_zneupd<0)printf('\nError with zneupd, info = %d\n',info_zneupd);printf('Check the documentation of zneupd.\n\n');end// Done with program znsimp.printf('\nZNSIMP\n');printf('======\n');printf('\n');printf('Size of the matrix is %d\n',nx);printf('The number of Ritz values requested is %d\n',nev);printf('The number of Arnoldi vectors generated (NCV) is %d\n',ncv);printf('What portion of the spectrum: %s\n',which);printf('The number of Implicit Arnoldi update iterations taken is %d\n',iparam(3));printf('The number of OP*x is %d\n',iparam(9));printf('The convergence criterion is %d\n',tol);

See Also

znaupd — Interface for the Implicitly Restarted Arnoldi Iteration, to
compute approximations to a few eigenpairs of a real linear
operator
This function is obsolete. Please use eigs

dnaupd — Interface for the Implicitly Restarted Arnoldi Iteration, to
compute approximations to a few eigenpairs of a real linear
operator
This function is obsolete. Please use eigs

dneupd — Interface for the Implicitly Restarted Arnoldi Iteration, to
compute approximations to a few eigenpairs of a real linear
operator
This function is obsolete. Please use eigs