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

Home » Public Forums » archive » Finding all the possible subsets of a given vector
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Finding all the possible subsets of a given vector [message #81187] Mon, 20 August 2012 12:22
moxament is currently offline  moxament
Messages: 26
Registered: April 2008
Junior Member
Hi All,

I have the following question: is there any simple way in IDL which can find all the possible subsets of a vector of n elements starting from subsets with 2 elements until a final subset of n elements (last subset will have all the elements of the given vector). For example:

let A = [1,2, 3, 4] be a given vector. The subsets would be: [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4], [1, 2, 3, 4]. Note that the subsets that have the same elements are assumed equal, although the elements have different sequence: for example [2, 3] and [3, 2] are the same.

Any help is appreciated!

MD
[Message index]
 
Read Message
Previous Topic: Obtain all child widgets
Next Topic: polynomial fitting constrained to be non-decreasing

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

Current Time: Wed Oct 08 14:09:52 PDT 2025

Total time taken to generate the page: 0.00186 seconds