#4477: [with patch; needs review] Allow exp() function for PowerSeriesRing 
element
to compute with valid non-zero constant term
------------------------------+---------------------------------------------
 Reporter:  sengupta          |        Owner:  sengupta  
     Type:  enhancement       |       Status:  assigned  
 Priority:  minor             |    Milestone:  sage-3.2.1
Component:  basic arithmetic  |   Resolution:            
 Keywords:                    |  
------------------------------+---------------------------------------------
Comment (by dmharvey):

 Code is basically good. Still running doctests. A few comments:

  * Indenting on "Check for non-zero constant term" line is wrong. Please
 fix.

  * Shouldn't have "fixes \#4477" (what will that mean in two years)

  * please refactor so that self.derivative().solve_linear_de(prec) is not
 called in two different places

  * "if C.parent()!=self.base_ring()" should use "is not" instead of "!="
 (much more efficient)

  * possibly should use "if not self[0].is_zero()" instead of "if self[0]".
 I can't remember why, but maybe is_zero actually does something useful (I
 vaguely remember it might have something to do with testing zero-ness in
 inexact rings)

  * the error message "exponential of the input does not belong to the
 ring" should be more useful to the user. Perhaps "exponential of the
 constant term does not lie in the coefficient ring. Consider coercing to
 an appropriate larger ring", or if you're feeling ambitious, invoke the
 coercion machinery to automagically find that larger ring (but don't ask
 me how to do that, I have no idea)

  * I think that error message is also misleading in the case that the
 constant term doesn't have an exp method defined. Perhaps raise a
 different error in that case, e.g. "cannot exponentiate series; exp of
 constant term is not defined".

  * The last doctest is misleading. The power series ring is defined over
 QQ, but the doctest *implicitly* creates a power series over RR and then
 exponentiates that. To demonstrate the different situation clearly, the
 doctest should explicitly create the power series ring over RR.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4477#comment:4>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to