Application: Unblocked LU Factorization
Content |
LU factorization with pivoting
Implement the LU factorization with pivoting:
-
Solve your example problem with pencil and paper
-
Change your factorization such that it also handles pivoting. Implement for this the following BLAS functions as auxiliary tools:
-
Write a function dswap for interchanging values of two vectors:
void dswap(size_t n, double *x, ptrdiff_t incX, double *y, ptrdiff_t incY) { // Your code }
-
Write a function idamx that returns for a vector the index with maximal absolute value:
size_t idamax(size_t n, const double *x, ptrdiff_t incX) { // Your code }
-
-
Change main such that it also prints the pivot vector after the factorization.