Matrix multiplication: Difference between revisions
Content added Content deleted
Line 3,569: | Line 3,569: | ||
$n,$m,$p = ($a.Count - 1), ($b.Count - 1), ($b[0].Count - 1) |
$n,$m,$p = ($a.Count - 1), ($b.Count - 1), ($b[0].Count - 1) |
||
if ($a[0].Count -ne $b.Count) {throw "Multiplication impossible"} |
if ($a[0].Count -ne $b.Count) {throw "Multiplication impossible"} |
||
$c = @(0)*($ |
$c = @(0)*($a[0].Count) |
||
foreach ($i in 0..$n) { |
foreach ($i in 0..$n) { |
||
$c[$i] = foreach ($j in 0..$p) { |
$c[$i] = foreach ($j in 0..$p) { |