Kronecker product: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
Line 3,669: Line 3,669:
</pre>
</pre>



=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.7}}
≪ DUP SIZE LIST→ DROP 4 ROLL DUP SIZE LIST→ DROP → b p q a m n
≪ {} m p * + n q * + 0 CON
1 m p * FOR row
1 n q * FOR col
a {} row 1 - p / IP 1 + + col 1 - q / IP 1 + + GET
b {} row 1 - p MOD 1 + + col 1 - q MOD 1 + + GET
* {} row + col + SWAP PUT
NEXT
NEXT
≫ ≫
´KROKR´ STO

[[1, 2], [3, 4]] [[0, 5], [6, 7]] KROKR
[[0, 1, 0], [1, 1, 1], [0, 1, 0]] [[1, 1, 1, 1], [1, 0, 0, 1], [1, 1, 1, 1]] KROKR
{{out}}
<pre>
2: [[ 0 5 0 10 ]
[ 6 7 12 14 ]
[ 0 15 0 20 ]
[ 18 21 24 28 ]]
1: [[ 0 0 0 0 1 1 1 1 0 0 0 0 ]
[ 0 0 0 0 1 0 0 1 0 0 0 0 ]
[ 0 0 0 0 1 1 1 1 0 0 0 0 ]
[ 1 1 1 1 1 1 1 1 1 1 1 1 ]
[ 1 0 0 1 1 0 0 1 1 0 0 1 ]
[ 1 1 1 1 1 1 1 1 1 1 1 1 ]
[ 0 0 0 0 1 1 1 1 0 0 0 0 ]
[ 0 0 0 0 1 0 0 1 0 0 0 0 ]
[ 0 0 0 0 1 1 1 1 0 0 0 0 ]]
</pre>


=={{header|Rust}}==
=={{header|Rust}}==