## File: Iterating-the-Sparse-Linear-System.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (132 lines) | stat: -rw-r--r-- 7,231 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132  GNU Scientific Library – Reference Manual: Iterating the Sparse Linear System

43.2.3 Iterating the Sparse Linear System

The following functions are provided to allocate storage for the sparse linear solvers and iterate the system to a solution.

Function: gsl_splinalg_itersolve * gsl_splinalg_itersolve_alloc (const gsl_splinalg_itersolve_type * T, const size_t n, const size_t m)

This function allocates a workspace for the iterative solution of n-by-n sparse matrix systems. The iterative solver type is specified by T. The argument m specifies the size of the solution candidate subspace {\cal K}_m. The dimension m may be set to 0 in which case a reasonable default value is used.

Function: void gsl_splinalg_itersolve_free (gsl_splinalg_itersolve * w)

This function frees the memory associated with the workspace w.

Function: const char * gsl_splinalg_itersolve_name (const gsl_splinalg_itersolve * w)

This function returns a string pointer to the name of the solver.

Function: int gsl_splinalg_itersolve_iterate (const gsl_spmatrix *A, const gsl_vector *b, const double tol, gsl_vector *x, gsl_splinalg_itersolve *w)

This function performs one iteration of the iterative method for the sparse linear system specfied by the matrix A, right hand side vector b and solution vector x. On input, x must be set to an initial guess for the solution. On output, x is updated to give the current solution estimate. The parameter tol specifies the relative tolerance between the residual norm and norm of b in order to check for convergence. When the following condition is satisfied:

|| A x - b || <= tol * || b ||

the method has converged, the function returns GSL_SUCCESS and the final solution is provided in x. Otherwise, the function returns GSL_CONTINUE to signal that more iterations are required. Here, || \cdot || represents the Euclidean norm. The input matrix A may be in triplet or compressed column format.

Function: double gsl_splinalg_itersolve_normr (const gsl_splinalg_itersolve *w)

This function returns the current residual norm ||r|| = ||A x - b||, which is updated after each call to gsl_splinalg_itersolve_iterate.