Skip to content

Conversation

@muhammadalhroob
Copy link

This PR enhances the matrix multiplication by rearranging loops and blocking to enhance the speed (a factor of 6 for very large matrices)

This Pull request:

Changes or fixes:

Checklist:

  • [ *] tested changes locally
  • updated the docs (if necessary)

This PR fixes #
Speeds up the code

…e blocking to enhance the speed (a factor of 6 for very large matrices)
@dpiparo
Copy link
Member

dpiparo commented Nov 10, 2025

Thanks! Could we have some tests in addition to the algorithm to ensure it works?

@muhammadalhroob
Copy link
Author

muhammadalhroob commented Nov 10, 2025

I generated two 20×20 matrices using TRandom3 r(1) and verified the correctness of the resulting matrix C = A * B by printing the output. The attached slide includes the verification results, while the attached macro shows how the matrices were created and multiplied. I have also included a performance chart that highlights the observed improvements achieved through this implementation.
CompareAMultB.pdf
MatrixMultiplication
testMatrixMultiplication.C

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants