vkostyukov/la4j — pull request #55 by yuronew (2013-07-02 00:50:42+00:00)
Title: #4 Multipy method from numbers.js

Hi!
I implemented fmultiply() method in Matrix interface, that multiply matrices, using this part of code:
if (arrA[0].length === arrB.length) {
var result = new Array(arrA.length);

for (var x = 0; x < arrA.length; x++) {
result[x] = new Array(arrB[0].length);
}

var arrB_T = transpose(arrB);

for (var i = 0; i < result.length; i++) {
for (var j = 0; j < result[i].length; j++) {
result[i][j] = dotproduct(arrA[i],arrB_T[j]);
}
}
return result;
As i figured out, it relays on scalar product.
Here is the result of it's work:
Fustmult time: 7254653 ns
Simple mult time: 1868596 ns
As you see, this method is more than 3 times slower. But, probably, I ran bad benchmark?

Another thing: falsely, I created new branch from my local repo, so my previous changes are displayed, too.