Re: [Numpy-discussion] expm

2007-07-20 Thread Timothy Hochberg
On 7/20/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: On 7/20/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > > On 7/20/07, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > > I expect using sqrt(x) will be faster than x**.5. > > > > I did test this at one po

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: On 7/20/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > I expect using sqrt(x) will be faster than x**.5. > I did test this at one point and was also surprised that sqrt(x) seemed slower than **.5. However I found out

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Charles R Harris <[EMAIL PROTECTED]> wrote: I expect using sqrt(x) will be faster than x**.5. I did test this at one point and was also surprised that sqrt(x) seemed slower than **.5. However I found out otherwise while preparing a timeit script to demonstrate this observation.

Re: [Numpy-discussion] expm

2007-07-20 Thread Timothy Hochberg
On 7/20/07, Charles R Harris <[EMAIL PROTECTED]> wrote: [SNIP] I expect using sqrt(x) will be faster than x**.5. You might want to check that. I believe that x**0.5 is one of the magic special cases that is optimized to run fast (by calling sqrt in this case). IIRC the full set is [-1, 0, 0

Re: [Numpy-discussion] expm

2007-07-20 Thread Charles R Harris
On 7/20/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: On 7/20/07, Anne Archibald <[EMAIL PROTECTED]> wrote: > > On 20/07/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > > lorenzo bolla wrote: > > > hi all. > > > is there a function in numpy to compute the exp of a matrix, similar

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Nils Wagner <[EMAIL PROTECTED]> wrote: Your sqrtm_eig(x) function won't work if x is defective. See test_defective.py for details. I've added several defective matrices to my test cases and the SVD method doesn't work well as I'd thought (which is obvious in retrospect). I'm goi

Re: [Numpy-discussion] expm

2007-07-20 Thread Nils Wagner
On Fri, 20 Jul 2007 14:45:43 -0400 "Kevin Jacobs <[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> wrote: > On 7/20/07, Nils Wagner <[EMAIL PROTECTED]> >wrote: >> >> Your sqrtm_eig(x) function won't work if x is defective. >> See test_defective.py for details. > > > I am aware, though at least on my s

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Nils Wagner <[EMAIL PROTECTED]> wrote: Your sqrtm_eig(x) function won't work if x is defective. See test_defective.py for details. I am aware, though at least on my system, the SVD-based method is by far the fastest and robust (and can be made more robust by the addition of a rela

Re: [Numpy-discussion] expm

2007-07-20 Thread Nils Wagner
On Fri, 20 Jul 2007 13:03:09 -0400 "Kevin Jacobs <[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> wrote: On 7/20/07, Anne Archibald <[EMAIL PROTECTED]> wrote: On 20/07/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > lorenzo bolla wrote: > > hi all. > > is there a function in numpy to compute the exp o

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Anne Archibald <[EMAIL PROTECTED]> wrote: On 20/07/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > lorenzo bolla wrote: > > hi all. > > is there a function in numpy to compute the exp of a matrix, similar > > to expm in matlab? > > for example: > > expm([[0,0],[0,0]]) = eye(2) > Numpy d

Re: [Numpy-discussion] expm

2007-07-20 Thread Anne Archibald
On 20/07/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > lorenzo bolla wrote: > > hi all. > > is there a function in numpy to compute the exp of a matrix, similar > > to expm in matlab? > > for example: > > expm([[0,0],[0,0]]) = eye(2) > Numpy doesn't provide expm but scipy does. > >>> from scipy.lina

Re: [Numpy-discussion] expm

2007-07-20 Thread Nils Wagner
lorenzo bolla wrote: > hi all. > is there a function in numpy to compute the exp of a matrix, similar > to expm in matlab? > for example: > expm([[0,0],[0,0]]) = eye(2) > > thanks, > lorenzo. > > > __

[Numpy-discussion] expm

2007-07-20 Thread lorenzo bolla
hi all. is there a function in numpy to compute the exp of a matrix, similar to expm in matlab? for example: expm([[0,0],[0,0]]) = eye(2) thanks, lorenzo. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/lis