determinant function det(A) on matrix A = matrix([[0, 0, 4], [2, 0, 3], [0, 0, -3]]) raises
TypeError: '>=' not supported between instances of 'NoneType' and 'int'.
Due to issue in LU_decomp line 143 at ctx.swap_row(A, j, p[j]) according p[j]being none, since A has a zero column.
Many be det should check first if there is any zero column. If so det is zero and LU_decomp is not required any more.
if any(all(almosteq(0,x) for x in A[:,c]) for c in range(A.cols)):
return 0*A[0,0]
determinant function
det(A)on matrixA = matrix([[0, 0, 4], [2, 0, 3], [0, 0, -3]])raisesTypeError: '>=' not supported between instances of 'NoneType' and 'int'.Due to issue in
LU_decompline143atctx.swap_row(A, j, p[j])accordingp[j]being none, sinceAhas a zero column.Many be
detshould check first if there is any zero column. If sodetis zero andLU_decompis not required any more.