Exemple #1
0
 def test_multiplication_4d_second(self):
     multiplication_4d_second = matrix_product(second_4d, first_4d)
     self.assertEqual(multiplication_4d_second,
                      [[77, -70, -78, -70], [93, -141, 52, 159],
                       [-26, 47, 68, 77], [91, -68, 38, -8]])
Exemple #2
0
 def test_multiplication_4d_first(self):
     multiplication_4d_first = matrix_product(first_4d, second_4d)
     self.assertEqual(multiplication_4d_first,
                      [[129, -103, 37, -120], [36, -79, 21, 5],
                       [24, 107, -81, -73], [32, -66, 156, 27]])
Exemple #3
0
 def test_multiplication_3d_second(self):
     multiplication_3d_second = matrix_product(second_3d, first_3d)
     self.assertEqual(multiplication_3d_second,
                      [[22, 19, 17], [8, -14, -12], [6, 6, 12]])
Exemple #4
0
 def test_multiplication_3d_first(self):
     multiplication_3d_first = matrix_product(first_3d, second_3d)
     self.assertEqual(multiplication_3d_first,
                      [[20, 1, 11], [8, 5, 17], [22, 7, -5]])
Exemple #5
0
 def test_multiplication_2d_second(self):
     multiplication_2d_second = matrix_product(second_2d, first_2d)
     self.assertEqual(multiplication_2d_second, [[22, 35], [41, 65]])
Exemple #6
0
 def test_multiplication_2d_first(self):
     multiplication_2d_first = matrix_product(first_2d, second_2d)
     self.assertEqual(multiplication_2d_first, [[76, 29], [29, 11]])