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

Use more efficient matrix vector multiplication op in proposals #59

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

matt-graham
Copy link
Collaborator

#47 switched to always using dense matrix constructed with diag for diagonal shapes, which incurs a quadratic cost matrix vector multiplication operation, even though it should be possible in linear, but this was found to much quicker in profiling than using Matrix::diagonal. This PR instead defines a custom matrix-vector multiplication operator %@% to use in proposals that treats vector shapes as diagonal matrices and scalar shapes as scaled identities, and performs the matrix vector multiply in linear cost.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (71f0af1) to head (5c4195b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #59   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          518       520    +2     
=========================================
+ Hits           518       520    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matt-graham matt-graham merged commit f959498 into main Dec 9, 2024
11 checks passed
@matt-graham matt-graham deleted the mmg/simplify-mat-vec-mult branch December 9, 2024 10:00
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.

1 participant