There is a good chance I don't understand your problem, but here is my take:
I don't think you want the permutations of the array elements, but instead
want a subset of the Cartesian product of the array with itself. E.G. if
the array is A= [a, b, c], the Cartesian product A x A is
{(a,a), (a,b), (a,c), (b,a), (b,b), (b,c), (c,a), (c,b), (c,c)}. The subset
you want excludes an element whose coords are the same, and considers as
duplicates 2 elements that have the same coords (e.g. (a,b) and (b,a) are
the same).
So, you want {(a,b), (a,c), (b,co)}
If you only have a single array, X, crossed only once with itself,
containing more than one element, some potential pseudo code would be:
for (int i = 0; i < x.Length-1; i++)
{
for (int j = i+1; j < x.Length; j++)
{
myFilterList.Add(x[i].MyToString() + " AND " +
x[j].MyToString())
}
}
In your case, x is the list of KeyValue pairs from the dictionary, and you
need to convert each KeyValue to a string via MyToString(), so as to form a
filter, which you add to a list, myFilterList.
What I don't understand about your example:
You have the same key, Column1 associated with two different values. I
don't think the Dictionary allows this.
> Hi
>
[quoted text clipped - 63 lines]
>
> Thanks
Assimalyst - 30 Nov 2007 19:50 GMT
Thank you Fred.
I think i had confused myself. Not sure I want permutations but rather
combinations.
Your code sample has given me some ideas that i think i can get
working with a bit of expansion.
I'll keep playing with it . . .
By the way, i think you understood my problem exactly. The bit you
didn't understand was just the way i represented it. I didn't have
duplicate keys it was more like
Column1 { 1, 2 }
Column2 { 17 }
Thanks again
On Nov 30, 6:14 pm, "Fred Mellender" <nospamPlease_fred...@gmail.com>
wrote:
> There is a good chance I don't understand your problem, but here is my take:
>
[quoted text clipped - 96 lines]
>
> > Thanks