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

Method cofactors

matrix/matrix_class.py:203–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 )
202
203 def cofactors(self) -> Matrix:
204 return Matrix(
205 [
206 [
207 self.minors().rows[row][column]
208 if (row + column) % 2 == 0
209 else self.minors().rows[row][column] * -1
210 for column in range(self.minors().num_columns)
211 ]
212 for row in range(self.minors().num_rows)
213 ]
214 )
215
216 def adjugate(self) -> Matrix:
217 values = [

Callers 2

determinantMethod · 0.95
adjugateMethod · 0.95

Calls 2

minorsMethod · 0.95
MatrixClass · 0.70

Tested by

no test coverage detected