Conjugate gradient solver for JavaScript