9
Directions: Another New Concept
•program Jacobi;
•config var n : integer = 512;
•         eps : float = 0.00001;
•
•region     R = [1..n, 1..n];
•        BigR = [0..n+1,0..n+1];
•direction  N = [-1, 0];  S = [ 1, 0];
•           E = [ 0, 1];  W = [ 0,-1];
•var     Temp : [R] float;
•           A : [BigR] float;
•         err : float;
•
•procedure Jacobi();
•    [R] begin
• [BigR] A := 0.0;
•[S of R] A := 1.0;
• repeat
•   Temp := (A@N + A@E + A@S + A@W)/4.0;
•   err  := max<< abs(Temp - A);
•   A    := Temp;
• until err < eps;
•   end;
•end;
Directions are vectors pointing in index space … e.g.
    S = [ 1, 0 ]
points to row below