=========================== First BLAS Level 2 Function [TOC] =========================== - In a first approach we will implement the BLAS Level 2 functions by using Level 1 functions as building blocks. - Each function should distinguish the cases that a matrix is row or column major. `ger`: General Matrix Rank 1 Update =================================== +--------------------------------+---------------------------------------------------------+ | Operation | Signature | +--------------------------------+---------------------------------------------------------+ | $\alpha xy^T+A\rightarrow A$ | ==== CODE(Type=c)====================================== | | | void | | | dger(size_t m, size_t n, double alpha, | | | const double *x, ptrdiff_t incX, | | | const double *y, ptrdiff_t incY, | | | double *A, ptrdiff_t incRowA, ptrdiff_t incColA); | | | ======================================================= | +--------------------------------+---------------------------------------------------------+ In the special case $\alpha = 0$ or $m=0$ or $n=0$ this is a NOP. # `gemv`: General Matrix Vector Product # ===================================== # # +--------------------------------------+---------------------------------------------------------------+ # | Operation | Signature | # +--------------------------------------+---------------------------------------------------------------+ # | $\alpha A x + \beta y \rightarrow y$ | ==== CODE(Type=c)============================================ | # | | void | # | | dgemv(size_t m, size_t n, double alpha, | # | | const double *A, ptrdiff_t incRowA, ptrdiff_t incColA, | # | | const double *x, ptrdiff_t incX, | # | | double beta, | # | | double *y, ptrdiff_t incY); | # | | ============================================================= | # +--------------------------------------+---------------------------------------------------------------+ # # # - In the special case $\beta = 0$ vector $y$ must not be multiplied by $0$ but overwritten with zeros. So # in this case $y$ might contain `NaN` entries. # - In the special case Exercise ======== Complete the following code :import: session04/blas2_ex.c :navigate: up -> doc:index back -> doc:session04/page02 next -> doc:session04/page04