http://blog.fens.me/hadoop-mapreduce-matrix/

k, v 表示key 和 value。
1,1 A:1 1 表示第一行乘第一列,A矩阵的第一位是1.


Example:

http://hadoopgeek.com/mapreduce-matrix-multiplication/
output matrix[0,0]位置上会用0 row of matrix A * 0 col of Matrix B.
得到的a list of values会再sum up起来。

mapper output: <key =(output row, output col), value = 一个乘法的值>
然后要把所有这个位置上的值做一个加法。
A*B = C matrix
C matrix上位置<r, c>的值= A的row<r, >里乘*B的col <, c> dot-product。
但是我们不能直接<r,c>当做key 因为我们有2个mapper for different matrixA, matrix B.
最后加起来。


网友评论