You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found this implementation in numbers.js library. Here is the 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;
} else {
throw new Error("Array mismatch");
}
Probabbly, it works faster than current implementation.
The text was updated successfully, but these errors were encountered:
This approach requires fetching the ith row/column of the matrix which is alwasy a fat operation, sinc it involves the full copying. I don't see a strong reason of keeping an eye on this issue.
I've found this implementation in numbers.js library. Here is the code:
} else {
throw new Error("Array mismatch");
}
Probabbly, it works faster than current implementation.
The text was updated successfully, but these errors were encountered: