1 function [x,it]=rb_line_gs_solve(K,F,X)
2 % x=rb_line_gs_solve(K,F,X)
3 disp('solver red-black relaxation horizontal, lines vertical')
7 error('rb_line_gs_solve: inconsistent sizes')
14 tol = 1e-5*big(F)/big(K);
20 % solving horizontal location i1 i2 and vertical line
21 ix = sub2ind(n,i1*onex,i2*onex,colx);
22 x(ix) = x(ix) - K(ix,ix)\(K(:,ix)'*x - F(ix));
28 fprintf('iteration %g residual %g tolerance %g\n',it,res,tol)