Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Identity-matrix/Jq/identity-matrix-1.jq
Normal file
3
Task/Identity-matrix/Jq/identity-matrix-1.jq
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def identity(n):
|
||||
[range(0;n) | 0] as $row
|
||||
| reduce range(0;n) as $i ([]; . + [ $row | .[$i] = 1 ] );
|
||||
1
Task/Identity-matrix/Jq/identity-matrix-2.jq
Normal file
1
Task/Identity-matrix/Jq/identity-matrix-2.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
identity(4)
|
||||
3
Task/Identity-matrix/Jq/identity-matrix-3.jq
Normal file
3
Task/Identity-matrix/Jq/identity-matrix-3.jq
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def identity(n):
|
||||
reduce range(0;n) as $i
|
||||
(0 | matrix(n;n); .[$i][$i] = 1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue