Re: [sage-support] Characteristic function of an interval

2012-03-14 Thread Vegard Lima
Hi, On Wed, Mar 14, 2012 at 7:56 AM, Laurent moky.m...@gmail.com wrote:  I'm searching for a function f(x)=1 if x in [a,b], =0 otherwise how about using the Heaviside step function? a=0 b=1 f(x) = heaviside(x-a) - heaviside(x-b) Cheers, -- Vegard -- To post to this group, send email to

[sage-support] __call__() much slower than a real sage function ?

2012-03-14 Thread Laurent
Hi all I've (at least) two ways of plotting a function. The first one is the classic : f=(x**2).function(x) Q=plot(f,x,-1,1) I've an other one : == class CallFunction(object): def __init__(self,f): self.f=f def __call__(self,x): return

Re: [sage-support] [Characteristic function of an interval] Heaveside too slow ?

2012-03-14 Thread Laurent
Il 14/03/2012 08:09, Vegard Lima ha scritto: Hi, On Wed, Mar 14, 2012 at 7:56 AM, Laurentmoky.m...@gmail.com wrote: I'm searching for a function f(x)=1 if x in [a,b], =0 otherwise how about using the Heaviside step function? oh yes, of course it works. Thanks. ... well My residual

Re: [sage-support] __call__() much slower than a real sage function ?

2012-03-14 Thread Mike Hansen
On Wed, Mar 14, 2012 at 12:08 AM, Laurent moky.m...@gmail.com wrote: My question in the following : is it normal that the second one is *much* slower than the first one ? The reason why the second one is much faster is Sage has something called fast_callable which can optimize the evaluation of

[sage-support] Fwd: how to convert GAP group objects in SAGE notebook to SAGE group objects

2012-03-14 Thread david joyner
Ashwin Ganesan: I am forwarding your email to sage-support. For info on isomorphism_to you can look at the section of the Sage reference manual http://www.sagemath.org/doc/reference/groups.html or use the on-line help as in this example: sage: G = CubeGroup() sage: G.isomorphism_to? If

[sage-support] Re: integral point

2012-03-14 Thread John Cremona
On Mar 13, 8:51 pm, FOAD KHOSHNAM mako...@gmail.com wrote: Hello Dear how  can I calculate the integral point for this curve: [0,0,0,-3568202637461440265241263457,0] Define the elliptic curve by E = EllipticCurve([0,0,0,-3568202637461440265241263457,0]) and then use E.integral_points()

[sage-support] Re: Keeping coefficients as floats when using solve

2012-03-14 Thread Mike
On Feb 20, 12:35 pm, Burcin Erocal bur...@erocal.org wrote: Or you can do this: sage: t = -2/3*x + 4/3 sage: t._convert(RR) -0.667*x + 1.33 Cheers, Burcin This is perfect - thank you! For the record, I've used that idea to write the following bits: def