[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-apl] tensor product
From: |
Fausto Saporito |
Subject: |
[Bug-apl] tensor product |
Date: |
Wed, 20 May 2015 15:31:12 +0200 |
Hello all,
I don't understand why the tensor product in APL (∘.×) between two
matrices, gives a multidimensional array as result.
>From linear algebra, tensor product (or kronecker product) gives a
matrix as result,
for example
if I2 is identity matrix
1 0
0 1
I2 (tensor product) I2 gives
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
instead if I use the APL operator I have :
1 0
0 1
0 0
0 0
0 0
0 0
1 0
0 1
the result is correct but why the shape is different ?
Is there a way to have a behaviour similar to linear algebra result ?
I wrote a generic tensor product function, but I'm not happy because
it uses loops and I don't like APL with loops :) but I didn't figure
out a loopless solution.
thanks,
Fausto
- [Bug-apl] tensor product,
Fausto Saporito <=