#19870: Cythonize matrix group elements
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: tscrim
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-7.0
Component: cython | Resolution:
Keywords: matrix group, | Merged in:
elements | Reviewers:
Authors: Travis Scrimshaw | Work issues:
Report Upstream: N/A | Commit:
Branch: | 11109267de4a9eee93b6a32126ff253e485f1910
public/groups/cythonize_matrix_group_element-19870| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
For `MatrixGroupElement_generic` the `__invert__` is very bad since it
actually '''does''' a copy. If you have a matrix over `ZZ` its inverse
belongs to matrices over `QQ`.
{{{
sage: m = matrix(3, [6, -1, -22, -5, 1, 18, -2, -4, 17])
sage: m.inverse().parent()
Full MatrixSpace of 3 by 3 dense matrices over Rational Field
}}}
Hence it would be better to use `change_ring` before the wrapping.
On the other hand there exists `_invert_unit()`. Compare
{{{
sage: m = matrix(3, [6, -1, -22, -5, 1, 18, -2, -4, 17])
sage: %timeit m.inverse().change_ring(ZZ)
10000 loops, best of 3: 53.7 µs per loop
sage: %timeit m._invert_unit()
100000 loops, best of 3: 6.56 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/19870#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.