void blockv_sub_check <N, T>() where N : ITypeNat, new() where T : unmanaged { var n = new N(); var dst = BlockVector.Zero <N, T>(); for (var i = 0; i < SampleSize; i++) { var v1 = Random.BlockVec <N, T>(); var v2 = Random.BlockVec <N, T>(); var v3 = BlockVector.Load(mathspan.sub(v1.Unsized, v2.Unsized), n); Linear.sub(v1, v2, ref v1); Claim.yea(v3 == v1); } }
void blockv_sub_bench <N, T>(N n = default) where T : unmanaged where N : ITypeNat, new() { var opcount = CycleCount * RoundCount; var sw = stopwatch(false); var opname = $"blockv_sub_{n}x{bitsize<T>()}"; var dst = BlockVector.Zero <N, T>(); for (var i = 0; i < opcount; i++) { var v1 = Random.BlockVec <N, T>(); var v2 = Random.BlockVec <N, T>(); sw.Start(); Linear.sub(v1, v2, ref v1); sw.Stop(); } Collect((opcount, sw, opname)); }