CreateButterflyTournament() public static method

public static CreateButterflyTournament ( int wireCount ) : PermutationNetwork
wireCount int
return PermutationNetwork
Ejemplo n.º 1
0
        // Lemma 4.2
        private PermutationNetwork CreateTournament(int sortInaccuracy)
        {
            PermutationNetwork pn = new PermutationNetwork(1 << K);

            int blockSize = 1 << sortInaccuracy;

            // for the permutation rho
            PermutationGate permuteGate = new PermutationGate(GenerateArbitraryPermutation(blockSize));

            pn.AppendGate(permuteGate.Copy() as Gate, 0);
            pn.AppendNetwork(SortingNetworkFactory.CreateButterflyTournament(blockSize), 0);
            return(pn);
        }