-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix Out of Index Error for is_upper() and is_upper_hessenberg() #12454
Conversation
sympy/matrices/matrices.py
Outdated
@@ -1112,7 +1112,7 @@ def is_upper(self): | |||
""" | |||
return all(self[i, j].is_zero | |||
for i in range(1, self.rows) | |||
for j in range(i)) | |||
for j in range(min(i,self.cols))) |
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.
There could be a space after comma.
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.
Okay , I will add it.
@jksuom , please review it now. Thanks |
@@ -1225,6 +1225,8 @@ def test_is_upper(): | |||
assert a.is_upper is True | |||
a = Matrix([[1], [2], [3]]) | |||
assert a.is_upper is False | |||
a = zeros(4,2) |
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.
space after comma here, too
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.
It's ready to go after that.
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.
Could you make a similar mod to is_upper_hessenberg
and add a test?
Looks good. It's in. |
Fixes #12452