コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: t_blockv_add.cs プロジェクト: 0xCM/arrows
        void blockv_add_check <N, T>()
            where N : ITypeNat, new()
            where T : unmanaged
        {
            var n  = new N();
            var v4 = BlockVector.Alloc <N, T>();

            for (var i = 0; i < CycleCount; i++)
            {
                var v1 = Random.BlockVec <N, T>();
                var v2 = Random.BlockVec <N, T>();
                var v3 = BlockVector.Load(mathspan.add(v1.Unsized, v2.Unsized), n);
                Linear.add(ref v1, v2);
                Claim.yea(v3 == v1);
            }
        }