11.11.2017, 23:38, "Erling Hellenäs" <[email protected]>: > Now when we are in bitmap representation, anyone can find a trick to > generate the next combination in some way similar to what I describe here? > http://www.jsoftware.com/pipermail/programming/2017-November/049551.html > With real bitmaps I mean. By manipulating the bits in integers. Not with > booleans as in my post.
This is probably not exactly what you mean, but one way to get the next k-combination with bit operations is "Gosper's hack". It is described on this Wikipedia page: https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications - Ivan > See also: "Bitwise reduction and scan" here: > http://code.jsoftware.com/wiki/Vocabulary/bslash > Ideally we would like to generate the next combination in one assembler > instruction, or even less, since there are wide registers that could > possibly hold many sets. You could also possibly operate on many such > registers with one assembler instruction. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
