Skip to content
New issue

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

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

Already on GitHub? # to your account

optimize matrix operations using Strassen algorithm ? #1181

Open
obiot opened this issue Apr 5, 2023 · 5 comments · Fixed by sudarshanmg/melonJS#1
Open

optimize matrix operations using Strassen algorithm ? #1181

obiot opened this issue Apr 5, 2023 · 5 comments · Fixed by sudarshanmg/melonJS#1

Comments

@obiot
Copy link
Member

obiot commented Apr 5, 2023

Adding this one here, as it's quite interesting :

Strassen multiplication algorithm is faster, with a complexity of approximately O(n^2.8074) , compared to O(n^3) for standard multiplication algorithm.

Strassen Matrix multiplication is based on a divide and conquer-based approach, by diving matrix into smaller square matrix
https://www.topcoder.com/thrive/articles/strassenss-algorithm-for-matrix-multiplication

@sudarshanmg
Copy link

Hey I can do it and send a PR.

@obiot
Copy link
Member Author

obiot commented Jul 16, 2023

Hi, that would be awesome honestly !

If you, don't replace the current multiply method, just add a fastMul() one or something, this way we can also properly test and benchmark it against the normal one.

thanks :)

@sudarshanmg
Copy link

Absolutely! 🤟
Just to be clear, Matrix multiplication is currently in matrix3.js right?
If so, is the mutiply method for a 4x4 matrix? because the indexing is from 0-15.

@obiot
Copy link
Member Author

obiot commented Jul 16, 2023

Absolutely! 🤟
Just to be clear, Matrix multiplication is currently in matrix3.js right?
If so, is the mutiply method for a 4x4 matrix? because the indexing is from 0-15.

indeed, we called it Matrix3d but yes it's a 4x4 matrix. Same for the Matrix2d one it's 3x3 matrix.

can't disagree it's maybe a bit confusing :)

sudarshanmg added a commit to sudarshanmg/melonJS that referenced this issue Jul 16, 2023
 - Multiplication using strassen's algorithm.
- trying to close melonjs#1181
@sudarshanmg
Copy link

Hey 👋
Implemented strassen's as requested, please check it out!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants