一、 SSOR 迭代法
SSOR迭代法的迭代格式为
对应的MATLAB代码为
function [x,k,error,time]=myssor(A,b,x,w,tol,max_it)
%% SSOR迭代算法
%% To solve the equation Ax=b;
%% Iterative formula : (D-wL)x_(k+1)=((1-w)D+wU)x_k+wb; (D-wU)x_(k+1)=((1-w)D+wL)x_k+wb;
% A: input matrix; b:right vector
% x: initial vector;
% max_it : the maximum number of iterations;
% tol : Accuracy;
% w : relaxation factor;
% k : number of iterations at termination;
% error : the