update
authorNils Forssén <forssennils@gmail.com>
Tue, 8 Feb 2022 10:10:26 +0000 (11:10 +0100)
committerNils Forssén <forssennils@gmail.com>
Tue, 8 Feb 2022 10:10:26 +0000 (11:10 +0100)
laboration3/uppgift_2.py

index ae7af5229bbdfd6308479c111e4a2ca134470a53..fafc5f66023d8bad22350688dec27578593d664d 100644 (file)
@@ -68,8 +68,8 @@ def matrix_square(matrix):
     cols = get_all_columns(matrix)
 
     for i in range(len(matrix)):
-        for row in matrix:
-            tot[i].append(scalar_product(row, cols[i]))
+        for col in cols:
+            tot[i].append(scalar_product(col, matrix[i]))
 
     return tot