public void AndNot16() { var lhs = Random.BitMatrix16(); var rhs = lhs.Replicate(); Claim.yea(lhs.AndNot(rhs).IsZero()); }
void CycleColExtract16(int cycles = DefaltCycleCount) { for (var j = 0; j < cycles; j++) { var src = Random.BitMatrix16(); 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 bmv_16x16() { for (var sample = 0; sample < SampleSize; sample++) { var m = Random.BitMatrix16(); var c = Random.BitVector16(); var z1 = m * c; var z2 = BitVector16.Alloc(); for (var i = 0; i < m.RowCount; i++) { var r = m.RowVector(i); z2[i] = r % c; } Claim.yea(z1 == z2); } }
public void bmm_16x16_bench() { var opcount = RoundCount * CycleCount; var last = BitMatrix16.Zero; var sw = stopwatch(false); for (var i = 0; i < opcount; i++) { var m1 = Random.BitMatrix16(); var m2 = Random.BitMatrix16(); sw.Start(); last = m1 * m2; sw.Stop(); } Collect((opcount, snapshot(sw), "bmm_16x16")); }