Esempio n. 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);
        }
Esempio n. 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);
Esempio n. 3
0
 public static BitVector32 BitVector(this IPolyrand random, N32 n)
 => random.Next <uint>();
Esempio n. 4
0
 public static BitBlock <BitBlock32> ToBitBlock(this BitString src, N32 n)
 => BitBlock.FromSpan <BitBlock32>(src.BitSeq);
Esempio n. 5
0
 public static BitVector32 ToBitVector(this int src, N32 n)
 => (uint)src;
Esempio n. 6
0
 public static BitVector32 ToBitVector(this BitString src, N32 n)
 => BitVector32.FromBitString(src);
Esempio n. 7
0
 public static BitVector32 ToBitVector(this uint src, N32 n)
 => src;
Esempio n. 8
0
 public static BitVector32 ToBitVector32(this short src, N32 n)
 => (ushort)src;
Esempio n. 9
0
 public static BitVector32 ToBitVector(this byte src, N32 n)
 => src;
Esempio n. 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();
Esempio n. 11
0
 public static BitMatrix32 BitMatrix(this IPolyrand random, N32 n)
 => Z0.BitMatrix32.From(random.Array <uint>(32));