# naginterfaces.library.sparse.complex_​herm_​solve_​jacssor¶

naginterfaces.library.sparse.complex_herm_solve_jacssor(method, precon, a, irow, icol, omega, b, tol, maxitn, x)[source]

complex_herm_solve_jacssor solves a complex sparse Hermitian system of linear equations, represented in symmetric coordinate storage format, using a conjugate gradient or Lanczos method, without preconditioning, with Jacobi or with SSOR preconditioning.

For full information please refer to the NAG Library document for f11js

https://www.nag.com/numeric/nl/nagdoc_28.7/flhtml/f11/f11jsf.html

Parameters
methodstr

Specifies the iterative method to be used.

Lanczos method (SYMMLQ).

preconstr, length 1

Specifies the type of preconditioning to be used.

No preconditioning.

Jacobi.

Symmetric successive-over-relaxation (SSOR).

acomplex, array-like, shape

The nonzero elements of the lower triangular part of the matrix , ordered by increasing row index, and by increasing column index within each row. Multiple entries for the same row and column indices are not permitted. The function complex_herm_sort() may be used to order the elements in this way.

irowint, array-like, shape

The row indices of the nonzero elements supplied in array .

icolint, array-like, shape

The column indices of the nonzero elements supplied in array .

omegafloat

If , is the relaxation parameter to be used in the SSOR method. Otherwise need not be initialized.

bcomplex, array-like, shape

The right-hand side vector .

tolfloat

The required tolerance. Let denote the approximate solution at iteration , and the corresponding residual. The algorithm is considered to have converged at iteration if

If , is used, where is the machine precision. Otherwise is used.

maxitnint

The maximum number of iterations allowed.

xcomplex, array-like, shape

An initial approximation to the solution vector .

Returns
xcomplex, ndarray, shape

An improved approximation to the solution vector .

rnormfloat

The final value of the residual norm , where is the output value of .

itnint

The number of iterations carried out.

rdiagfloat, ndarray, shape

The elements of the diagonal matrix , where is the diagonal part of . Note that since is Hermitian the elements of are necessarily real.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, or : .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , or : .

(errno )

On entry, and .

Constraint:

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, the location () is a duplicate: .

(errno )

On entry, is out of order: .

(errno )

On entry, , and .

Constraint: and .

(errno )

On entry, , and .

Constraint: and .

(errno )

The matrix has a zero diagonal entry in row .

(errno )

The matrix has no diagonal entry in row .

(errno )

The required accuracy could not be obtained. However, a reasonable accuracy has been achieved and further iterations could not improve the result.

(errno )

The solution has not converged after iterations.

(errno )

The preconditioner appears not to be positive definite. The computation cannot continue.

(errno )

The matrix of the coefficients appears not to be positive definite. The computation cannot continue.

(errno )

A serious error, code , has occurred in an internal call. Check all function calls and array sizes. Seek expert help.

(errno )

The matrix has a non-real diagonal entry in row .

Notes

complex_herm_solve_jacssor solves a complex sparse Hermitian linear system of equations

using a preconditioned conjugate gradient method (see Barrett et al. (1994)), or a preconditioned Lanczos method based on the algorithm SYMMLQ (see Paige and Saunders (1975)). The conjugate gradient method is more efficient if is positive definite, but may fail to converge for indefinite matrices. In this case the Lanczos method should be used instead. For further details see Barrett et al. (1994).

complex_herm_solve_jacssor allows the following choices for the preconditioner:

• no preconditioning;

• Jacobi preconditioning (see Young (1971));

• symmetric successive-over-relaxation (SSOR) preconditioning (see Young (1971)).

For incomplete Cholesky (IC) preconditioning see complex_herm_solve_ilu().

The matrix is represented in symmetric coordinate storage (SCS) format (see the F11 Introduction) in the arrays , and . The array holds the nonzero entries in the lower triangular part of the matrix, while and hold the corresponding row and column indices.

References

Barrett, R, Berry, M, Chan, T F, Demmel, J, Donato, J, Dongarra, J, Eijkhout, V, Pozo, R, Romine, C and Van der Vorst, H, 1994, Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM, Philadelphia

Paige, C C and Saunders, M A, 1975, Solution of sparse indefinite systems of linear equations, SIAM J. Numer. Anal. (12), 617–629

Young, D, 1971, Iterative Solution of Large Linear Systems, Academic Press, New York