NAG CL Interface
f12jgc (feast_custom_contour)
1
Purpose
f12jgc is a setup function in a suite of functions consisting of
f12jac,
f12jbc,
f12jgc,
f12jkc,
f12jsc,
f12jtc,
f12juc and
f12jvc. It is used to find some of the eigenvalues, and the corresponding eigenvectors, of a standard, generalized or polynomial eigenvalue problem. The initialization function
f12jac must have been called prior to calling
f12jgc. In addition calls to
f12jbc can be made to supply individual optional parameters to
f12jgc.
The suite of functions is suitable for the solution of large sparse eigenproblems where only a few eigenvalues from a selected range of the spectrum are required.
2
Specification
The function may be called by the names: f12jgc or nag_sparseig_feast_custom_contour.
3
Description
The suite of functions is designed to calculate some of the eigenvalues, $\lambda $, and the corresponding eigenvectors, $x$, of a standard eigenvalue problem $Ax=\lambda x$, a generalized eigenvalue problem $Ax=\lambda Bx$, or a polynomial eigenvalue problem ${\sum}_{i}{\lambda}^{i}{A}_{i}x=0$, where the coefficient matrices are large and sparse. The suite can also be used to find selected eigenvalues/eigenvectors of smaller scale dense problems.
f12jgc is used to specify a closed contour in the complex plane within which eigenvalues will be sought. The contour can be made up of a combination of line segments and half ellipses.
f12jgc uses this information to create a polygonal representation of the contour and to then define the integration nodes and weights to be used by the solvers
f12jkc,
f12jsc,
f12jtc,
f12juc or
f12jvc.
The arrays
zedge,
tedge and
nedge are used to define the geometry of your contour. Each array is of size
ccn, where
ccn is the number of pieces that make up the contour. The entries in
zedge specify the endpoints in the complex plane of each piece of the contour. The entries in
tedge specify whether each piece of the contour is a line segment or a half ellipse. Finally, entries in
nedge specify the number of integration points to use for each piece of the contour. See the individual argument descriptions in
Section 5 for further details.
Prior to calling
f12jgc, the option setting function
f12jbc can be called to specify various optional parameters for the solution of the eigenproblem. For details of the options available and how to set them see
Section 11.1 in
f12jbc.
4
References
Polizzi E (2009) DensityMatrixBased Algorithms for Solving Eigenvalue Problems Phys. Rev. B. 79 115112
5
Arguments

1:
$\mathbf{handle}$ – void *
Input

On entry: the handle to the internal data structure used by the NAG FEAST suite. It needs to be initialized by
f12jac.
It must not be changed between calls to the NAG FEAST suite.

2:
$\mathbf{ccn}$ – Integer
Input

On entry: the number of pieces that make up the contour.
Constraint:
${\mathbf{ccn}}>1$.

3:
$\mathbf{nedge}\left[{\mathbf{ccn}}\right]$ – const Integer
Input

On entry: ${\mathbf{nedge}}\left[i1\right]$ specifies how many integration nodes and weights f12jgc should use for the $i$th piece of the contour.
Constraint:
${\mathbf{nedge}}\left[\mathit{i}1\right]>0$, for $\mathit{i}=1,2,\dots ,{\mathbf{ccn}}$.

4:
$\mathbf{tedge}\left[{\mathbf{ccn}}\right]$ – const Integer
Input

On entry:
${\mathbf{tedge}}\left[i1\right]$ specifies what shape the
$i$th piece of the contour should be.
 ${\mathbf{tedge}}\left[i1\right]=0$
 The $i$th piece of the contour is straight.
 ${\mathbf{tedge}}\left[i1\right]>0$
 The $i$th piece of the contour is a (convex) halfellipse, with ${\mathbf{tedge}}\left[i1\right]/100=a/b$, where $a$ is the primary radius from the endpoints of the piece, and $b$ is the radius perpendicular to this. Thus, if ${\mathbf{tedge}}\left[i1\right]=100$, then the $i$th piece of the contour is a semicircle.
Constraint:
${\mathbf{tedge}}\left[\mathit{i}1\right]\ge 0$, for $\mathit{i}=1,2,\dots ,{\mathbf{ccn}}$.

5:
$\mathbf{zedge}\left[{\mathbf{ccn}}\right]$ – const Complex
Input

On entry:
zedge specifies the endpoints of the contour piece.
The $i$th piece has endpoints at ${\mathbf{zedge}}\left[i1\right]$ and ${\mathbf{zedge}}\left[i\right]$, for $i=1,\dots ,{\mathbf{ccn}}1$.
The last piece has endpoints at ${\mathbf{zedge}}\left[{\mathbf{ccn}}1\right]$ and ${\mathbf{zedge}}\left[0\right]$.
Note: the contour should be described in a clockwise direction..

6:
$\mathbf{fail}$ – NagError *
Input/Output

The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
 NE_ALLOC_FAIL

Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
 NE_BAD_PARAM

On entry, argument $\u27e8\mathit{\text{value}}\u27e9$ had an illegal value.
 NE_HANDLE

The supplied
handle does not define a valid handle to the data structure used by the NAG FEAST suite. It has not been properly initialized or it has been corrupted.
 NE_INT

On entry, ${\mathbf{ccn}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ccn}}>1$.
 NE_INTERNAL_ERROR

An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
 NE_INVALID_ARRAY

On entry, one or more elements of
nedge were less than or equal to zero.
On entry, one or more elements of
tedge were negative.
 NE_NO_LICENCE

Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
f12jgc is not threaded in any implementation.
The contour you specify must be convex and must not selfintersect. f12jgc does not explicitly test for either condition, but if the contour contains concave pieces or selfintersects then spurious eigenvalues may arise and stochastic estimation of the number of eigenvalues within the contour will not be accurate.
9.1
Additional Licensor
Parts of the code for
f12jgc are distributed under the BSD software License. Please refer to
Library Licensors for further details.
10
Example
See the example for
f12jtc.