Exemple #1
0
 public void create_8x8()
 {
     var src = Random.Stream<ulong>().Take(Pow2.T07).GetEnumerator();
     while(src.MoveNext())
     {
         var m1 = BitMatrix8.From(src.Current);
         var n = new N8();
         var m2 = BitMatrix.Load(n,n, src.Current.ToBytes());
         for(var i=0; i<8; i++)
         for(var j=0; j<8; j++)
             Claim.eq(m1[i,j], m2[i,j]);
     }
 }
Exemple #2
0
 /// <summary>
 /// Defines a binary polynomial of natural degree N = 8
 /// </summary>
 /// <param name="degree">The degree of the polynomial</param>
 /// <param name="exponents">The exponent values for nonzero coefficients</param>
 public static GfPoly <N8, ushort> Poly(N8 degree, params byte[] exponents)
 => Poly <N8, ushort>(exponents);
Exemple #3
0
 public static BitVector8 BitVector(this IPolyrand random, N8 n)
 => random.Next <byte>();
Exemple #4
0
 public static BitBlock <BitBlock8> ToBitBlock(this BitString src, N8 n)
 => BitBlock.FromSpan <BitBlock8>(src.BitSeq);
Exemple #5
0
 public static BitVector8 ToBitVector(this BitString src, N8 n)
 => BitVector8.FromBitString(src);
Exemple #6
0
 public static BitVector8 ToBitVector(this ushort src, N8 n)
 => (byte)src;
Exemple #7
0
 public static BitVector8 ToBitVector(this byte src, N8 n)
 => src;
Exemple #8
0
 public static BitVector8 ToBitVector(this sbyte src, N8 n)
 => (byte)src;
Exemple #9
0
 public static BitMatrix8 BitMatrix(this IPolyrand random, N8 n)
 => Z0.BitMatrix8.From(random.Next <ulong>());