Skip to content
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

Implement quo_rem for Polynomial_sparse_generic #16544

Closed
bgrenet opened this issue Jun 25, 2014 · 8 comments
Closed

Implement quo_rem for Polynomial_sparse_generic #16544

bgrenet opened this issue Jun 25, 2014 · 8 comments

Comments

@bgrenet
Copy link

bgrenet commented Jun 25, 2014

It is not possible to compute the Euclidean division for generic sparse polynomials.

sage: R.<x>=PolynomialRing(ZZ,sparse=True)
sage: p=R.random_element(10)
sage: q=R.random_element(5)
sage: p//q
---------------------------------------------------------------------------
AttributeError
...
AttributeError: 'Polynomial_generic_sparse' object has no attribute 'quo_rem'

Component: commutative algebra

Keywords: sparse polynomial, quo_rem

Author: Bruno Grenet

Branch/Commit: fb1d21c

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/16544

@bgrenet
Copy link
Author

bgrenet commented Jul 10, 2014

@bgrenet
Copy link
Author

bgrenet commented Jul 10, 2014

Author: Bruno Grenet

@bgrenet

This comment has been minimized.

@bgrenet
Copy link
Author

bgrenet commented Jul 10, 2014

Commit: fb1d21c

@bgrenet
Copy link
Author

bgrenet commented Jul 10, 2014

comment:2

I've implemented an Euclidean Division algorithm in the class Polynomial_generic_sparse objects that raises an

ArithmeticError: Nonunit leading coefficient

if the leading coefficient of the divisor is not invertible, as it is done in the class Polynomial_generic_dense. Also, if the divisor is zero, a

ZeroDivisionError: Division by zero polynomial

is raised.

The error in the description of the ticket does not occur anymore:

sage: R.<x>=PolynomialRing(ZZ,sparse=True)
sage: p=R.random_element(10)
sage: q=R.random_element(5)
sage: p//q
---------------------------------------------------------------------------
ArithmeticError
...
ArithmeticError: Nonunit leading coefficient
sage: q += x^6
sage: p//q
x^4 + 4*x^3 - 14*x^2 + 6*x + 61

Needs review!

@tscrim
Copy link
Collaborator

tscrim commented Jul 10, 2014

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Jul 10, 2014

comment:3

I'm somewhat surprised we didn't catch this earlier. LGTM, positive review.

@vbraun
Copy link
Member

vbraun commented Jul 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants