-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Handle empty matrices over univariate polynomials #39852
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 2f4dcee; changes) is ready! 🎉 |
55469f5
to
e776011
Compare
@@ -261,7 +256,7 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense): | |||
[4 1 5 6] | |||
""" | |||
from sage.matrix.constructor import matrix | |||
return matrix([[self[i,j].constant_coefficient() | |||
return matrix(self.base_ring().base_ring(), [[self[i,j].constant_coefficient() |
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.
Good catch. I assume that without this, this could return a matrix over QQ if self
has zero rows or columns. Which could create problems if this now-rational matrix is used later in other operations.
Thanks a lot for the work, this fixes the "empty matrix issue" in almost all methods. When creating #39587 I was not sure whether empty matrices should be supported by all methods (e.g. I write "almost all" because:
This should be fixed before merging. |
Could someone with the relevant rights allow the pending checks to run, maybe @fchapoton ? Thanks a lot. |
@@ -1509,27 +1570,14 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense): | |||
or `m\times 0`) is not defined:: |
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.
or `m\times 0`) is not defined:: | |
or `m\times 0`) are taken by convention as follows:: |
Another minor issue, to be investigated:
this matrix has 4 rows and 0 columns, it should not be considered in Popov form (Popov form requires full row rank, if zero rows are not allowed). Strangely, there is no similar issue for |
In fact, this has nothing to do with the modifications in this PR. But may as well be fixed at the same time. @Biffo89 could you please replace the line
in both
? Thank you. |
Co-authored-by: Vincent Neiger <[email protected]>
Fixes #39587
Adds handling of empty matrices over univariate polynomials, specifically in the following methods:
📝 Checklist