public void AndNot64() { var lhs = Random.BitMatrix64(); var rhs = lhs.Replicate(); Claim.yea(lhs.AndNot(rhs).IsZero()); }
void CycleColExtract64(int cycles = DefaltCycleCount) { for (var j = 0; j < cycles; j++) { var src = Random.BitMatrix64(); for (var c = 0; c < src.ColCount; c++) { var col = src.ColVector(c); for (var r = 0; r < src.RowCount; r++) { Claim.eq(col[r], src[r, c]); } } } }
public void eq64() { var x = Random.BitMatrix64(); var y = Random.BitMatrix64(); Claim.nea(x.Equals(y)); Claim.nea(x == y); Claim.yea(x != y); Claim.yea(x.Equals(x)); Claim.yea(x == x); Claim.yea(y.Equals(y)); Claim.yea(y == y); }
void bmm_64x64x64() { var Aup = Matrix.Alloc <N64, byte>(); var Bup = Matrix.Alloc <N64, byte>(); var Cup = Matrix.Alloc <N64, byte>(); var A = Random.BitMatrix64(); var B = Random.BitMatrix64(); var C = A * B; BitMatrix.unpack(A, ref Aup); BitMatrix.unpack(B, ref Bup); IntMatrix.mul(Aup, Bup, ref Cup); Cup.Apply(x => even(x) ? (byte)0 : (byte)1); Trace(C.Format()); Trace(Cup.Format()); }
public void bmm_64x64_bench() { var opcount = RoundCount * CycleCount; var last = BitMatrix64.Zero; var sw = stopwatch(false); for (var i = 0; i < opcount; i++) { var m1 = Random.BitMatrix64(); var m2 = Random.BitMatrix64(); sw.Start(); last = BitMatrixOps.Mul(m1, m2); sw.Stop(); } Collect((opcount, snapshot(sw), "bmm_64x64")); }
public void bmv_64x64x8() { for (var sample = 0; sample < SampleSize; sample++) { var A = Random.BitMatrix64(); var x = Random.BitVector64(); var z = A * x; var y = BitVector64.Alloc(); for (var i = 0; i < A.RowCount; i++) { var r = A.RowVector(i); y[i] = r % x; } Claim.yea(z == y); } }
public void flip64() { var x = Random.BitMatrix64(); var y = x.Replicate(); var xff = -(-x); Claim.yea(xff == y); var c = Random.BitMatrix64(); var a = new ulong[64]; for (var i = 0; i < 64; i++) { a[i] = ~c.RowData(i); } var b = BitMatrix64.From(a); Claim.yea(b == -c); }
public void bm_unpack_64x64x64_64x64x64() { var dst = Matrix.Alloc <N64, ulong>(); var m = dst.ColCount; var n = dst.RowCount; for (var sample = 0; sample < SampleSize; sample++) { var src = Random.BitMatrix64(); BitMatrix.unpack(src, ref dst); for (var i = 0; i < m; i++) { for (var j = 0; j < n; j++) { Claim.eq(src[i, j], dst[i, j] == 0 ? Bit.Off : Bit.On); } } } }