[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tensor multiplication



Hi,

does anybody out there know an efficient and elegant way (i.e., without
for-loops) 
to implement a tensor multiplication in IDL?

What I mean is this: 
IDL can do a matrix multiplication, e.g. if I do
	c = indgen(3,4)
	d = indgen(4)
then for
	help, c#d 
I get
	LONG ARRAY[3],
and that's what I expect.


But now, when I take one more dimension, like 
	c = indgen(2,3,4)
	d = indgen(4)
then 
	help, c#d 
gives an error! (incompatible matrix dimensions...).
What a would like to get is obviously an 
	ARRAY[2,3]


Does anybody know how?

Daniel

------------------------------------------------------------------------
 Daniel Luebbert
 luebbert@slac.stanford.edu