# NAG CL Interfacef12jfc (feast_​gen_​contour)

Settings help

CL Name Style:

## 1Purpose

f12jfc is a setup function in a suite of functions consisting of f12jac, f12jbc, f12jfc, 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 f12jfc. In addition calls to f12jbc can be made to supply individual optional parameters to f12jfc.
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.

## 2Specification

 #include
 void f12jfc (void *handle, Complex emid, double r, NagError *fail)
The function may be called by the names: f12jfc or nag_sparseig_feast_gen_contour.

## 3Description

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.
f12jfc is used to specify a circle or ellipse in the complex plane within which eigenvalues will be sought. By default, a circle centred at $\mathit{emid}$ with a radius of $r$ is created. Optionally, f12jbc can be called prior to calling f12jfc, using the optional parameters ${\mathbf{Ellipse Contour Ratio}}$ and ${\mathbf{Ellipse Rotation Angle}}$ to change the eccentricity of the ellipse and the inclination angle of its axis. f12jfc uses these details to define nodes and weights for the elliptical contour, to be used by the solvers f12jkc, f12jsc, f12jtc, f12juc or f12jvc.
For details of the other options available and how to set them see Section 11.1 in f12jbc.

## 4References

Polizzi E (2009) Density-Matrix-Based Algorithms for Solving Eigenvalue Problems Phys. Rev. B. 79 115112

## 5Arguments

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{emid}$Complex Input
On entry: the centre of the ellipse.
3: $\mathbf{r}$double Input
On entry: the radius of the horizontal axis of the ellipse (that is, the axis that would be horizontal if the rotation angle of the ellipse was set to zero).
Constraint: ${\mathbf{r}}>0.0$.
4: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error 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_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_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_OPTION
An invalid number of integration points was specified. For Gauss integration, the values permitted are $2$$40$ (even values only), $48$, $64$, $80$, $96$, $112$.
The option ${\mathbf{Integration Type}}$ was set to $\mathrm{Zol}$. For non-Hermitian eigenvalue problems the allowed values are $\mathrm{Gauss}$ or $\mathrm{Trap}$.
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.
NE_REAL
On entry, ${\mathbf{r}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{r}}>0.0$.

Not applicable.