Matlab Database > Linear Algebra > Iterative Solvers > PCG with Jacobi/Gauss-Seidel

Matlab File(s)

Title: PCG with Jacobi/Gauss-Seidel
Author: Andreas Klimke
Institution: Technische Universität München
Description: This implementation of the PCG method has only a couple of lines compared to Matlab's pcg function, and was written for teaching purposes. It runs slightly faster than the Matlab function due to its reduced functionality.

Input parameters:
  • A: symmetric, positive definite NxN matrix
  • f: right-hand side Nx1 vector
  • u_s: Nx1 start vector (initial guess)
  • C: preconditioner C = C1*C2. Splitting C in C1 and C2 offers computational advantages.

    Example (symmetric Gauss-Seidel preconditioner C):
        % GS-Preconditioner: C = (D+L)*inv(D)*(D+L')
        D  = diag(diag(A))
        C1 = tril(A) 
        C2 = inv(D)*triu(A)     
  • tol: break condition for the relative residuum
  • m_max: maximum number of iterations to be performed

Output parameters:
  • m: number of iterations performed
  • u: solution vector

Keywords: pcg, iterative solvers
File Name:
File Size: 2 KB
File Version: 1.1
Matlab Version: 6.1
Date: 2003-05-13
Downloads: 8576
Download File

Upload your own files today! Click here for more information.