========================== Unblocked LU factorization [TOC] ========================== In the lecture we introduced the following algorithm for an unblocked LU factorization: ---- BOX ----------------------------------------------------------------------- - for $j=0, \dots, \min\{m,n\}-1$ - Find pivot $p_j$ (using iamax) in $\left(\begin{array}{c} a_{j,j} \\ \mathbf{a}_{j+1,j} \end{array}\right)$ - if $j \neq p_j$ interchange in $A$ row $j$ and row $p_j$ - if element $a_{j,j}$ is exactly zero return $j$ (matrix is numerically singular). - Scaling: $\mathbf{a}_{j+1,j} \leftarrow \frac{1}{a_{j,j}} \mathbf{a}_{j+1,j}$ - Rank-1 update: $A_{j+1,j+1} \leftarrow A_{j+1,j+1} - \mathbf{a}_{j+1,j} \mathbf{a}_{j,j+1}^T$ - return -1 -------------------------------------------------------------------------------- where we partitioned $A$ in the $j$-th step as follows: ---- LATEX --------------------------------------------------------------------- A = \left(\begin{array}{l|l|l} A_{0,0} & \mathbf{a}_{0,j} & A_{0,j+1} \\ \hline \mathbf{a}_{j,0}^T & a_{j,j} & \mathbf{a}_{j,j+1}^T \\ \hline A_{j+1,0} & \mathbf{a}_{j+1,j} & A_{j+1,j+1} \end{array}\right) -------------------------------------------------------------------------------- Exercise ======== Implement the unblocked LU factorization. Using the provided material you only have to implement: - Function ger in ulmblas_level2.hpp - Function iamax and lu_ger in ulmblas_level2.hpp Provided Matrial ================ Copy the files ulmblas_level1.hpp, ulmblas_level2.hpp, ulmblas_level3.hpp, test.hpp and lu_exampl.cpp into a new directory. You can compile the test on theon with g++ -Wall -std=c++17 lu_example.cpp :import: session13/ex01/ulmblas_level1.hpp :import: session13/ex01/ulmblas_level2.hpp :import: session13/ex01/ulmblas_level3.hpp :import: session13/ex01/test.hpp :import: session13/ex01/lu_example.cpp