#16544: Implement `quo_rem` for `Polynomial_sparse_generic`
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: commutative | Resolution:
algebra | Merged in:
Keywords: sparse | Reviewers:
polynomial, quo_rem | Work issues:
Authors: Bruno Grenet | Commit:
Report Upstream: N/A | fb1d21cbee05d6be577bf66120aa20d3bd498ace
Branch: | Stopgaps:
u/bruno/implement__quo_rem__for__polynomial_sparse_generic_|
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Bruno Grenet', 'oldvalue': ''}):
* status: new => needs_review
* commit: => fb1d21cbee05d6be577bf66120aa20d3bd498ace
* author: => Bruno Grenet
Old description:
> It is not possible to compute the Euclidean division for generic sparse
> polynomials.
> {{{#!python
> sage: p=R.rsage: 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'
> }}}
New description:
It is not possible to compute the Euclidean division for generic sparse
polynomials.
{{{#!python
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'
}}}
--
Comment:
I've implemented an Euclidean Division algorithm in the class
`Polynomial_generic_sparse` objects that raises an
{{{#!python
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
{{{#!python
ZeroDivisionError: Division by zero polynomial
}}}
is raised.
The error in the description of the ticket does not occur anymore:
{{{#!python
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!
--
Ticket URL: <http://trac.sagemath.org/ticket/16544#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.