#10268: adding GiNaC method to simplify_rational
---------------------------+------------------------------------------------
   Reporter:  bgoodri      |       Owner:  burcin    
       Type:  enhancement  |      Status:  new       
   Priority:  minor        |   Milestone:  sage-4.6.2
  Component:  symbolics    |    Keywords:            
     Author:               |    Upstream:  N/A       
   Reviewer:               |      Merged:            
Work_issues:               |  
---------------------------+------------------------------------------------

Comment(by bgoodri):

 Replying to [comment:3 kcrisman]:

 I am just learning sage, but it seems that the compiler does not like the
 GEx to be declared inside a conditional statement, which makes sense. The
 _sig_on and _sig_off thing I think is for catching segfaults, which
 doesn't seem to be a problem and when I comment those out, the behavior is
 the same. A slight possibility is the fact that when I use the GiNaC shell
 directly it is the most recent version, whereas Pynac forked off an older
 version, but the normal function has been in GiNaC for a long, long time.

 More interesting is that when I interrupt sage, I get this traceback

 {{{

 KeyboardInterrupt                         Traceback (most recent call
 last)

 /media/disk30/sage-4.6/<ipython console> in <module>()

 /media/disk30/sage-4.6/local/lib/python2.6/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression.simplify_rational
 (sage/symbolic/expression.cpp:23989)()

 /media/disk30/sage-4.6/local/lib/python2.6/site-
 packages/sage/symbolic/pynac.so in sage.symbolic.pynac.py_gcd
 (sage/symbolic/pynac.cpp:6440)()

 /media/disk30/sage-4.6/local/lib/python2.6/site-
 packages/sage/rings/arith.pyc in gcd(a, b, **kwargs)
    1363 sigma = Sigma()
    1364
 -> 1365 def gcd(a, b=None, **kwargs):
    1366     r"""
    1367     The greatest common divisor of a and b, or if a is a list and
 b is

 /media/disk30/sage-4.6/local/lib/python2.6/site-
 packages/sage/interfaces/get_sigs.pyc in my_sigint(x, n)
       7
       8 def my_sigint(x, n):
 ----> 9     raise KeyboardInterrupt
      10
      11 def my_sigfpe(x, n):

 KeyboardInterrupt:


 }}}
 Why would it fall into the gcd function from
 /media/disk30/sage-4.6/local/lib/python2.6/site-
 packages/sage/rings/arith.pyc? The patch does not call it directly, and it
 is a waste because normal in GiNaC already cancels the greatest common
 factor from the numerator and the denominator. And then a related question
 is why does gcd seem to hang?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10268#comment:4>
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 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