Esempio n. 1
0
        /// <summary>
        /// Shuffles bitstring content as determined by a permutation
        /// </summary>
        /// <param name="src">The source span</param>
        /// <param name="p">The permutation to apply</param>
        public static BitString Permute(this BitString src, Perm p)
        {
            var dst = BitString.Alloc(p.Length);

            for (var i = 0; i < p.Length; i++)
            {
                dst[i] = src[p[i]];
            }
            return(dst);
        }