sample3_5.cs

来自「C#的数值计算的几乎所有算法」· CS 代码 · 共 37 行

CS
37
字号
/*
 * 示例程序Sample3_5: Matrix类的对称正定矩阵的求逆
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            // 矩阵数据
            double[] mtxData6 = {
                                    5.0,7.0,6.0,5.0,
                                    7.0,10.0,8.0,7.0,
                                    6.0,8.0,10.0,9.0,
                                    5.0,7.0,9.0,10.0};

            // 构造矩阵
            Matrix mtx6 = new Matrix(4, mtxData6);

            // 对称正定矩阵的求逆
            if (mtx6.InvertSsgj())
            {
                Console.WriteLine(mtx6);
            }
            else
            {
                Console.WriteLine("失败");
            }		
        }
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?