From 45929eb414c416d503266eadf9d47a80c699af9e Mon Sep 17 00:00:00 2001 From: Filip Znachor Date: Tue, 4 Oct 2022 22:35:37 +0200 Subject: [PATCH] Matrix class bugfix --- matrix.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix.ts b/matrix.ts index 4c2df49..0f6bcb5 100644 --- a/matrix.ts +++ b/matrix.ts @@ -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