Let's call the inner product as 'ip'.
The result of above multiplication would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
> y ip z
[,1] [,2] [,3]
[1,] 1 5 9
[2,] 4 12 20
[3,] 9 21 33
[4,] 16 32 48
y ip x
[,1]
[1,] 1
[2,] 4
[3,] 9
[4,] 16
x ip z
[,1] [,2] [,3]
[1,] 30 70 110
The problem is that I can't hold the matrices in memory.
Only can process them line by line.