MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test__add__matrix

Method test__add__matrix

linear_algebra/src/test_linear_algebra.py:186–192  ·  view source on GitHub ↗

test for Matrix + operator

(self)

Source from the content-addressed store, hash-verified

184 assert a.component(2, 1) == 7, "0.01"
185
186 def test__add__matrix(self) -> None:
187 """
188 test for Matrix + operator
189 """
190 a = Matrix([[1, 2, 3], [2, 4, 5], [6, 7, 8]], 3, 3)
191 b = Matrix([[1, 2, 7], [2, 4, 5], [6, 7, 10]], 3, 3)
192 assert str(a + b) == "|2,4,10|\n|4,8,10|\n|12,14,18|\n"
193
194 def test__sub__matrix(self) -> None:
195 """

Callers

nothing calls this directly

Calls 1

MatrixClass · 0.70

Tested by

no test coverage detected