[Numpy-discussion] Extracting all the possible combinations of a grid

Charles R Harris charlesr.harris@gmail....
Fri Sep 21 14:57:25 CDT 2007


On 9/21/07, Charles R Harris <charlesr.harris@gmail.com> wrote:
>
>
>
> On 9/21/07, Gael Varoquaux <gael.varoquaux@normalesup.org> wrote:
> >
> > Hi all,
> >
> > I want to generate all the possible triplets of integers in [0, n]. I am
> > wondering want the best possible way to do this is.
> >
> > To make things clearer, I could generate i, j, k using indices:
> >
> > i, j, k = indices((n, n, n))
> >
> > But I will have several times the same triplet with different ordenings.
> > I am looking for a loop-free way of creating three arrays i, j, k with
> > all the triplets present once, and only once.
> >
> > Any hint appreciated.
>
>
> Go here, http://www.cs.utsa.edu/~wagner/knuth/<http://www.cs.utsa.edu/%7Ewagner/knuth/>.
> I think you want fascicle 4A,
> http://www.cs.utsa.edu/~wagner/knuth/fasc4a.pdf<http://www.cs.utsa.edu/%7Ewagner/knuth/fasc4a.pdf>.
> Some of the fascicles from Vol 4 of TAOCP are now in print,
> http://tinyurl.com/2goxpr.
>

Oops, make that fascicle 3A, not 4A.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070921/e4f8d760/attachment.html 


More information about the Numpy-discussion mailing list