MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / get_minor

Method get_minor

matrix/matrix_class.py:178–188  ·  view source on GitHub ↗
(self, row: int, column: int)

Source from the content-addressed store, hash-verified

176 return bool(self.determinant())
177
178 def get_minor(self, row: int, column: int) -> int:
179 values = [
180 [
181 self.rows[other_row][other_column]
182 for other_column in range(self.num_columns)
183 if other_column != column
184 ]
185 for other_row in range(self.num_rows)
186 if other_row != row
187 ]
188 return Matrix(values).determinant()
189
190 def get_cofactor(self, row: int, column: int) -> int:
191 if (row + column) % 2 == 0:

Callers 2

get_cofactorMethod · 0.95
minorsMethod · 0.95

Calls 2

MatrixClass · 0.70
determinantMethod · 0.45

Tested by

no test coverage detected