Flop counts for band storage full
This proof shows: flops.worst, time.worst, space.extra, matvec.worst.
Matvec. Row i has at most p+q+1 stored entries, each costing one multiplication and one addition in line M3. So at most 2n(p+q+1) flops. □
BandLU. At step k let mk=min(p,n−k) and sk=min(q,n−k). Lines L3 and L4 do mk divisions, and lines L5 to L7 do mksk multiplications and mksk subtractions. The total is ∑k=1nmk(2sk+1)≤np(2q+1), and for n≥p+q it is at least (n−p−q)p(2q+1), so it is Θ(npq+np); with the n pivot tests the time is Θ(npq+n). □
Pivoted LU. The same count with sk≤min(p+q,n−k), plus at most p comparisons and p+q+1 swaps per step: at most np(2(p+q)+1) flops, O(np(p+q)+n) time. □
Space. The array ab has p+q+1 rows of length n, and 2p+q+1 for the pivoted factorization, plus the n pivot indices: Θ(n(p+q+1)). □
■
Band LU keeps the band and is backward stable full
This proof shows: correctness, termination.
Indices are 1-based. A is n×n with aij=0 for i−j>p or j−i>q. A(k) is the array after step k−1 of BandLU (A(1)=A). Dense Gaussian elimination without pivoting (GE) computes, at step k, lik=aik(k)/akk(k) for all i>k and aij(k+1)=aij(k)−likakj(k) for all i,j>k.
Lemma 1 (band invariant). For every k, A(k) computed by GE satisfies aij(k)=0 whenever i−j>p or j−i>q.
Proof. Induction on k; k=1 is the hypothesis. Suppose it holds for A(k), and let i,j>k with i−j>p. We need aij(k)−likakj(k)=0. Here aij(k)=0 by the hypothesis. Since j>k, i−k>i−j>p, so aik(k)=0 and lik=0. The case j−i>q is symmetric: aij(k)=0 and, since i>k, j−k>j−i>q, so akj(k)=0. Entries with i≤k or j≤k do not change at step k, except the multipliers lik, which are zero for i>k+p. □
Theorem 1 (BandLU equals GE). If all pivots akk(k) are nonzero, BandLU returns the same L and U as GE, L has lower bandwidth p, U has upper bandwidth q, and A=LU. If some pivot is zero, both fail at the same step.
Proof. At step k, BandLU computes lik for k<i≤min(k+p,n) (lines L3 and L4) and updates aij for k<i≤min(k+p,n), k<j≤min(k+q,n) (lines L5 to L7). By Lemma 1 the multipliers that GE computes for i>k+p are zero, and the entries akj(k) for j>k+q are zero, so every update of GE that BandLU skips subtracts 0. Thus the two arrays agree after each step, by induction, and the pivots agree too. The bandwidths follow from Lemma 1, and A=LU is the standard property of GE. □
Theorem 2 (pivoting). With partial pivoting over rows k to min(k+p,n), the computed U has uij=0 for j−i>p+q, and the nonzero multipliers of step k lie in rows k+1 to min(k+p,n).
Proof. Claim: before step k, every row i≥k of the working array has its nonzeros in columns at most max(i+q,k−1+p+q). Also all rows i>k−1+p are untouched original rows with no nonzero in column k−1 or before, since no elimination step k′<k reached them (i>k′+p). At step k the candidate rows are k≤r≤min(k+p,n), all with nonzeros in columns at most max(r+q,k−1+p+q)≤k+p+q. After the swap and the update, rows k+1 to k+p have nonzeros in columns at most k+p+q, which preserves the claim for step k+1, and the pivot row k, which becomes row k of U, has nonzeros in columns at most k+p+q. Rows below k+p are untouched and have no nonzero in column k, so the multipliers of step k are in rows k+1 to min(k+p,n). □
Theorem 3 (backward error). In the floating point model, with no underflow or overflow and wu<1, w=min(p,q)+1, if BandLU runs to completion then L^U^=A+ΔA with ∣ΔA∣≤γw∣L^∣∣U^∣.
Proof. The value finally stored at (i,j) is obtained from aij by subtracting the products l^iku^kj for max(1,i−p,j−q)≤k<min(i,j), in increasing order of k, and then, if i>j, dividing by u^jj. The number m of products is at most min(i,j)−max(i−p,j−q)≤min(p,q): if i≤j it is at most i−(j−q)≤q and at most i−(i−p)=p; the case i>j is the same with the roles exchanged. Higham, Lemma 8.4, applied to y=(c−∑k=1makbk)/bm+1 (with bm+1=1 when i≤j) gives ∣aij−∑k≤min(i,j)l^iku^kj∣≤γm+1∑k≤min(i,j)∣l^ik∣∣u^kj∣, with l^ii=1. Since γm+1≤γw, this is the claim entrywise. □
Theorem 4 (termination). BandLU stops after n steps or at the first zero pivot; lu_pivoted stops after n steps or when column k has no nonzero candidate, which happens only if A is singular.
Proof. All loops have fixed bounds. If at step k all of akk(k),…,amin(k+p,n),k(k) are zero, then by Theorem 2 column k of the working array is zero in rows k to n. The working array is MA with M nonsingular (a product of permutations and unit lower triangular matrices), and its leading k columns have rank at most k−1, so A is singular. □
■