>>> from mpmath import mp, matrix
>>> mp.pretty = False
>>> null_matrix = matrix(0)
>>> null_matrix
matrix(
])
>>> mp.pretty = True
>>> null_matrix
>>> null_matrix = matrix(0, 2)
>>> null_matrix
>>> mp.pretty = False
>>> null_matrix
matrix(
])
>>> null_matrix = matrix(2, 0)
>>> null_matrix
matrix(
],
]])
>>> mp.pretty = True
>>> null_matrix
[]
[]
>>> mp.det(matrix(0, 0))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python\Python310\lib\site-packages\mpmath\matrices\linalg.py", line 545, in det
R, p = ctx.LU_decomp(A)
File "C:\Python\Python310\lib\site-packages\mpmath\matrices\linalg.py", line 125, in LU_decomp
tol = ctx.absmin(ctx.mnorm(A,1) * ctx.eps) # each pivot element has to be bigger
File "C:\Python\Python310\lib\site-packages\mpmath\matrices\matrices.py", line 997, in mnorm
return max(ctx.fsum((A[i,j] for i in xrange(m)), absolute=1) for j in xrange(n))
ValueError: max() arg is an empty sequence
The 0 × n matrix should be converted to repr string as matrix(0, n).
The n × 0 matrix should be converted to repr string as matrix(n, 0).
The determinant of the 0×0 matrix should be 1.
The 0 × n matrix should be converted to repr string as
matrix(0, n).The n × 0 matrix should be converted to repr string as
matrix(n, 0).The determinant of the 0×0 matrix should be 1.