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); }
/// <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);
public static BitVector32 BitVector(this IPolyrand random, N32 n) => random.Next <uint>();
public static BitBlock <BitBlock32> ToBitBlock(this BitString src, N32 n) => BitBlock.FromSpan <BitBlock32>(src.BitSeq);
public static BitVector32 ToBitVector(this int src, N32 n) => (uint)src;
public static BitVector32 ToBitVector(this BitString src, N32 n) => BitVector32.FromBitString(src);
public static BitVector32 ToBitVector(this uint src, N32 n) => src;
public static BitVector32 ToBitVector32(this short src, N32 n) => (ushort)src;
public static BitVector32 ToBitVector(this byte src, N32 n) => src;
public static BitVector32 ToBitVector <N, T>(this BitVector <N, T> src, N32 n) where T : unmanaged where N : ITypeNat, new() => src.Data.TakeUInt32();
public static BitMatrix32 BitMatrix(this IPolyrand random, N32 n) => Z0.BitMatrix32.From(random.Array <uint>(32));