next up previous
Next: Up: Previous:

Matrix Multiplication Parenthesization

For example, A1 A2 A3 can be rewritten as
(A1 A2) A3 or A1 (A2 A3).



Example

Suppose A1 is 10x100, A2 is 100x5, and A3 is 5x50.

Then A1 (A2 A3) $\longrightarrow$ 100*5*50 + 10*100*50 = 25,000 + 50,000 = 75,000 scalar multiplications (A2 A3 is a 100x50 matrix).

(A1 A2) A3 $\longrightarrow$ 10*100*5 + 10*5*50 = 5,000 + 2,500 = 7,500 scalar multiplications (A1 A2 is a 10x5 matrix).


next up previous
Next: Up: Previous: