0
내 파이썬 코드에서 정기적으로 numpy.allclose
을 사용하여 일부 계산을 확인합니다. 반면에 이러한 검사를 제외하고 구현은 다중 정밀도 (mpmath.mpc
) 숫자를 처리 할 수 있습니다. 나는 mpmath
숫자에 대 한 내 확인 코드를 실행하려면, 나는 두 multiprecision 배열이 충분히 동일한 경우numpy.allclose 및 mpmath와 다중 정밀도
>>> check(H)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "module.py", line 19, in check_H
assert(numpy.allclose(H, I, rtol=rtol, atol=atol))
File "/home/gereon/python/numpy/core/numeric.py", line 2025, in allclose
xinf = isinf(x)
TypeError: ufunc 'isinf' not supported for the input types, and the inputs could
not be safely coerced to any supported types according to the casting rule ''safe''
같은 것이 가장 좋은 방법은 무엇을 확인하는 것입니다거야?