Jump to content

Gauss-Jordan matrix inversion: Difference between revisions

→‎{{header|jq}}: matrix(1;_;_)
(→‎{{header|jq}}: matrix(1;_;_))
Line 2,427:
# it being understood that:
# matrix(0; _; _) evaluates to []
# matrix(1; n; _) evaluates to a flat array of length n
def matrix(m; n; init):
if m == 0 then []
elif m == 1 then [[range(0;n) | init]]
elif m > 0 then
matrix[range(10;n;) | init)] as $row
| [range(0;m) | $row ]
else error("matrix\(m);_;_) invalid")
2,502

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.