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

Method test_minor

linear_algebra/src/test_linear_algebra.py:135–143  ·  view source on GitHub ↗

test for Matrix method minor()

(self)

Source from the content-addressed store, hash-verified

133 assert str(a) == "|1,2,3|\n|2,4,5|\n|6,7,8|\n"
134
135 def test_minor(self) -> None:
136 """
137 test for Matrix method minor()
138 """
139 a = Matrix([[1, 2, 3], [2, 4, 5], [6, 7, 8]], 3, 3)
140 minors = [[-3, -14, -10], [-5, -10, -5], [-2, -1, 0]]
141 for x in range(a.height()):
142 for y in range(a.width()):
143 assert minors[x][y] == a.minor(x, y)
144
145 def test_cofactor(self) -> None:
146 """

Callers

nothing calls this directly

Calls 4

heightMethod · 0.95
widthMethod · 0.95
minorMethod · 0.95
MatrixClass · 0.70

Tested by

no test coverage detected