Skip to content

Instantly share code, notes, and snippets.

@baruchel
Last active August 29, 2015 13:57
Show Gist options
  • Save baruchel/9416637 to your computer and use it in GitHub Desktop.
Save baruchel/9416637 to your computer and use it in GitHub Desktop.
Pivot de Gauss
pivot = (
lambda m:
(lambda f: (lambda x: x(x))(lambda y: f(lambda *args: y(y)(*args))))
(lambda g:
(lambda h,n:
g(
(lambda i:
[
[ z - y[n]*i[n][k]/i[n][n] for k,z in enumerate(y) ]
if x!=n else
[ z/i[n][n] for z in y ]
for x,y in enumerate(i) ]
)
( sorted(h,key=lambda l: [abs(x) for x in l], reverse=True) ),
n+1
) if n < len(h) else h
)
)
(m, 0)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment