gauss-jordan
v1.3.2
Published
Gauss Jordan Elimination
Downloads
68
Readme
Gauss Jordan
Usage
const input = [
[3, 1, 4, 1],
[5, 2, 6, 5],
[0, 5, 2, 1],
];
const p = new PrimeField(modulus);
const m = new Matrix(input.length, input[0].length, p);
for (let i = 0; i < input.length; i++)
for (let j = 0; j < input[i].length; j++) {
m.set(i, j, input[i][j]);
}
console.log(m.reducedRowEchelonForm());
/* expect:
[
[1, 0, 0, 4],
[0, 1, 0, 3],
[0, 0, 1, 0],
]
*/
Installation
node.js
yarn add gauss-jordan
unpkg
<script src="https://unpkg.com/[email protected]/dist/gauss-jordan.min.js"></script>