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
added OneMatrix for matrix expressions with only ones #16676
Conversation
✅ Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. 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.
Update The release notes on the wiki have been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
But I think you may need to add to __init__.py
, so that it can be loaded under sympy main module.
|
||
assert isinstance(A + U, Add) | ||
# assert a*OneMatrix(n, 1) == a | ||
# assert OneMatrix(n, 1)*a == a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would these commented-out tests be made more meaningful?
And I don't think that the matrix multiplication can be defined here, unless n is 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are wrong. I shall remove them.
U ** 2 | ||
|
||
U = OneMatrix(n, n) | ||
assert U[1, 2] == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that matrices with symbolic dimensions can have its elements defined in explicit coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZeroMatrix
behaves like this (always returns zero). There should be a bounds check, but I don't think this is important. If you access a matrix containing only one element, you're pretty sure you get that element.
Codecov Report
@@ Coverage Diff @@
## master #16676 +/- ##
=============================================
+ Coverage 73.825% 73.841% +0.015%
=============================================
Files 619 619
Lines 159286 159311 +25
Branches 37386 37388 +2
=============================================
+ Hits 117594 117637 +43
+ Misses 36260 36239 -21
- Partials 5432 5435 +3 |
References to other Issues or PRs
Brief description of what is fixed or changed
Other comments
Release Notes
OneMatrix
, a matrix symbol representing matrices of only 1 entries.