MpcLib.Circuits.PermutationNetwork.Clone C# (CSharp) 메소드

Clone() 공개 메소드

public Clone ( ) : object
리턴 object
        public object Clone()
        {
            var clone = new PermutationNetwork(WireCount);

            Dictionary<Gate, Gate> mapping;

            clone.Circuit = Circuit.Clone(out mapping) as Circuit;

            for (int i = 0; i < WireCount; i++)
            {
                if (FirstGateForWire[i] != null)
                    clone.FirstGateForWire[i] = new InputGateAddress(mapping[FirstGateForWire[i].Gate], FirstGateForWire[i].Port);
                if (LastGateForWire[i] != null)
                    clone.LastGateForWire[i] = new OutputGateAddress(mapping[LastGateForWire[i].Gate], LastGateForWire[i].Port);
            }

            return clone;
        }

Usage Example

예제 #1
0
파일: LPSorting.cs 프로젝트: mahdiz/mpclib
        // Lemma 4.4
        private PermutationNetwork CreateBlockNeighborSorter(int blockBitLength, int borderBitLength, int intraBlockSortQuality)
        {
            PermutationNetwork pn = new PermutationNetwork(1 << K);

            int blockSize  = 1 << blockBitLength;
            int blockCount = 1 << (K - blockBitLength);
            int borderSize = 1 << borderBitLength;

            PermutationNetwork borderSorter = CreateBorderSorter(borderBitLength, intraBlockSortQuality);

            for (int i = 0; i < blockCount - 1; i++)
            {
                pn.AppendNetwork(borderSorter.Clone() as PermutationNetwork, i * blockSize + (blockSize - borderSize));
            }

            return(pn);
        }
All Usage Examples Of MpcLib.Circuits.PermutationNetwork::Clone