[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tensor multiplication
- Subject: tensor multiplication
- From: Daniel Luebbert <luebbert(at)slac.stanford.edu>
- Date: Wed, 17 May 2000 15:51:43 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: SSRL/SLAC
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:19662
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