Re: [Numpy-discussion] sum of outer products

2010-09-20 Thread Hagen Fürstenau
>> X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} > > (A[:,newaxis,newaxis]*B[newaxis,:,newaxis]*C[newaxis,newaxis,:]).sum(axis=-1) Thanks for the quick solution and practical exercise in broadcasting! :-) However, this creates a temporary 4-array, right? Is there a way of avoiding this memory requireme

Re: [Numpy-discussion] sum of outer products

2010-09-20 Thread Pauli Virtanen
Mon, 20 Sep 2010 23:34:58 +0200, Hagen Fürstenau wrote: > I don't know if I'm overlooking something obvious, but is there a > compact way of computing the 3-array > > X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} > > out of the 2-arrays A, B, and C? (A[:,newaxis,newaxis]*B[newaxis,:,newaxis]*C[newaxis

[Numpy-discussion] sum of outer products

2010-09-20 Thread Hagen Fürstenau
Hi, I don't know if I'm overlooking something obvious, but is there a compact way of computing the 3-array X_{ijk} = \sum_{l} A_{il}*B_{jl}*C_{kl} out of the 2-arrays A, B, and C? - Hagen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org h