comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » S: Combinatorical Algorithm
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
S: Combinatorical Algorithm [message #4537] Mon, 12 June 1995 00:00
purschke is currently offline  purschke
Messages: 2
Registered: February 1995
Junior Member
i'm looking for an IDL algorithm that, given an array A of e.g. ints, returns
all possible combinations of elements of A with at least 1 element and no
ordering repetition ([1,2,3] is same as [2,3,1] and should be contained only
once in the resulting 2D-Array.

Has anyone out there written anything similar? Or do you know of any IDL
built-in functions that can help to solve this?


Example:

AllCombs([1,2,3]) = [[1,0,0], [2,0,0], [3,0,0], [1,2,0], [1,3,0], [2,3,0], [1,2,3]]
with 0 being a special element that cannot be contained in the input array.



Thanks in advance


Tim Purschke
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Widget data editor
Next Topic: IDL Image-Processing-Routines wanted!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:52:08 PDT 2025

Total time taken to generate the page: 0.00586 seconds