Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate performance of multipy method from numbers.js #4

Closed
vkostyukov opened this issue Dec 27, 2012 · 3 comments
Closed

Validate performance of multipy method from numbers.js #4

vkostyukov opened this issue Dec 27, 2012 · 3 comments

Comments

@vkostyukov
Copy link
Owner

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.

@yuronew
Copy link
Contributor

yuronew commented Jul 1, 2013

Is it still actual?

@vkostyukov
Copy link
Owner Author

There is a pull-request with details: #55

@vkostyukov
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants