public void AndNot8() { var lhs = Random.BitMatrix8(); var rhs = lhs.Replicate(); Claim.yea(lhs.AndNot(rhs).IsZero()); }
public void bmm_8x8() { for (var i = 0; i < SampleSize; i++) { var m1 = Random.BitMatrix8(); var m2 = m1.Replicate(); var m3 = Random.BitMatrix8(); var m4 = m2 * m3; var m5 = BitRef.bmm(m1, m3); Claim.yea(m4 == m5); } }
void CycleColExtract8(int cycles = DefaltCycleCount) { for (var j = 0; j < cycles; j++) { var src = Random.BitMatrix8(); 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 bmm_8x8_bench() { var opcount = RoundCount * CycleCount; var sw = stopwatch(false); var last = BitMatrix8.Zero; for (var i = 0; i < opcount; i++) { var m1 = Random.BitMatrix8(); var m2 = Random.BitMatrix8(); sw.Start(); last = m1 * m2; sw.Stop(); } Collect((opcount, snapshot(sw), "bmm_8x8")); }
public void bmv_8x8() { for (var sample = 0; sample < SampleSize; sample++) { var m = Random.BitMatrix8(); var c = Random.BitVector8(); var z1 = m * c; var z2 = BitVector8.Alloc(); for (var i = 0; i < m.RowCount; i++) { var r = m.RowVector(i); z2[i] = r % c; } Claim.yea(z1 == z2); } }
public void bm_unpack_8x8x8_8x8x8() { var dst = Matrix.Alloc <N8, byte>(); var m = dst.ColCount; var n = dst.RowCount; for (var sample = 0; sample < SampleSize; sample++) { var src = Random.BitMatrix8(); 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); } } } }