Let A be mn matrix x be any vector of length n How many floa
Let A be m*n matrix x be any vector of length n. How many floating point operations are required to compute the vector y defined by y=Ax.
Solution
This question is a matrix-vector product with m*n matrix A and vector x (with length n) is:
y = Ax
- after the product we will get m elements in y.
- each element requires an inner product of length n: (2n 1)m flops.
and therefore we have (2n-1)m floating point operations. Also if value of n is large the floating point operation will be 2nm.
• m = n, A diagonal: n flops
• m = n, A lower triangular: n(n + 1) flops
• A very sparse (lots of zero coefficients): no. of flops 2mn
