Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Added cases for sparse arrays in __mul__ and __rmul__ #17014
References to other Issues or PRs
Brief description of what is fixed or changed
The multiplcation is cast to a list while calculating each term, which is unnecessary for the zero value in sparse array(since 0*x = 0). Thanks to the lazy-evaluation of iterator in NDimArray, this issue will not cause a MemoryError, but the operation is slow.
Since only the no-zero values in the dictionary are changed, this execution time is much ameliorated.
Your release notes are in good order.
Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5.
Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.
Click here to see the pull request description that was parsed.
The release notes on the wiki have been updated.
@@ Coverage Diff @@ ## master #17014 +/- ## ============================================= + Coverage 74.126% 74.144% +0.017% ============================================= Files 620 620 Lines 160572 160578 +6 Branches 37677 37681 +4 ============================================= + Hits 119026 119059 +33 + Misses 36140 36116 -24 + Partials 5406 5403 -3