⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sample3_7.cs

📁 使用C#编辑的一些矩阵运算的源程序
💻 CS
字号:
/*
 * 示例程序Sample3_7: Matrix类的求行列式值的全选主元高斯消去法
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            // 矩阵数据
            double[] mtxData1 = {
                                    1.0,2.0,3.0,4.0,
                                    5.0,6.0,7.0,8.0,
                                    9.0,10.0,11.0,12.0,
                                    13.0,14.0,15.0,16.0};
            double[] mtxData2 = {
                                    3.0,-3.0,-2.0,4.0,
                                    5.0,-5.0,1.0,8.0,
                                    11.0,8.0,5.0,-7.0,
                                    5.0,-1.0,-3.0,-1.0};

            // 构造矩阵
            Matrix mtx1 = new Matrix(4, mtxData1);
            Matrix mtx2 = new Matrix(4, mtxData2);

            // 求行列式值的全选主元高斯消去法
            double detValue1 = mtx1.ComputeDetGauss();
            double detValue2 = mtx1.ComputeDetGauss();
            Console.WriteLine("detValue1 = " + detValue1.ToString("F"));
            Console.WriteLine("detValue2 = " + detValue2.ToString("F"));		
        }
	}
}

⌨️ 快捷键说明

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