Subsection 5.3.5 Solving with a triangular matrix
¶We are left to discuss how to solve Lz=yLz=y and Ux=z.Ux=z.Subsubsection 5.3.5.1 Algorithmic Variant 1
¶fit widthConsider Lz=yLz=y where LL is unit lower triangular. Partitionψ1 needs not be updated.
y2:=y2−ψ1l21
Homework 5.3.5.1.
Derive a similar algorithm for solving Ux=z. Update the below skeleton algorithm with the result. (Don't forget to put in the lines that indicate how you "partition and repartition" through the matrix.)
Hint: Partition
Multiplying this out yields
So, \(\chi_1 = \zeta_1 / \upsilon_{11} \) after which \(x_0 \) can be computed by solving \(U_{00} x_0 = z_0 - \chi_1 u_{01} \text{.}\) The resulting algorithm is then given by
Subsubsection 5.3.5.2 Algorithmic Variant 2
¶fit widthAn alternative algorithm can be derived as follows: PartitionHomework 5.3.5.2.
Derive a similar algorithm for solving Ux=z. Update the below skeleton algorithm with the result. (Don't forget to put in the lines that indicate how you "partition and repartition" through the matrix.)
Hint: Partition
Partition
Multiplying this out yields
So, if we assume that \(x_2 \) has already been computed and has overwritten \(z_2 \text{,}\) then \(\chi_1 \) can be computed as
which can then overwrite \(\zeta_1 \text{.}\) The resulting algorithm is given by
Homework 5.3.5.3.
Let L be an m×m unit lower triangular matrix. If a multiply and add each require one flop, what is the approximate cost of solving Lx=y?
Let us analyze Variant 1.
Let \(L_{00} \) be \(k \times k \) in a typical iteration. Then \(y_2 \) is of size \(m - k - 1 \) and \(y_2 := y_2 - \psi_1 l_{21} \) requires \(2( m - k - 1 ) \) flops. Summing this over all iterations requires
The change of variables \(j = m - k - 1 \) yields
Thus, the cost is approximately \(m^2 \) flops.