September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
8
Task/Matrix-arithmetic/Jq/matrix-arithmetic-4.jq
Normal file
8
Task/Matrix-arithmetic/Jq/matrix-arithmetic-4.jq
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Requires lup/0
|
||||
def det:
|
||||
def product_diagonal:
|
||||
. as $m | reduce range(0;length) as $i (1; . * $m[$i][$i]);
|
||||
def tidy: if . == -0 then 0 else . end;
|
||||
lup
|
||||
| (.[0]|product_diagonal) as $l
|
||||
| if $l == 0 then 0 else $l * (.[1]|product_diagonal) | tidy end ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue