This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## module gaussElimin | |
''' x = gaussElimin(a,b). | |
Solve[a]{b} = {x} by gauss elimination. | |
''' | |
import numpy as np | |
def gaussElimin(a,b): | |
n = len(b) | |
#Elmination Phase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* filter(f, iter) { | |
for (const a of iter) if (f(a)) yield a; | |
} | |
function* take(limit, iter) { | |
for (const a of iter) if (limit--) yield a; | |
} | |
const head = iter => take(1, iter).next().value; |