On 1/3/11 8:30 AM, Sean Owen wrote:
If you need to control whether B or C comes first it gets tougher
since you need a custom wrapper key for A. But it's not terrible.
That's the rub. Since this is matrix multiplication, the operation isn't commutative, so I have to know after the identity mapper explicitly which element is B and which is C so I can multiply them in the correct sequence. That's effectively what I implemented through NamedVector (I went through and removed all the references to the writable I wrote and used just the NamedVector, thanks for the heads-up on that one), except it comes with the cost of having to preprocess both matrices to assign the necessary labels, which results in the two additional m/r jobs.

In the implementation I've drawn up, the Mapper is the identity mapper you mentioned, and the combiner is just what the mapper was (and is, in the current Mahout release). The Reducer is more or less the same.

Also: there's a comment in the javadocs for the current matrix multiplication job that says "this.transpose.times(other)", but I don't see any explicit call to transpose() in the current job. How does this happen?

Shannon

Reply via email to