Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -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
|
||||
|
|
|
|||
5
Task/Identity-matrix/Nu/identity-matrix.nu
Normal file
5
Task/Identity-matrix/Nu/identity-matrix.nu
Normal 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
|
||||
8
Task/Identity-matrix/Tailspin/identity-matrix-2.tailspin
Normal file
8
Task/Identity-matrix/Tailspin/identity-matrix-2.tailspin
Normal 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..)... -> ', $;';|
|
||||
' !
|
||||
Loading…
Add table
Add a link
Reference in a new issue