#16617: simple echelon matrix iterator
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: linear algebra | Resolution:
Keywords: matrix | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/16617 | f3cc9b7a9979e164565df53fa11dd6f8647a6ee9
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:
Old description:
> The iteration over subspaces over a given vector space takes infinite
> time (mainly because of complicated constructor in classes). We create an
> external "echelon_matrix_iterator" to be used for faster iteration...
>
> More than incredible:
> {{{
> sage: from sage.matrix.echelon_matrix import echelon_matrix_iterator
> sage: timeit("for m in echelon_matrix_iterator(GF(3),5,3): pass")
> 125 loops, best of 3: 1.49 ms per loop
> sage: timeit("for _ in VectorSpace(GF(3),5).subspaces(3): pass")
> 5 loops, best of 3: 346 ms per loop
> }}}
New description:
The iteration over subspaces over a given vector space takes infinite time
(mainly because of complicated constructor in classes). We create an
external "echelon_matrix_iterator" to be used for faster iteration...
More than incredible:
{{{
sage: from sage.matrix.echelon_matrix import echelon_matrix_iterator
sage: timeit("for m in echelon_matrix_iterator(GF(3),3,5): pass")
125 loops, best of 3: 3.01 ms per loop
sage: timeit("for _ in VectorSpace(GF(3),5).subspaces(3): pass")
5 loops, best of 3: 346 ms per loop
}}}
And there even a "faster" mode which avoids copy
{{{
sage: timeit("for m in echelon_matrix_iterator(GF(3),3,5,copy=False):
pass")
625 loops, best of 3: 392 µs per loop
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/16617#comment:3>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.