Beispiel #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]);
     }
 }
Beispiel #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);
Beispiel #3
0
 public static BitVector8 BitVector(this IPolyrand random, N8 n)
 => random.Next <byte>();
Beispiel #4
0
 public static BitBlock <BitBlock8> ToBitBlock(this BitString src, N8 n)
 => BitBlock.FromSpan <BitBlock8>(src.BitSeq);
Beispiel #5
0
 public static BitVector8 ToBitVector(this BitString src, N8 n)
 => BitVector8.FromBitString(src);
Beispiel #6
0
 public static BitVector8 ToBitVector(this ushort src, N8 n)
 => (byte)src;
Beispiel #7
0
 public static BitVector8 ToBitVector(this byte src, N8 n)
 => src;
Beispiel #8
0
 public static BitVector8 ToBitVector(this sbyte src, N8 n)
 => (byte)src;
Beispiel #9
0
 public static BitMatrix8 BitMatrix(this IPolyrand random, N8 n)
 => Z0.BitMatrix8.From(random.Next <ulong>());