Here’s my attempt at a constructive approach. In haste, as Liz wants
to get away from this WiFi spot! So no time for explanation... and I
haven’t had an opportunity to digest Erland’s improvement to my
improvement to Lippa Esu’s verb. Sorry for brevity.
constructpart =: 3 : 0
:
d =. y
m
Here's the reasonably constructive approach.
Much better than my earlier effort at a constructive approach,
but it still generates too much redundancy as x approaches y
for larger y. Limited time to do email, so in a bit of a rush...
NB. Generate non-zero partitions of y size x
3 mpart 5
Erling Helenas, Raul Miller, and others have come up with various
methods to generate subsets of “restricted generating functions” (RGFs)
suitable for the production of partitions of sets. Several of these
have used Ruskey’s algorithm.
I’ve found a fairly simple approach which has the benefi
That problem took a lot of reading!
Like you, Brian, I started with the boustrophedon cycles:
example NB. my data has 2 rows: depth,: range:
0 1 4 6
3 2 4 4
(Brian forms the data into a simple vector of ranges
3 2 0 0 4 0 4 )
My verb, cycle, is used to assemble a look-up table of scan po
Thanks - so, knowing solution was possible in seconds, I cleaned up my
approach, also using blocks, but specifiying their size in advance.
Rather surprisingly, it's somewhat faster than Raul's - maybe because
it
keeps more constant data between block-loops.
It uses that property I tried e