SSOR with acceleration by CG

275 Views Asked by At

I need to implement SSOR method with acceleration by conjugate gradient method. But I don't understand how we can to combine two iteration methods? Both algorithms solving $Ax=b$.
In book "Applied Iterative Methods", Hageman, Young described Conjugate Gradient Acceleration for Richardson method (p. 146), but I did't understand: how we combined two methods. I don't understand already at the stage which of the methods should be embedded into the other.
I appreciated any help about my questions.

2

There are 2 best solutions below

1
On BEST ANSWER

So, it's turned out to be simple.
Here's matlab code. It's not needed more explanation. Just read "Applied Iterative Methods", Hageman, Young.

 function [ x, err, iter, flag ] = ssor_cg(A, x, b, w, max_it, tol)
    D = diag(diag(A));
    I = eye(size(A));
    C_L = -tril(A, -1);
    C_U = -triu(A, 1);
    W = mpower(A, 1/2);
    Q = w / (2 - w) * (1 / w * D - C_L) * mpower(D, -1) * (1 / w * D - C_U);
    G = I - mpower(Q, -1) * A;
    k = mpower(Q, -1) * b;

    delta = 0;
    p = 0;
    alpha = 0;
    for iter = 0 : max_it
        x_prev = x;
        p_prev = p;
        delta = G * x + k - x;
        delta_prev = delta;

        if iter == 0
            p = delta;
        else 
            p = delta + alpha * p_prev;
        end

        if iter > 0
            alpha = (dot(W * delta, W * delta)) / (dot(W * delta_prev, W * delta_prev));
        end

        lambda = (dot(W * delta, W * delta)) / (dot(W * p, W * (I - G) * p));

        x = x_prev + lambda * p;
        err = norm(x_prev); % compute error
        if (err <= tol) % check for convergence
            break
        end        
    end    
end
1
On

You need to use one method as a preconditioner for the other. My guess would be that you are asked to use SSOR as a preconditioner for CG.