#2452: [with patch, needs work] Heaviside step function, Dirac delta needed
-------------------------+--------------------------------------------------
 Reporter:  gfurnish     |       Owner:  gfurnish
     Type:  enhancement  |      Status:  assigned
 Priority:  major        |   Milestone:  sage-4.1
Component:  symbolics    |    Keywords:          
 Reviewer:               |      Author:          
   Merged:               |  
-------------------------+--------------------------------------------------

Comment(by gmhossain):

 Replying to [comment:15 burcin]:
 > Sorry for doing this in such small pieces, but I have one more
 suggestion.
 >
 > You can change the calls to the `_is_real()` function by `x in RR` where
 you import `RR` from `sage.rings.real_mpfr`.
 > The semantics of the `__contains__()` method in Sage is similar to your
 `_is_real()`, though it also checks that `approx_x == x` in your code.

 Hi Burcin. I tried your suggestion. I am not sure whats going wrong but it
 slows down massively. Could
 you please check this out?

 '''With: `_is_real(x)`'''

 {{{
 sage: timeit( 'dirac_delta(1 + I*exp(-10000))')
 125 loops, best of 3: 6.47 ms per loop
 sage: timeit( 'dirac_delta(1 + I*exp(-10000000000000000))')
 125 loops, best of 3: 6.23 ms per loop
 }}}

 '''with: `x in RR`'''

 {{{
 sage: timeit( 'dirac_delta(1 + I*exp(-10000))')
 125 loops, best of 3: 6.56 ms per loop
 sage: timeit( 'dirac_delta(1 + I*exp(-10000000000000000))')
 5 loops, best of 3: 154 ms per loop
 }}}

 Thanks,

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