On Jan 23, 2009, at 9:04 AM, kcrisman wrote:
>
>
>> Sorry to focus on one little question and ignore the big picture, but
>> it's 6:15am :-)
>
> Yes - my first question was at 1:30 AM, so I hear you!
>
>> This will be better in the new symbolics:
>>
>> sage: x,y = var('x,y',ns=1)
>> sage: f = x^2 + y^2 -1
>> sage: list= [[i,j] for i in [-3..3] for j in [-3..3]]
>> sage: %time [(a,b) for a,b in list if f.subs(x=a).subs(y=b)==0]
>> CPU times: user 0.02 s, sys: 0.00 s, total: 0.02 s
>> Wall time: 0.02 s
>> [(-1, 0), (0, -1), (0, 1), (1, 0)]
>
> That's what I figured. Are the pynac symbolics on track to be
> directly callable (i.e. f(a,b)==0, not the .subs() stuff) relatively
> soon? My ulterior motive for asking that is of course for basic
> plotting, which will hopefully be inconceivably faster with pynac...
There was a huge thread on sage-devel about this a while ago. I think
the consensus was that
sage: f(x,y) = x^2+y^2-1
will still create a (directly callable) symbolic function, but
sage: f = x^2+y^2-1
will not, as the ordering between x and y is ambiguous. The jury was
still out on whether
sage: f = x^2+1
sage: f(10)
should work, because there is a non-ambiguous interpretation. I'd
also like to keep the
f(x=5, y=3)
shorthand for f.subs(x=5, y=3).
- Robert
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---