コード例 #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>();
        }
コード例 #2
0
ファイル: t_geev.cs プロジェクト: 0xCM/arrows
        public void test1()
        {
            var A     = Random.BlockMatrix <N5, double>();
            var eigen = mkl.geev <N5>(A);

            Claim.eq(5, eigen.Values.Length);
        }
コード例 #3
0
 void GemmInt32Format()
 {
     var domain = closed(-32768, 32768);
     var n      = n5;
     var m      = n5;
     var m1     = Random.BlockMatrix(domain, m, n);
     var m2     = Random.BlockMatrix(domain, m, n);
     var m3     = BlockMatrix.Alloc(m, n, 0);
     var m4     = mkl.gemm(m1, m2, ref m3);
 }
コード例 #4
0
 protected BlockMatrix <M, N, T> RMat <M, N, T>(Interval <T>?domain = null, M m = default, N n = default)
     where T : struct
     where M : ITypeNat, new()
     where N : ITypeNat, new()
 => Random.BlockMatrix <M, N, T>(domain);