Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
operator (A matmul B)
|
||||
$A -> \[i](
|
||||
$B(1) -> \[j](@: 0;
|
||||
1..$B::length -> @: $@ + $A($i;$) * $B($;$j);
|
||||
$@ !\) !
|
||||
\) !
|
||||
end matmul
|
||||
|
||||
templates printMatrix&{w:}
|
||||
templates formatN
|
||||
@: [];
|
||||
$ -> #
|
||||
'$@ -> $::length~..$w -> ' ';$@(last..1:-1)...;' !
|
||||
when <1..> do ..|@: $ mod 10; $ ~/ 10 -> #
|
||||
when <=0?($@ <[](0)>)> do ..|@: 0;
|
||||
end formatN
|
||||
$... -> '|$(1) -> formatN;$(2..last)... -> ', $ -> formatN;';|
|
||||
' !
|
||||
end printMatrix
|
||||
|
||||
def a: [[1, 2, 3], [4, 5, 6]];
|
||||
'a:
|
||||
' -> !OUT::write
|
||||
$a -> printMatrix&{w:2} -> !OUT::write
|
||||
|
||||
def b: [[0, 1], [2, 3], [4, 5]];
|
||||
'
|
||||
b:
|
||||
' -> !OUT::write
|
||||
$b -> printMatrix&{w:2} -> !OUT::write
|
||||
'
|
||||
axb:
|
||||
' -> !OUT::write
|
||||
($a matmul $b) -> printMatrix&{w:2} -> !OUT::write
|
||||
Loading…
Add table
Add a link
Reference in a new issue