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
matrix setitem should deal with slicing #4972
Comments
comment:1
To clarify, I think we should support setting a submatrix (and not just getting a submatrix) using slicing. This will be consistent with numpy, matlab, octave, etc. |
comment:2
Now that #4973 is pretty much done, what we really should do is factor out the bulk of the setup code in getitem and use it for both setitem and getitem. |
comment:3
See #2396, which should probably be closed when this is fixed. |
comment:4
I'm making some changes. I'll post an updated patch soon. |
comment:5
ignore the .2.patch file. I've refreshed the original .patch file. |
comment:6
Attachment: trac_4972-matrix-setitem.patch.gz Refreshed patch to fix some doctests. |
comment:7
That's a lot of doctests; cool! (Maybe some of them should be marked
feels a little awkward... I had to read it twice to figure out what it
would be better? I think it's wrong that this works:
but this raises an exception:
A lot of your variables should have type Py_ssize_t rather than int; Other than that, looks very nice! |
comment:8
the fixups.patch addresses cwitty's concerns. It should be applied on top of trac_4972-matrix-setitem.patch |
comment:9
Attachment: trac_4972-matrix-setitem-fixups.patch.gz grr, forgot to check the "replace" checkbox again. So apply the following: trac_4972-matrix-setitem.patch, then trac_4972-matrix-setitem-fixups.patch Ignore both .2.patch files. This second refresh corrects some "int" cdefs in misc_c.pyx |
comment:10
Code looks good, all doctests pass. Thanks for making the requested changes! Positive review; apply both patches. |
comment:11
Merged both patches in Sage 3.3.alpha6. Cheers, Michael |
The following should work:
Instead, I get an error:
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/4972
The text was updated successfully, but these errors were encountered: