#4972: [with patch, needs work] matrix setitem should deal with slicing
----------------------------+-----------------------------------------------
Reporter: jason | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.3
Component: linear algebra | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Changes (by cwitty):
* summary: [with patch, needs review] matrix setitem should deal with
slicing => [with patch, needs work] matrix
setitem should deal with slicing
Comment:
That's a lot of doctests; cool! (Maybe some of them should be marked
as TESTS:, in case we ever get around to having that mean something...)
{{{
key -- any legal indexing (i.e., self[key] works)
}}}
feels a little awkward... I had to read it twice to figure out what it
meant. Maybe
{{{
key -- any legal indexing (i.e., such that self[key] works)
}}}
would be better?
I think it's wrong that this works:
{{{
sage: M = matrix(3, 2, srange(6)); M[1] = 15; M
}}}
but this raises an exception:
{{{
sage: M = matrix(3, 1, srange(3)); M[1] = 15; M
}}}
A lot of your variables should have type Py_ssize_t rather than int;
your current code will give very wrong results on matrices with more
than 2^31^ rows or columns (which could happen on a 64-bit machine).
Other than that, looks very nice!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4972#comment:7>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---