Ejemplo n.º 1
0
        void VerifyWriter <M, N, T>(int count, M m = default, N n = default, T exemplar = default)
            where M : ITypeNat, new()
            where N : ITypeNat, new()
            where T : unmanaged
        {
            var isFp = isFloat <T>();

            TypeCaseStart <M, N, T>();
            for (var i = 0; i < count; i++)
            {
                var filename = BlockMatrix.DataFileName <M, N, T>();
                var dstpath  = LogSettings.Get().TestLogPath(filename);
                var A        = Random.BlockMatrix <M, N, T>();
                if (isFp)
                {
                    A.Apply(round);
                }
                Matrix.WriteTo(A, dstpath);

                var srcPath = dstpath;
                var B       = BlockMatrix.ReadFrom <M, N, T>(srcPath);
                if (isFp)
                {
                    B.Apply(round);
                }

                Claim.yea(A == B);
            }

            TypeCaseEnd <M, N, T>();
        }