Matrix class bugfix
This commit is contained in:
parent
d45f041551
commit
45929eb414
|
@ -29,7 +29,7 @@ export class Matrix {
|
|||
}
|
||||
|
||||
add(other_matrix: Matrix) {
|
||||
if(!(other_matrix.cols == this.cols && other_matrix.rows == this.cols)) throw Error("Other matrix has more or few rows or columns");
|
||||
if(!(other_matrix.cols == this.cols && other_matrix.rows == this.rows)) throw Error("Other matrix has more or few rows or columns");
|
||||
for(let i=0; i<this.matrix.length; i++) {
|
||||
for(let j=0; j<this.matrix[i].length; j++) {
|
||||
this.matrix[i][j] += other_matrix.matrix[i][j];
|
||||
|
|
Reference in a new issue