The number of Jacobi sweeps for a diagonally dominant matrix full
This proof shows: sweeps.worst, time.worst.
Exact arithmetic. Assume A is strictly row diagonally dominant, so q=∥GJ∥∞<1 (Theorem 3 of the correctness proof), and let 0<ε<1.
Claim. After k∗=⌈ln(1/ε)/ln(1/q)⌉ sweeps, ∥ek∗∥∞≤ε∥e0∥∞. (If q=0, one sweep gives e1=0.)
Proof. By Theorem 3, ∥ek∥∞≤qk∥e0∥∞. For 0<q<1, qk≤ε is equivalent to kln(1/q)≥ln(1/ε), which holds for k=k∗. □
Cost per sweep. For each row i with zi nonzeros (diagonal included), line L3 does zi−1 multiplications and zi−2 additions, line L4 two subtractions and a multiplication, and line L8 a subtraction and a division. That is 2zi+3 flops, so 2z+3n=O(z) per sweep since z≥n, plus n comparisons for the norm in line L5. Each nonzero of A is read once per sweep. With k∗ sweeps the time is O(zln(1/ε)/ln(1/q)). The extra storage is the vectors s and r, that is Θ(n). □
■
Convergence and rounding error of the Jacobi method full
This proof shows: correctness, termination.
Notation of the page: A=D+L+U with aii=0, G=GJ=−D−1(L+U)=I−D−1A, c=D−1b, q=∥G∥∞. Line L8 of the pseudocode computes xk+1=Gxk+c, since (bi−si)/aii=ci+(Gxk)i.
Lemma 1 (fixed point). Ax=b if and only if x=Gx+c.
Proof. x=Gx+c⟺Dx=−(L+U)x+b⟺(D+L+U)x=b. □
Theorem 1 (error recursion). If Ax=b then ek=x−xk satisfies ek=Gke0.
Proof. Subtract xk+1=Gxk+c from x=Gx+c: ek+1=Gek. Induct on k. □
Theorem 2 (convergence criterion). xk→x for every x0 if and only if ρ(G)<1.
Proof. By Theorem 1, convergence for every x0 means Gkv→0 for every v, that is Gk→0. If ρ(G)<1, then for any δ>0 there is a norm with ∥G∥≤ρ(G)+δ (Horn and Johnson, Lemma 5.6.10); with δ=(1−ρ(G))/2 this gives ∥Gk∥≤∥G∥k→0. If ρ(G)≥1, take an eigenpair Gv=λv with ∣λ∣≥1 and v=0. If λ is real, v can be taken real, and e0=v gives ∥ek∥=∣λ∣k∥v∥→0. If λ is not real, v=v1+iv2 with v1,v2 real, and Gkv1,Gkv2 cannot both tend to 0, since then Gkv=λkv would too. □
Theorem 3 (diagonal dominance). If ∑j=i∣aij∣<∣aii∣ for every i, then q<1 and ∥ek∥∞≤qk∥e0∥∞. In particular A is nonsingular and xk→x.
Proof. ∥G∥∞=maxi∑j=i∣aij∣/∣aii∣<1. If Av=0, Lemma 1 with b=0 gives v=Gv, so ∥v∥∞≤q∥v∥∞ and v=0. Theorem 1 then gives ∥ek∥∞≤∥G∥∞k∥e0∥∞. □
Theorem 4 (rounding). Assume the floating point model fl(a∘b)=(a∘b)(1+δ) with ∣δ∣≤u, with no underflow or overflow, and mu<1 for m=n+1. Let A be strictly row diagonally dominant, Ax=b, and suppose p=q(1+γn+1)<1. Let x^k be the iterates that the pseudocode computes in floating point, with si summed in any order. Then for all k≥0
∥x−x^k∥∞≤pk∥x−x^0∥∞+1−pγn+1(1+2q)∥x∥∞. Proof. Fix k and i, and write y=x^k. Line L3 computes s^i=∑j=iaijyj(1+θj), where 1+θj is a product of at most n−1 factors (1+δ)±1: one for the multiplication and at most n−2 for the additions. Line L8 then rounds a subtraction and a division, so
x^k+1,i=aiibi(1+η0)−∑j=iaijyj(1+ηj), where each 1+ηj is a product of at most n+1 factors (1+δ)±1. By Higham, Lemma 3.1, ∣ηj∣≤γn+1. Hence x^k+1=Gy+c+ξk with
∣ξk,i∣≤γn+1(∣ci∣+j=i∑∣aii∣∣aij∣∣yj∣),∥ξk∥∞≤γn+1(∥c∥∞+q∥y∥∞). Since x=Gx+c, the error e^k=x−x^k satisfies e^k+1=Ge^k−ξk. Also c=(I−G)x gives ∥c∥∞≤(1+q)∥x∥∞, and ∥y∥∞≤∥x∥∞+∥e^k∥∞. So
∥e^k+1∥∞≤q∥e^k∥∞+γn+1((1+q)∥x∥∞+q∥x∥∞+q∥e^k∥∞)=p∥e^k∥∞+β, with β=γn+1(1+2q)∥x∥∞. By induction, ∥e^k∥∞≤pk∥e^0∥∞+β(1+p+⋯+pk−1)≤pk∥e^0∥∞+β/(1−p). □
Theorem 5 (termination and output). The pseudocode stops after at most kmax+1 executions of lines L2 to L4 and kmax sweeps. If it returns CONVERGED, then the vector r that it computed for the returned x in line L4 satisfies ∥r∥∞≤tol⋅∥b∥∞.
Proof. The outer loop runs over k=0,…,kmax, and line L6 returns at k=kmax at the latest. Line L5 is the only place that returns CONVERGED, and it tests exactly this inequality for the current x, which lines L2 to L4 used. Line L8 changes x only after the test. □
■