public static int[] GetSetIndices(this UInt64 set) { int[] indices = new int[set.BitCount()]; int count = 0; for (int i = 0; i < MaxSize - 1; i++) { if (set.ContainsIndex(i)) { indices[count] = i; count++; } } return(indices); }