Re: [Numpy-discussion] Howto vectorise a dot product ?

2009-06-10 Thread Tom K.
bruno Piguet wrote: > >Can someone point me to a doc on dot product vectorisation ? > As I posted in the past you can try this one liner: "numpy.array(map(numpy.dot, a, b)) that works for matrix multiply if a, b are (n, 3, 3). " This would also work if a is (n, 3, 3) and b is (n, 3

Re: [Numpy-discussion] Howto vectorise a dot product ?

2009-06-10 Thread Charles R Harris
On Wed, Jun 10, 2009 at 12:21 AM, bruno Piguet wrote: > 2009/6/9 Charles R Harris > >> >> Well, in this case you can use complex multiplication and either work with >> just the x,y components or use two complex components, i.e., [x + 1j*y, z]. >> In the first case you can then do the rotation as

Re: [Numpy-discussion] Howto vectorise a dot product ?

2009-06-09 Thread bruno Piguet
2009/6/9 Charles R Harris > > Well, in this case you can use complex multiplication and either work with > just the x,y components or use two complex components, i.e., [x + 1j*y, z]. > In the first case you can then do the rotation as V*exp(1j*phi). In the real case, it's a real 3-axes rotation

Re: [Numpy-discussion] Howto vectorise a dot product ?

2009-06-09 Thread Charles R Harris
On Tue, Jun 9, 2009 at 12:56 PM, bruno Piguet wrote: > Dear all, > >Can someone point me to a doc on dot product vectorisation ? > > Here is what I try to do : > > I've got a rotation function which looks like : > > def rotat_scal(phi, V): > s = math.sin(phi) > c = math.cos(phi) >

Re: [Numpy-discussion] Howto vectorise a dot product ?

2009-06-09 Thread David Warde-Farley
On 9-Jun-09, at 2:56 PM, bruno Piguet wrote: > Phi is now of size(n) and V (n, 3). > (I really whish to have this shape, for direct correspondance to > file). > > The corresponding function looks like : > > def rotat_vect(phi, V): >s = np.sin(phi) >c = np.cos(phi) >M = np.zeros((len(p

[Numpy-discussion] Howto vectorise a dot product ?

2009-06-09 Thread bruno Piguet
Dear all, Can someone point me to a doc on dot product vectorisation ? Here is what I try to do : I've got a rotation function which looks like : def rotat_scal(phi, V): s = math.sin(phi) c = math.cos(phi) M = np.zeros((3, 3)) M[2, 2] = M[1, 1] = c M[1, 2] = -s M[2, 1