#16683: fast gray code for integer vectors
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/16683 | 9d90d4873303b1e91ef6bbcaf3fe7250dff38d3c
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Hi Nathan,
Thanks for having a look!
For 1), what do you mean? There are plenty of `int *`. Actually I do not
care at this stuff as a Cython class. With enough motivation I would write
a pure C file. In concrete situation I have in mind, this will mostly be
call through `set_next_switch` which gives me a pair of integers
`(pos,incr)`.
For 2), I guess that the answer is no. The objective is '''not''' to
iterate naively over integer vectors but to use it where the datastructure
is complicated or huge and you want to minimize the number of changes
(using the lexicographic enumeration would be a nightmare as you need to
care about which entries did change). A concrete examples is given by
echelon matrices:
- you enumerate pivots (shoud be a gray code to)
- for choice of pivots you iterate over all possibilities for certain
entries. For that step, changing one entry at a time instead of all of
them is definitely a gain!
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16683#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.