[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-15 Thread Jason Grout
Harald Schilly wrote: > On Dec 15, 4:34 am, mhampton wrote: >> Thanks for pointing that out. I was looking for "svd", lower-case, >> and missed it. > > actually, me too. Is there a reason why it is uppercase? I'm for > renaming it to lowercase and adding an uppercase synonym for backwards > comp

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-15 Thread Harald Schilly
On Dec 15, 4:34 am, mhampton wrote: > Thanks for pointing that out.  I was looking for "svd", lower-case, > and missed it. actually, me too. Is there a reason why it is uppercase? I'm for renaming it to lowercase and adding an uppercase synonym for backwards compatibility. h -- To post to this

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-14 Thread mhampton
Thanks for pointing that out. I was looking for "svd", lower-case, and missed it. -Marshall On Dec 14, 6:33 pm, Jason Grout wrote: > Jason Grout wrote: > > > Use .SVD(): > > I should mention that .SVD just calls numpy/scipy for the actual > computation. > > Jason -- To post to this group, sen

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-14 Thread Jason Grout
Jason Grout wrote: > > Use .SVD(): > I should mention that .SVD just calls numpy/scipy for the actual computation. Jason -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-14 Thread Jason Grout
mhampton wrote: > If you convert to numpy matrices, then Sage is pretty competitive with > matlab. We still have some room for improvement in making it easy > though - despite Jason Grout's improvements, a matrix over RDF is > missing some methods I'd like, such as the singular value > decompositi

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-14 Thread Jason Grout
David Joyner wrote: > Going form a vague memory: > My colleague was arguing that one should not teach > a course in scientific programming using Sage > because it was so slow in doing some very simple > things. Apparently if A is a vector or matrix in matlab > (ie, an array or real numbers) and f

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-14 Thread kcrisman
With respect to some of this discussion, see also the following sage- support request: http://groups.google.com/group/sage-support/browse_thread/thread/9e6475494f85cd53 - kcrisman -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an ema

Re: [sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-13 Thread Minh Nguyen
Hi Chris, On Sun, Dec 13, 2009 at 9:30 PM, chris wuthrich wrote: > > Thanks a lot for this tutorial. I think it would be great to have it > included in the documentation. See ticket #7679 [1] for a patch to enhance the Constructions document with this tutorial. [1] http://trac.sagemath.org/sag

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-13 Thread chris wuthrich
Thanks a lot for this tutorial. I think it would be great to have it included in the documentation. I did not know anything about functional programming before using sage. To a new mathematical user without python knowledge things like lambda = 4 SyntaxError: invalid syntax lambda? No object 'l

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-13 Thread Harald Schilly
On Dec 13, 1:02 am, Minh Nguyen wrote: > I have written a draft of a tutorial on functional programming for > mathematicians. Very nice, i added a comment and I just repeat it here. I think you should also point to the "operator" python package, since defining add in a function is an overhead and

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-13 Thread mhampton
If you convert to numpy matrices, then Sage is pretty competitive with matlab. We still have some room for improvement in making it easy though - despite Jason Grout's improvements, a matrix over RDF is missing some methods I'd like, such as the singular value decomposition. As an example, to ext

Re: [sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-12 Thread Minh Nguyen
Hi Jason, On Sun, Dec 13, 2009 at 11:24 AM, Jason Grout wrote: > Do you think you could add a sentence or two in the filter section about > using list comprehensions to do filters, like you did above in the map > section? The tutorial is updated with such an example. Say the problem is to gen

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-12 Thread Nils Bruin
On Dec 12, 5:56 pm, Jason Grout wrote: > There's apparently a lot more overhead than I would have imagined: > > sage: %timeit [v for v in (x for x in range(10) ) if v > 0] > 10 loops, best of 3: 5.4 s per loop > sage: %timeit [v for v in range(10) if v>0] > 10 loops, best of 3: 2.98 s per

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-12 Thread Jason Grout
Nils Bruin wrote: > On Dec 12, 4:24 pm, Jason Grout wrote: >> [f(x) for x in [1..10] if f(x)>0] > > This is actually bad style. It means that f gets evaluated twice for > all the values that end up in the list. Good point. > The magma language solves this with modified semantics for the "where"

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-12 Thread Nils Bruin
On Dec 12, 4:24 pm, Jason Grout wrote: > [f(x) for x in [1..10] if f(x)>0] This is actually bad style. It means that f gets evaluated twice for all the values that end up in the list. The magma language solves this with modified semantics for the "where" clause. One would write: [ v : x in [1..1

[sage-devel] Re: tutorial on Python functional programming for mathematicians

2009-12-12 Thread Jason Grout
Minh Nguyen wrote: > Hi folks, > > I have written a draft of a tutorial on functional programming for > mathematicians. The tutorial is available on the Sage wiki [1], but > you could also find it at Wordpress [2]. This is a redundancy measure > in case the wiki is down. I invite you to comments o