help-octave
[Top][All Lists]
Advanced

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

"inner" product for NDArray "times" Matrix


From: Daniel Heiserer
Subject: "inner" product for NDArray "times" Matrix
Date: Tue, 2 Apr 2013 02:21:51 -0700 (PDT)

Hi,

I haven't used octave for quite a time. However I try now to use the NDArray as "tensors".

The standard "*" matrix-operator is a defacto a "inner tensor product" condensing the neighbouring indices resulting in a rank/dim of "rank(A)+rank(B)-2", where A is the first and B the second operand :

[M x N] * [N x L]= [N x L]

Therefore I expected to get for NDArrays:


[L x M x N]  * [N x O] = [L x M x O] or

[L x M x N]  * [N x 1] = [L x M]

However it does not work as expected:

octave:19> a*c
error: invalid conversion of NDArray to Matrix
octave:19> whos a c
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
       a           2x3x4                      192  double
       c           4x1                         32  double

Total is 28 elements using 224 bytes
 using 224 bytes


Does octave have some "efficient" way for "inner" (and even "outer") products on arbitrary sized matrices?

Best regards, daniel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]