More general Cartesian product

Philippe Sigaud philippe.sigaud at gmail.com
Wed Feb 29 06:24:36 PST 2012


> I have a need for a Cartesian product of multiple ranges. I see there's
been a discussion here (Dec 2011) as well as a request posted (#7128). It
seems to me that the request deals with a multidimensional product -- which
is what I need -- while the implementation by Timon Gehr deals only with
the two-dimensional case.

I have one in a dsource project:

http://www.dsource.org/projects/dranges

It's in the algorithm.d module, look for 'combinations'

Docs are there:

http://svn.dranges.org/projects/dranges/trunk/dranges/doc/algorithm.html

For a generalization of this, you may want to have a look into the
rangeofranges.d module (docs: same than algorithm, or click on the
'package' tab on the left).

I think a .zip is given on the main page.
Alternatively, it's also on github:

www.github.com/PhilippeSigaud/dranges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120229/ac4b7975/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list