Пример #1
0
        public void mod_create()
        {
            var n = new N32();

            var a = Mod.Define(11, n);
            var b = Mod.Define(21, n);
            var c = Mod.Define(0, n);
            var d = a + b;

            Claim.eq(c, d);
        }
Пример #2
0
 /// <summary>
 /// Defines a binary polynomial of natural degree N = 32
 /// </summary>
 /// <param name="degree">The degree of the polynomial</param>
 /// <param name="exponents">The exponent values for nonzero coefficients</param>
 public static GfPoly <N32, ulong> Poly(N32 degree, params byte[] exponents)
 => Poly <N32, ulong>(exponents);
Пример #3
0
 public static BitVector32 BitVector(this IPolyrand random, N32 n)
 => random.Next <uint>();
Пример #4
0
 public static BitBlock <BitBlock32> ToBitBlock(this BitString src, N32 n)
 => BitBlock.FromSpan <BitBlock32>(src.BitSeq);
Пример #5
0
 public static BitVector32 ToBitVector(this int src, N32 n)
 => (uint)src;
Пример #6
0
 public static BitVector32 ToBitVector(this BitString src, N32 n)
 => BitVector32.FromBitString(src);
Пример #7
0
 public static BitVector32 ToBitVector(this uint src, N32 n)
 => src;
Пример #8
0
 public static BitVector32 ToBitVector32(this short src, N32 n)
 => (ushort)src;
Пример #9
0
 public static BitVector32 ToBitVector(this byte src, N32 n)
 => src;
Пример #10
0
 public static BitVector32 ToBitVector <N, T>(this BitVector <N, T> src, N32 n)
     where T : unmanaged
     where N : ITypeNat, new()
 => src.Data.TakeUInt32();
Пример #11
0
 public static BitMatrix32 BitMatrix(this IPolyrand random, N32 n)
 => Z0.BitMatrix32.From(random.Array <uint>(32));