export type RawMatrix = number[][]; export class Matrix { rows!: number; cols!: number; matrix!: RawMatrix; static zero(rows: number, cols: number) { let matrix: RawMatrix = []; for(let i=0; i pivot_index) pivot_index = j; } else if(pivot_index >= j) return false; } pivot_index++; } return true; } pivots() { let pivots: number[] = []; for(let i=0; i c + n*matrix[v_offset][j]); } } return this.matrix; } mul_row(index: number, number: number, replace: boolean = false) { let row = this.matrix.matrix[index].map(original => number * original); if(replace) this.matrix.matrix[index] = row; return row; } }