-
Notifications
You must be signed in to change notification settings - Fork 85
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
Multiplication with scalar depend on order #18
Comments
Thanks for opening this issue. I've figured out why I'll have to dig a little more to figure out the array problem, but I'm working on it. |
Issue #18 noted that `5*q` didn't work. I traced this to the altogether terrible line 268 in numpy_quaternion.c. Also found additional errors that this line caused: * `5*q` didn't work * 5.0/q was converted to q/5.0 * 5.0**q was converted to q**5.0 To make this easier to deal with, I added some scalar multiplication, etc., functions to quaternion.h. Also made powers like 1**0, 0**0, etc., consistent with python's behavior. Made sure that all combinations of powers where the base was scalar and exponent was quaternion, etc., work. Added tests for all problems I found.
I think the problem with arrays pointed out in issue #18 resulted from numpy dropping down to functions I didn't expect it to use -- thus enabling functionality I didn't intend to support. My attempt to fix it involves adding the functions explicitly. I hope this is all I need... This basically resolves the issue noted above, but I want to add all the tests I can think of, to make sure nothing like this is still slipping through. Also some formatting changes
I've added lots of tests to check all the (binary) ufuncs. So I'm satisfied that the second problem you pointed out is now also solved. Thanks again for pointing this out, and please let me know if you find any more problems. |
I can confirm that it works now. Thanks! |
Order of multiplication of scalar and quaternion matters. It works fine from right:
But not from left:
Even worse is that if you do this with an array of quaternions, there is no warning, but the result seems to be more or less random.
The text was updated successfully, but these errors were encountered: