I want to have a numpy array with mpz/mpfr values. Because my code:
import numpy as np
import gmpy2
A=np.ones((5,5));
print A/gmpy2.mpfr(1);
generates:
RuntimeWarning: invalid value encountered in divide
print A/gmpy2.mpfr(1);
[[1.0 1.0 1.0 1.0 1.0]
[1.0 1.0 1.0 1.0 1.0]
[1.0 1.0 1.0 1.0 1.0]
[1.0 1.0 1.0 1.0 1.0]
[1.0 1.0 1.0 1.0 1.0]]
Which as I can understand is the impossibility to convert gmpy mpfr to numpy float64. So how can I get a numpy array with mpfr values in the first place?
Thanks.