Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem mixing mpc and numpy arrays #40

Closed
GoogleCodeExporter opened this issue May 5, 2015 · 1 comment
Closed

Problem mixing mpc and numpy arrays #40

GoogleCodeExporter opened this issue May 5, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

See http://groups.google.com/group/sympy/browse_thread/thread/c2f5936bc59faf24

There are various places where NotImplementedError should be raised instead
of TypeError.

Original issue reported on code.google.com by fredrik....@gmail.com on 18 May 2008 at 12:12

@GoogleCodeExporter
Copy link
Author

This should work now.

>>> import scipy as sp
>>> from mpmath import *
>>> a = sp.array(([mpc(1), mpc(2), mpc(3)],[mpc(4), mpc(5), mpc(6)]))
>>> b = a.copy()
>>> pivot = mpc(0-0.5j)
>>> for i in range(2):
...     a[0,i] -= pivot*a[0,i]
...
>>> print a
[[(1.0 + 0.5j) (2.0 + 1.0j) (3.0 + 0.0j)]
 [(4.0 + 0.0j) (5.0 + 0.0j) (6.0 + 0.0j)]]
>>> print b
[[(1.0 + 0.0j) (2.0 + 0.0j) (3.0 + 0.0j)]
 [(4.0 + 0.0j) (5.0 + 0.0j) (6.0 + 0.0j)]]
>>> b[0,0:2] -= pivot*b[0,0:2]
>>> print b
[[(1.0 + 0.5j) (2.0 + 1.0j) (3.0 + 0.0j)]
 [(4.0 + 0.0j) (5.0 + 0.0j) (6.0 + 0.0j)]]

Original comment by fredrik....@gmail.com on 22 Aug 2008 at 11:01

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant