Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1,10 +1,10 @@
= i. 4 NB. create an Identity matrix of size 4
=i.4 NB. create an Identity matrix of size 4
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
makeI=: =@i. NB. define as a verb with a user-defined name
makeI 5 NB. create an Identity matrix of size 5
Id=: =@i. NB. define as a verb with a user-defined name
Id 5 NB. create an Identity matrix of size 5
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0

View file

@ -0,0 +1,5 @@
def identity-matrix [n: int] {
..<$n | each {|i| ..<$n | each { $in == $i | into int } }
}
..5 | each { {k: $in v: (identity-matrix $in)} } | transpose -r | table -i false -e --flatten

View file

@ -0,0 +1,8 @@
identityMatrix templates
n is $;
[1..$n -> [1..~$ -> 0, 1, $~..$n -> 0]] !
end identityMatrix
identity is 5 -> identityMatrix;
$identity... -> '|$(1);$(2..)... -> ', $;';|
' !