sample3_3.cs

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

CS
37
字号
/*
 * 示例程序Sample3_3: Matrix类的实矩阵求逆的全选主元高斯-约当法
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            // 矩阵数据
            double[] mtxData4 = {
                                    0.2368,0.2471,0.2568,1.2671,
                                    1.1161,0.1254,0.1397,0.1490,
                                    0.1582,1.1675,0.1768,0.1871,
                                    0.1968,0.2071,1.2168,0.2271};

            // 构造矩阵
            Matrix mtx4 = new Matrix(4, mtxData4);

            // 实矩阵求逆的全选主元高斯-约当法
            if (mtx4.InvertGaussJordan())
            {
                Console.WriteLine(mtx4);
            }
            else
            {
                Console.WriteLine("失败");
            }		
        }
	}
}

⌨️ 快捷键说明

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