Commit
1 year ago
gh-37174: fixed bug in `is_linearly_dependent()`, returns true for linearly dependent univariate polynomial. `is_linearly_dependent()` returned wrong results for the univariate polynomial ring because the `coefficients()` method of univariate polynomials returns coefficients in the opposite order of `monomials()`: ``` sage: R.<q> = QQ[] sage: p = q^4 + 3*q + 5 sage: p.monomials() [q^4, q, 1] sage: p.coefficients() [5, 3, 1] ``` We fix this by making the `coefficient_matrix()` method to check for univariate polynomial ring and make the order consistent. Fixes: #37075 ### :memo: Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: https://github.com/sagemath/sage/pull/37174 Reported by: Aman Moon Reviewer(s): Travis Scrimshaw
Author
Release Manager
Loading