Re: [Numpy-discussion] array vs matrix

2008-06-11 Thread Ondrej Certik
On Sun, Jun 8, 2008 at 3:54 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/6/7 Robert Kern <[EMAIL PROTECTED]>: >> On Sat, Jun 7, 2008 at 14:37, Ondrej Certik <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> what is the current plan with array and matrix with regard of calculating >>> >>> sin(A) >>

Re: [Numpy-discussion] array vs matrix

2008-06-07 Thread Robert Kern
On Sat, Jun 7, 2008 at 20:54, Anne Archibald <[EMAIL PROTECTED]> wrote: > For consistency, it makes a certain amount of sense to have sin(A) > compute a matrix sine, since A**n computes a matrix power. But looking > at the matrix exponential, I see that we have several implementations, > none of w

Re: [Numpy-discussion] array vs matrix

2008-06-07 Thread Anne Archibald
2008/6/7 Robert Kern <[EMAIL PROTECTED]>: > On Sat, Jun 7, 2008 at 14:37, Ondrej Certik <[EMAIL PROTECTED]> wrote: >> Hi, >> >> what is the current plan with array and matrix with regard of calculating >> >> sin(A) >> >> ? I.e. elementwise vs sin(A) = Q*sin(D)*Q^T? Is the current approach >> (eleme

Re: [Numpy-discussion] array vs matrix

2008-06-07 Thread Robert Kern
On Sat, Jun 7, 2008 at 14:37, Ondrej Certik <[EMAIL PROTECTED]> wrote: > Hi, > > what is the current plan with array and matrix with regard of calculating > > sin(A) > > ? I.e. elementwise vs sin(A) = Q*sin(D)*Q^T? Is the current approach > (elementwise for array and Q*sin(D)*Q^T for matrix) the wa

[Numpy-discussion] array vs matrix

2008-06-07 Thread Ondrej Certik
Hi, what is the current plan with array and matrix with regard of calculating sin(A) ? I.e. elementwise vs sin(A) = Q*sin(D)*Q^T? Is the current approach (elementwise for array and Q*sin(D)*Q^T for matrix) the way to go? We are solving the same problem in SymPy: http://groups.google.com/group/

Re: [Numpy-discussion] array vs. matrix performance

2007-05-22 Thread Robert Cimrman
Re-hi, thanks for all the comments. I have re-tried with X = nm.random.rand( 1, 3 ) and the times (in seconds) were: 428.588043213 # scipy.dot, array 445.045716047 # numpy.dot, array 519.489458799 # scipy.dot, matrix 513.328601122 # numpy.dot, matrix The scipy.dot and numpy.dot performs the

Re: [Numpy-discussion] array vs. matrix performance

2007-05-21 Thread Charles R Harris
On 5/21/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 5/21/07, David Cournapeau <[EMAIL PROTECTED]> wrote: > > Nils Wagner wrote: > > Robert Cimrman wrote: > >> I have come to a case where using a matrix would be easier than an > >> array. The code uses lots of dot products, so I tested s

Re: [Numpy-discussion] array vs. matrix performance

2007-05-21 Thread Charles R Harris
On 5/21/07, David Cournapeau <[EMAIL PROTECTED]> wrote: Nils Wagner wrote: > Robert Cimrman wrote: >> I have come to a case where using a matrix would be easier than an >> array. The code uses lots of dot products, so I tested scipy.dot() >> performance with the code below and found that the arr

Re: [Numpy-discussion] array vs. matrix performance

2007-05-21 Thread David Cournapeau
Nils Wagner wrote: > Robert Cimrman wrote: >> I have come to a case where using a matrix would be easier than an >> array. The code uses lots of dot products, so I tested scipy.dot() >> performance with the code below and found that the array version is much >> faster (about 3 times for the given s

Re: [Numpy-discussion] array vs. matrix performance

2007-05-21 Thread Nils Wagner
Robert Cimrman wrote: > I have come to a case where using a matrix would be easier than an > array. The code uses lots of dot products, so I tested scipy.dot() > performance with the code below and found that the array version is much > faster (about 3 times for the given shape). What is the reason

[Numpy-discussion] array vs. matrix performance

2007-05-21 Thread Robert Cimrman
I have come to a case where using a matrix would be easier than an array. The code uses lots of dot products, so I tested scipy.dot() performance with the code below and found that the array version is much faster (about 3 times for the given shape). What is the reason for this? Or is something wro