#20889: truncated power for polynomials
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.3
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/20889                 |  d7d124e53af86ddf8b29f404f5b1b92ef42e7f61
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:13 bruno]:
 > I am sorry if I am becoming painful...

 I wish I had every review like this one!

 > * I would allow more general integers in `generic_power_trunc` to allow
 computations as follows:
 >
 > {{{#!python
 > sage: R.<x> = PolynomialRing(ZZ, sparse=True)
 > sage: p = x^2^100 + 1
 > sage: p.power_trunc(100, 2^100+1)
 > 100*x^1267650600228229401496703205376 + 1
 > }}}

 I see. You mean for `prec`. As in your example, this would only be
 interesting for sparse polynomials. Note that it will not work at all for
 dense polynomials because `truncate` is defined as `cpdef Polynomial
 truncate(self, long prec)`. I don't mind changing the generic method to
 handle this case.

 > * A curiosity question: Why did you write `generic_power_trunc` outside
 from any class?

 I did not have any other option. As you said we could have checked whether
 the method `_power_trunc` is implemented in subclasses but this is not as
 simple as it seems with `cpdef` methods.

--
Ticket URL: <https://trac.sagemath.org/ticket/20889#comment:14>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to