:
- Precondition: # columns of A equals # rows of B.
- Algorithm:
![$(A \cdot B)[i,j] = A[i,1] B[1,j] + A[i,2] B[2,j] + \cdots + A[i,n] B[n,j]$](img25.gif)
- Alternatively, write A as an array of row vectors
and B as an array of column vectors
then
![\begin{eqnarraystar}
A \cdot B & = & \left[
\begin{array}
{cccc}
a_1^T b_1 & a...
...T b_1 & a_m^T b_2 & \cdots & a_m^T b_p
\end{array} \right].
\end{eqnarraystar}](img28.gif)
- # operations
:
-
involves
dot products, and
- Each dot product needs O(n) operations.
Next: Matrix Algebra
Up: MATRICES AND VECTORS
Previous: Basic Matrix Operations