Beispiel #1
0
        Task <uint[]> Collect(uint[] state, ulong width, int points)
        {
            return(Task.Factory.StartNew((Func <uint[]>)(() =>
            {
                var dst = MemorySpan.Alloc <uint>(points);

                var src = Z0.Rng.XOr128((ReadOnlySpan <uint>)state);
                var subseq = RngX.SubSeq <uint>(src, (int)Pow2.T14, (ulong)width, (int)points);
                var total = BigInteger.Zero;

                for (var i = 0; i < points; i++)
                {
                    (var idx, var value) = subseq[i];
                    total += idx;

                    print(appMsg($"src[{i.ToString().PadLeft(3,'0')}:{total.ToString().PadLeft(12,'0')}] = {value.FormatHex()}"));
                }

                return dst;
            })));
        }
Beispiel #2
0
 public static BitMatrix8 From(byte row0, byte row1, byte row2, byte row3, byte row4, byte row5, byte row6, byte row7)
 => new BitMatrix8(MemorySpan.From(row0, row1, row2, row3, row4, row5, row6, row7));
Beispiel #3
0
 public static Matrix <M, N, T> Alloc <M, N, T>(M m = default, N n = default, T exemplar = default)
     where M : ITypeNat, new()
     where N : ITypeNat, new()
     where T : unmanaged
 => new Matrix <M, N, T>(MemorySpan.Alloc <T>(nati <M>() * nati <N>()));
Beispiel #4
0
 public static Vector <T> Alloc <T>(int minlen, T?fill = null)
     where T : unmanaged
 => new Vector <T>(MemorySpan.Alloc <T>(minlen, fill));