# [Numpy-discussion] funny matrix product calculation

Sun Sep 14 12:50:53 CDT 2008

```Not a supper efficient solution, but mat sill may work:

dot(A, B*x[:,None])
or
dot(A*x, B)

-----הודעה מקורית-----
מאת: numpy-discussion-bounces@scipy.org בשם Robin
נשלח: א 14-ספטמבר-08 20:01
אל: Discussion of Numerical Python
נושא: [Numpy-discussion] funny matrix product calculation

Hi,

I am trying to compute the following (with summation convention):

A_{ij} B_{jm} x_{j}

where A and B are non-square arrays (in fact B=A^T) and x is a vector.
I'm actually not sure if it's valid to have 3 summation indices as
above - but I'm pretty sure that's what I want... So it's kind of
matric multiplication, but I want another vector dot'ed into the sum.

How can I implement this efficiently in numpy/scipy? I'm having
trouble breaking it down to vectorised operations. I suppose I could
try a loop in Cython but I was hoping there might be a tricky numpy
solution.

Thanks

Robin
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3296 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080914/279f98aa/attachment.bin
```