naginterfaces.library.sparse.real_​symm_​solve_​jacssor

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

real_symm_solve_jacssor solves a real sparse symmetric 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 f11je

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f11/f11jef.html

Parameters
methodstr

Specifies the iterative method to be used.

Conjugate gradient method.

Lanczos method (SYMMLQ).

preconstr, length 1

Specifies the type of preconditioning to be used.

No preconditioning.

Jacobi.

Symmetric successive-over-relaxation (SSOR).

afloat, 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 real_symm_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.

bfloat, 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.

xfloat, array-like, shape

An initial approximation to the solution vector .

Returns
xfloat, 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.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, .

Constraint: and .

(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.

(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 has occurred in an internal call: . Check all function calls and array sizes. Seek expert help.

(errno )

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

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

real_symm_solve_jacssor solves a real sparse symmetric 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).

The function 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 real_symm_solve_ichol().

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