-
A function that sets a given matrix to a zero matrix, by assigning a zero column at a time
-
A function that scales a given matrix, by scaling a column at a time
-
A function that adds two given matrices, by adding two columns at a time
Note: For the matrix-vector multiplication of Ax + y, choose the algorithm that uses linear combination (AXPY operations), since AXPY operations access a matrix by columns and this way of subsetting a matrix tends to be faster than an algorithm that accesses a matrix by rows. However, for the matrix-vector multiplication of A^Tx + y, choose the algorithm that uses dot products, because these dot product operations access a matrix by columns.