Opened 14 years ago

Closed 7 years ago

#4984 closed enhancement (fixed)

Clean up __getitem__ for matrices once Cython is smarter

Reported by: Craig Citro Owned by: William Stein
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

So we currently use several Python/C API calls to speed up the __getitem__ method in sage/matrix/matrix0.pyx. In particular, we do several typechecks against standard Python types, and replacing generic PY_TYPE_CHECK calls with specific Python/C API calls (like PySlice_Check) provides a significant speedup. Once Cython can do all these things for us, we should clean up __getitem__ so that it's more readable/portable.

Alternatively, if such functionality still doesn't exist in Cython, one should feel free to go, implement that functionality, get it merged, create a new Cython spkg, and then make these changes. :)

Change History (4)

comment:1 Changed 14 years ago by Alex Ghitza

Type: defectenhancement

comment:2 Changed 7 years ago by Jeroen Demeyer

Milestone: sage-wishlistsage-duplicate/invalid/wontfix
Report Upstream: N/A
Reviewers: Jeroen Demeyer
Status: newneeds_review

PY_TYPE_CHECK is gone.

comment:3 Changed 7 years ago by Jeroen Demeyer

Status: needs_reviewpositive_review

comment:4 Changed 7 years ago by Volker Braun

Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.