Here is function, that I use the list of permutations:
public static IEnumerable
{
if (list.Count() == 1)
return new List
return list.Select((a, i1) => Permute(
list.Where((b, i2) => i2 != i1)).Select(
b => (new List
).SelectMany(c => c);
}
I use it in the following way:
var SFP_vars = Permute(SFP);
Where SFP is array of bytes:
byte[] SFP = new byte[7] { 0, 1, 2, 3, 4, 5, 6 };
There is other variable:
List
Now my question: How to assign the value of SFP_vars to lst_SFP ?
lst_SFP = SFP_vars.ToList() doesn't work.
Thanks in advance.
Pavel.

VulpesPosted Sep 20, 2012, 4:47 AM
PavelPosted Sep 20, 2012, 5:23 AM
VulpesPosted Sep 20, 2012, 5:08 AM
Without doing any actual testing, my guess would be that the second variant is slightly slower than the first because there's an extra method call, but the difference should be negligible.
PavelPosted Sep 20, 2012, 5:00 AM
PavelPosted Sep 20, 2012, 4:34 AM
One question (just for curiosity) - for what usage the function ToList() stands for ?
The SFP_vars is sequence of objects of type byte[]. The variable lst_SFP is the list of the objects of the same type. Why simple conversion isn't possible and therefore one need to employ a loop ?
VulpesPosted Sep 20, 2012, 4:23 AM