Esempio n. 1
0
        public void create7x7()
        {
            var m1 = BitMatrix.Alloc<N7,byte>();
            m1.Fill(Bit.On);
            var fmt = m1.Format().RemoveWhitespace();
            Claim.eq(7*7, fmt.Length);
            var d = m1.Diagonal();
            var x = BitVector.Alloc<N7,byte>();
            x.Fill(Bit.On);

            Claim.yea(d == x);                        
        }
Esempio n. 2
0
 /// <summary>
 /// Allocates a generic bitvector
 /// </summary>
 /// <param name="len">The length</param>
 /// <param name="fill">The fill value</param>
 /// <typeparam name="N">The length type</typeparam>
 /// <typeparam name="T">The component type</typeparam>
 public static BitVector <T> Alloc <T>(BitSize len, T?fill = null)
     where T : unmanaged
 => BitVector <T> .Alloc(len, fill);
Esempio n. 3
0
 /// <summary>
 /// Allocates a generic bitvector of natural length
 /// </summary>
 /// <param name="len">The length</param>
 /// <param name="fill">The fill value</param>
 /// <typeparam name="N">The length type</typeparam>
 /// <typeparam name="T">The component type</typeparam>
 public static BitVector <N, T> Alloc <N, T>(N len = default, T?fill = null)
     where N : ITypeNat, new()
     where T : unmanaged
 => BitVector <N, T> .Alloc(fill);