Sparse Matrix Multiplication

I'm always getting confused about how matrix multiplication works. Here, you can try it interactively:

AB (general)


Note that the matrix dimensions are entered as rows x columns (height x width), and the element indices are also written like this. Click source matrix elements to toggle between zero (white) and nonzero (orange).

Note that ATA = AAT, for square and symmetric A. It is not true for other matrices (even though result of ATA or AAT is symmetric - which is always btw).

Note that a single column of AAT scatters to the whole product matrix, but the columns are independent (there are no product between elements from different columns of A in AAT).

Link to the older version of this applet.