MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _detME

Function _detME

SLiCAP/SLiCAPmath.py:132–146  ·  view source on GitHub ↗
(M)

Source from the content-addressed store, hash-verified

130 return r, c
131
132def _detME(M):
133 dim = M.shape[0]
134 if dim == 2:
135 D = M[0, 0]*M[1, 1] - M[1, 0]*M[0, 1]
136 else:
137 D = 0
138 for row in range(dim):
139 if M[row, 0] != 0:
140 minor = _detME(M.minor_submatrix(row, 0))
141 if minor != 0:
142 if row % 2:
143 D += -M[row, 0] * minor
144 else:
145 D += M[row, 0] * minor
146 return sp.expand(D)
147
148def _detBS(M):
149 newM = M.copy()

Callers 1

detFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected