Detailed documentation and unit tests can be found in the docs and tests directories of this repository.
// solve the linear system Ax = b, where A is a square sparse matrix let A = SparseMatrix.identity(5, 5); let b = DenseMatrix.ones(5, 1); let lu = A.lu(); let x = lu.solveSquare(b); b.scaleBy(5); x = lu.solveSquare(b); // factorization is reused
- Clone this repository
git clone https://github.com/rohan-sawhney/linear-algebra-js.git
- Include the files in the src directory in your browser or node js code.