Closed GoogleCodeExporter closed 9 years ago
Fixed imports, better __pow__, fixed residual precision.
But I have problems importing inverse from linalg (needed for negative powers):
Traceback (most recent call last):
File "matrices.py", line 6, in <module>
from linalg import inverse
File "../../mpmath/linalg.py", line 12, in <module>
from matrices import matrix, swap_row, extend, mnorm_1, norm_p
File "/home/one/src/mpmath/svn/mpmath/matrices.py", line 6, in <module>
from linalg import inverse
ImportError: cannot import name inverse
Original comment by Vinzent.Steinberg@gmail.com
on 12 Sep 2008 at 10:44
Attachments:
It should work if you put the import inside the function.
def __pow__(...):
from linalg import inverse
...
Original comment by fredrik....@gmail.com
on 12 Sep 2008 at 10:52
Fixed and tests added.
Is it ok to commit now?
What about a relative extraprec() btw?
Original comment by Vinzent.Steinberg@gmail.com
on 13 Sep 2008 at 11:24
Attachments:
Please go ahead.
It should be sufficient to do extraprec(0, normalize_output=True) and set
mp.prec *=
2 in the function. However, due to a bug in extraprec, the output doesn't
actually
get normalized.
By the way, matrix needs to implement __pow__ so that normalization works.
Original comment by fredrik....@gmail.com
on 13 Sep 2008 at 11:30
http://code.google.com/p/mpmath/source/detail?r=558
Original comment by Vinzent.Steinberg@gmail.com
on 13 Sep 2008 at 11:54
Original issue reported on code.google.com by
Vinzent.Steinberg@gmail.com
on 2 Jul 2008 at 7:58